Hyperjaxb @Entity
如何避免在@Entity注释中声明派生类的完全限定名称? 我有以下 xsd:
<xsd:complexType name="Project">
<xsd:annotation>
<!-- ... -->
</xsd:annotation>
<xsd:sequence>
<!-- ... -->
</xsd:sequence>
</xsd:complexType>
但它生成以下 java 源:
@Entity(name = "com.mycompany.db.Project")
@Table(name = "project")
@Inheritance(strategy = InheritanceType.JOINED)
public class Project
implements Equals, HashCode, ToString
{
...
}
我需要从 @Entity 中显式删除名称,就像:
@Entity
@Table(name = "project")
@Inheritance(strategy = InheritanceType.JOINED)
public class Project
implements Equals, HashCode, ToString
{
...
}
谢谢,
How to avoid declaring fully qualified name of the derived class in @Entity annotation?
I have the following xsd:
<xsd:complexType name="Project">
<xsd:annotation>
<!-- ... -->
</xsd:annotation>
<xsd:sequence>
<!-- ... -->
</xsd:sequence>
</xsd:complexType>
but it generates the following java source:
@Entity(name = "com.mycompany.db.Project")
@Table(name = "project")
@Inheritance(strategy = InheritanceType.JOINED)
public class Project
implements Equals, HashCode, ToString
{
...
}
I need to remove explicitly name from @Entity, to be like:
@Entity
@Table(name = "project")
@Inheritance(strategy = InheritanceType.JOINED)
public class Project
implements Equals, HashCode, ToString
{
...
}
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哇,Hyperjaxb 现在在 SO 上有自己的标签了。 :)
在新版本(0.5.5,即将发布)中,HJ3 生成非限定实体名称。请参阅http://jira.highsource.org/browse/HJIII-34。
Wow, Hyperjaxb now has an own tag on SO. :)
In the new version (0.5.5, to be released soon) HJ3 generates non-qualified entity names. See http://jira.highsource.org/browse/HJIII-34.