2016년 12월 16일 금요일

[자바교육,스프링교육,JPA교육학원_탑크리에듀][JPA,오라클팁]@Entity,@Column에기본값(default)주기

[JPA,오라클팁]@Entity,@Column에기본값(default)주기

@Column(nullable=false, columnDefinition = "number(5) default 0")
protected Integer readcount;

생성된 SQL은 다음과 같다.

create table ... (
   ......
   readcount number(5) default 0 not null
)

댓글 없음:

댓글 쓰기