JPA중복컬럼 에러

Kyle_Kim·2022년 4월 16일
0

중복컬럼 에러

해당 entity의 ID로 참조한 컬럼으로 또 다른 entity를 조인해야 하는 상황이 발생했다. 에러는 @JoinColumn Annotation에 insertable=false, updatable=false값을 추가해 주는것으로 마무리 되었다. 밑의 코드를 참고해 보자

	@Id
    @Column(
        name = "ASST_SEQNO",
        nullable = false
    )
    private Long assetSeqno;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(
        name = "ASST_SEQNO",
        foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT),
        insertable = false,
        updatable = false
    )
    @NotFound(action = NotFoundAction.IGNORE)
    private Machine machine;
profile
Make Things Right

0개의 댓글