वरुण
वरुण

Reputation: 1695

How to generate short variable for smallint type columns using JPA Tools in eclipse?

I was generating Entity class using JPA Tools in eclipse Mars. It generates data member of Integer datatype which is smallint type in table.I need to generate short type of datatype for column which is smallint in table.

Upvotes: 0

Views: 8924

Answers (2)

Karthigeyan Vellasamy
Karthigeyan Vellasamy

Reputation: 2066

After entering JPA entities from table wizard after selecting table->table Association->Customize Defaults->customize indicidual Entities .. here you can customize your table

But usually it ll automatically convert smallint type to short.

enter image description here

Upvotes: 1

karim mohsen
karim mohsen

Reputation: 2254

I think something like this might work :-

@Column(columnDefinition = "SMALLINT")
@Type(type = "org.hibernate.type.ShortType")
private short variableName;

Upvotes: 4

Related Questions