Reputation: 959
I'm updating the db that my application is using. The older schema used short a lot for things like id's etc, but the new schema has updated all these to int. Using a feature toggle for these mappings is next to near impossible with the code base that I have. And I would like to write the code to be able to use both the legacy db and the new one for testing purposes. Can I switch off the Schema wrong column type exception in Hibernate and just allow short in the db to be mapped to int in the code?
SchemaManagementException: Schema-validation: wrong column type encountered in
column [AddressTypeID] in table [dbo.AddressType]; found [smallint
(Types#SMALLINT)], but expecting [int (Types#INTEGER)
Upvotes: 1
Views: 3421
Reputation: 3166
I think the only solution is to switch to turn off hbm2ddl
hibernate.hbm2ddl.auto=none
With none
hibernate skips schema validation
Upvotes: 2