Advice on migrating from 3.0 to 5.6 (later 6.x/7.0)

Hi,

I am starting work on migrating from v3.0 and I know hibernate is soon in version 7… and I dont know too much about hibernate technicalities… So I am hoping someone remembers 15-20 year old stuff… Along with a java 8 to 11 migration.

The datamodel is large, but quite simple, with unrelational tables. The xdoclet annotations are simple and mostly: class, table, id and property.

I was first thinking to get rid of the xdoclet/ant task I imported, when migrating to Gradle, and steal the generated mapping files. Then move forward with upgrading hibernate from 3.0 → 3.5, then 4.0, 4.6 (I think it was), then 5.0… (it seems thats where the major migration issues occur (or was that Spring).

Then some questions came to mind:

  • Can hbm.xml files be used in 5.6 and 6.x, with approximately the same syntax and meaning as in 3.0, if not pointer to descriptions are valuable.
  • Should I start by staying with a mapping file or should I move directly to annotations? which is less error prone in moving all the way to 5.6/6.x/7.0.
  • Are the annotations consistent in meaning and use, in large part, from 3.5 to 5.6?
  • Are there any major technology issues I should be aware of when moving to 5.6?

Any other thoughts are much appreciated.

Thanks in advance,

Thomas

At this point, nobody really knows what problems you might encounter. Hibernate ORM 3.0 is just way too old and unmaintained.
You can still use hbm.xml, and I guess that will also be the easiest transition for you, but maybe you want to start afresh by generating an annotated Java model with hibernate-tools from the database model.

Thank you for very useful information. I have to admit I laughed a bit about “nobody really knows what problems you might encounter”. Its sad, but true.

I will have a look at hibernate-tools, it could make the transition easier. I think I might reuse the hbm.xml files for the first version, so I can migrate the build to a pure Gradle build and then start upgrading hibernate to version 4.0 as a first step.

Thank you, I am sure I will get back with other questions on my way to 6.x/7.x

Thomas