Hi Malte,

The simplest solution is to use your old ID generator or to write new service for ID generation which will be using necessary logic, then instead of using OpenJPA build-in generators just set generated ID into your object.

Dima

18.08.2013 14:06, Malte пишет:
Hi !

I'm new to JPA (and OpenJPA). For a new project i consider to use OpenJPA as the persistence layer. During my investigations, I came across a problem.

The existing system uses a table id generator. The ID saved in the id-table is always the last used id. The OpenJPA table-id-generator assumes that this is the next available id. I can't change the behaviour of the old system, so I'm looking for a solution in the OpenJPA System.

I've been looking for a way to implement a custom id generator, but i can't find any working example. Is it even possible to implement a custom generator?

Regards
Malte



Reply via email to