File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Is it possible to use Multiple hibernate configuration for same database schema? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Is it possible to use Multiple hibernate configuration for same database schema?" Watch "Is it possible to use Multiple hibernate configuration for same database schema?" New topic
Author

Is it possible to use Multiple hibernate configuration for same database schema?

harini badri
Greenhorn

Joined: Feb 06, 2012
Posts: 2
Hi,

We are trying to support different version of software for same database schema.The database here is upgraded, but still want the lower versions to work with it. Is it possible to do so with hibernate?

I have a column called "Class' which is a discriminator column for the table.

In version 1 of the software we had subclass A and B.
In version 2 we are introducing another subclass C.

Now how to make both the version 1 work with version 2?

In version 1, I get net.sf.hibernate.WrongClassException when the table has a value C in the column "Class".

Without any code change in version 1 is it possible to design hibernate in such way that it can work for upgraded database schema.

Thanks.



harini badri
Greenhorn

Joined: Feb 06, 2012
Posts: 2
Hi,

Got this resolved by setting force=true for discriminator column.

Thanks.
 
 
subject: Is it possible to use Multiple hibernate configuration for same database schema?
 
Threads others viewed
ERROR OGG-01163 Bad column length, and CHAR data type
WrongClassException: Object with id:1 was not of the specified subclass
Hibernate Association
Hibernate Association
Cascading non foreign key to Child Table
IntelliJ Java IDE