【发布时间】:2018-11-21 11:16:41
【问题描述】:
我在我的项目中使用 Spring Data 并使用 JPA 在实体和我的表之间进行映射, 这是我的实体
public class daoTable {
@Id
@SequenceGenerator(name = "seq_table_nc", sequenceName = "SEQ_TABLE_NC")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_table_nc")
private Long id;
// setter && getter && outher params
}
这是我的回购
public interface daoTable Repository extends JpaRepository<daoTable , Long>, JpaSpecificationExecutor<daoTable >{}
当我尝试保存时,我遇到了这个问题:
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [GQAO.PK_RT]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statementjava.sql.SQLIntegrityConstraintViolationException: ORA-00001: violation de contrainte unique
【问题讨论】:
标签: java oracle hibernate jpa spring-data-jpa