My product can support multiple different databases (oracle, sybase, postgres), users simply make a few changes to a config file and we sort out the hibernate dialects etc on startup. Our schema as a result is relatively simple and tries to avoid using db specific features that would add alot more complexity to our app.
One scenario we face due to some legacy code is a java object is marshalled to xml using JAXB and stored in a CLOB or TEXT column depending on the db type. Our column type in the hbm.xml is a custom class that actually extends ClobType and adds in some marshalling logic.
We started to investigate upgrading from hibernate 3.5.6, first to 3.6 and eventually 4.1 but this area of our application is holding us back as there were enough changes to the ClobType classes in v3.6 that our current strategy no longer works.
What would be the communities recommendation for approaching this problem. Many of the xml serialization questions I have seen in the past focus on one db type and the correct jdbc methods for persisting them. Im looking for the best way that will work out of the box across multiple db types.
Thanks, John
|