Closed
Description
It would be very convenient to be able to specify a "fallback" id generator to use when @GeneratedValue
has no generator
member, and the entity does not explicitly declare any @TableGenerator
or @SequenceGenerator
. This fallback could even be per-GenerationType
.
One way would be via a property setting, so that, for example, you could set:
jakarta.persistence.generator.AUTO = myDefaultSequenceGenerator
jakarta.persistence.generator.SEQUENCE = myDefaultSequenceGenerator
jakarta.persistence.generator.TABLE = myDefaultTableGenerator
But actually the most natural solution would be to let you declare a @TableGenerator
or @SequenceGenerator
with no name
at the package level. And then that generator would be used as the fallback for the whole package.
That's a great solution, but I believe @lukasj mentioned he has some problems with us using package-level annotations.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done
Activity