2016년 7월 12일 화요일

[스프링,JPA학원추천][JPA,오라클DB]@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

댓글 없음:

댓글 쓰기