I have a project using multi-tenant with one database per tenant. So, I have a hard job to maintain these databases up-to-date. I discovered some days ago that the hbm2dll property set to "validate" will thrown an exception if the database schema is different than hibernate entities.
However, I'm facing some problems using this property. For example, this column:
@Column(columnDefinition="TINYINT(1) default 0") private int importance;
When the Hibernate is set to "update" it creates a column: importance tinyint(1) default 0
However, the "validate" throwed an exception:
Exception in thread "main" org.hibernate.HibernateException: Wrong column type in xxxxx.table_name for column importance. Found: bit, expected: TINYINT(1) default 0
Is hbm2dll=validate reliable?
|