What does JPA @UniqueConstraint do in Hibernate?

后端 未结 1 1605
陌清茗
陌清茗 2021-01-29 02:08

In Hibernate, why should I use the JPA tag:

@Table(name=\"tbl_sky\",
    uniqueConstraints = {@UniqueConstraint(columnNames={\"month\", \"day\"})}
)
相关标签:
1条回答
  • 2021-01-29 02:45

    It helps hibernate in schema generation (DDL) for your mappings. Look at: http://docs.oracle.com/javaee/6/api/javax/persistence/UniqueConstraint.html

    0 讨论(0)
提交回复
热议问题