gpt4 book ai didi

java - 如何在xml中映射@Field

转载 作者:行者123 更新时间:2023-11-30 22:52:37 26 4
gpt4 key购买 nike

谁能帮我在 xml (Hibernate) 中映射这段代码

@Column(name = "title", nullable= false, length = 128)
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String title;

@Column(name = "description", nullable= false, length = 256)
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String description;

@Column(name = "author", nullable= false, length = 64)
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String author;

映射@Column 很容易,但我不知道如何在xml 文件中映射@Field。

引用:Integrating Full Text Search to Spring MVC with Hibernate

最佳答案

目前不支持通过 XML 搜索注释,请参阅 the hibernate documentation :

Hibernate Search has its own set of annotations (@Indexed, @DocumentId, @Field,…​) for which there exists so far no XML based alternative; if annotations aren’t suited for your project, a better option is the Programmatic Mapping API.

关于java - 如何在xml中映射@Field,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27698956/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com