|Custom Sequence Generators with NON-JPA API? [message #1677423]
|Sun, 15 March 2015 22:20
| Thom Park
Registered: June 2012
I'm still in non-JPA purgatory and struggling with trying to implement an equivalent of the steps described in:
That example is really good for JPA-based implementations but I'm stuck with the pre-JPA API implementation.
Does anyone have any idea if this is even possible outside of the JPA persistence context?
What I'm basically trying to do is produce a customized variant of the good old Sequence but every attempt I've made to craft one (and basically use a service call to fetch the next batch of sequence numbers instead of accessing a table) has failed with various weird NPEs due to my state being wrong.
The example quoted above referred to using a session customizer to handle the sequence generation but there doesn't appear to be a way to wire that approach into the pre-JPA eclipselink word (I'm actually using version 2.0.2 in one deployment and 2.2.0 in another - 2.5.2 proves to be a bit unstable for some of the fetch flows that work well in 2.0.2 so I cannot jump to that version)
I've tried the Sub-classing DefaultSequence (and Sequence) and assigning the new subclass and adding the sequnece to the login. Then referred to the sequence by name in my entity definition (that failed as the platform associated with the sequence was null)
I also tried overriding the sequence associated with the Class descriptor of the particular class I was trying to assign a service-based key generator for when loading my project (via the Java API).
That too ended badly.
So - can anyone remember far enough back in time to tell me if it's even possible to setup a custom sequence generator that's not based on the existing table scheme with eclipselink/toplink that isn't based on JPA?
Powered by FUDForum
. Page generated in 0.02216 seconds