我的问题既简单又直截了当。我需要向生成的实体类添加一个@NamedQueries注释。JPA层是用Hyperjaxb生成的。我不知道如何使用元素添加这一行。
...
@NamedQueries(value = {
@NamedQuery(name ="SampleType.sampleQuery", query="select r from SampleType r where r.index=:index"),
})
public class SampleType{
....
}如何将特定的注释添加到生成的类型中?
<bindings node="xsd:complexType[@name='SampleType']">
.... // What do I put here???
</bindings>发布于 2016-02-24 19:36:45
我想出来了
<bindings node="xsd:complexType[@name='SampleType']">
<annox:annotate>
<annox:annotate
annox:class="org.hibernate.annotations.NamedQueries">
<annox:annotate
annox:class="org.hibernate.annotations.NamedQuery"
name="SampleType.sampleQuery" query="select r from SampleType r where r.index=:index">
</annox:annotate>
</annox:annotate>
</annox:annotate>
....
....
</bindings>https://stackoverflow.com/questions/35610770
复制相似问题