Hard
Hard

Reputation: 43

Long column size in JPA/Hibernate

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = COMPANY_ID , length = 10)
private Long id;

enter image description here

in my sql it gets converted to BIGINT(20),what if i want it to be int(11) or how to give specific size to Long field??

Upvotes: 0

Views: 2463

Answers (1)

Amer Qarabsa
Amer Qarabsa

Reputation: 6574

you can use columnDefinition inside @Column()

 @Column(columnDefinition="BIGINT(20)")

Upvotes: 1

Related Questions