Reputation: 371
I have an tiny int
column in MySQL. I want to convert it into int type of java.
So if I mention the column in my hibernate entity as
@Column(name="Columname")
private int something;
Will it cause an error as tiny int needs boolean type or will it get cast into int?
This code will be changed in production Db hence I cannot check it to see if it breaks.
Upvotes: 4
Views: 30108
Reputation: 915
JDBC driver maps databse type to java. So in case of mysql TINYINT
will be converted to java.lang.Boolean
or java.lang.Integer
.
Refer this link which explains : Java, JDBC and MySQL Types
Upvotes: 4