At the moment I'm trying to combine a pretty old messy monolithic application with a nice up to date Spring micro-service architecture to get rid of the monolith some time in the future. The problem I struggle, is to generate unique ids when inserting new entities on both sides (hibernate and eclipselink).
At the moment, the monolith application uses Eclipse Link and unfortunately, I can't really touch the old domain model, due to heavy dependencies through different application layers. But now it's the point, where the application is simply not maintainable anymore, and implementing new features is like walking through a minefield with one leg only.
So we decided to migrate to a nice and clear micro-service architecture and to replace more and more parts of the monolithic application, till we fully replace it.
The first step was to generate a new independent domain model from the database directly to use it in the spring/hibernate application. But now we struggle with id generation.
Did anyone use Eclipse Link and Hibernate together on the same postgres database?
We already tried to use GenerationType.AUTO and GenerationType.TABLE on both sides, but it seems like Eclipse Link and Hibernate calculate new IDs completely different. We also tried to set the hibernate property "new_generator_mappings:true" to avoid the multiplication by 50 which hibernate is always using. But unfortunately this didn't work either.
Kind regards, Florian