hibernate ant 工具生成的 hbm 文件将丢失“DiscriminatorColumn”字段。
我已经使用 hibernate 注释定义了一个 Article
实体:
@Entity
@Table(name = "WZQ_ARTICLES")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "ARTICLE_TYPE", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("CURRENT")
public class Article {
}
它使用 ARTICLE_TYPE
列作为鉴别器列。但生成的 hbm 不包含它。
当我插入一个新的 Article
实体时,它会报告一个异常:
Caused by: org.h2.jdbc.JdbcSQLException: Column "ARTICLE_TYPE" not found; SQL statement:
I have defined a Article
entity with hibernate annotations:
@Entity
@Table(name = "WZQ_ARTICLES")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "ARTICLE_TYPE", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("CURRENT")
public class Article {
}
It uses a ARTICLE_TYPE
column as the discriminator column. But the generated hbm doesn't contain it.
When I insert a new Article
entity, it will report an exception said:
Caused by: org.h2.jdbc.JdbcSQLException: Column "ARTICLE_TYPE" not found; SQL statement:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论