Closed leeaee closed 6 years ago
@leeaee The issue is in the implementation of UuidSequence
, you must overwrite shouldUsePreallocation
and return false
:
@Override
public boolean shouldUsePreallocation() {
return false;
}
@greenlaw110 Add the code, it works. Thank you for point the correct usage of the eclipselink session customizer.
Define a EclipseLink custom id generator
Add configuration in properties like
Use the id generator in entity
And when doing save operation, it will throw NullPointerException:
Offical link: https://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomSequencing