I am learning hibernate . I am bit confused with hbm2dll.auto update property . Change in model object data type is not changing data type of table in mysql.
Firstly I have created User Pojo with userId as data type int . Initially I have made hbm2dll property as CREATE .
@Entity(name="user")
public class User {
@Id
private int userid;
private String username;
....
}
For persisting data firstly I have created user object like below and saved using sessionFactory .
User user = new user();
user.setUserid(1);
user.setUsername("First User");
Because of above effort User table got created where userid data is int.
But later I changed the pojo’s userid data type to string .
Also I changed hbm2ddl property to update .
So after this change even user object is having string as userid , table userid data type is not changing to varchar . How to change the data type of table using hibernate .