2
I’d like to use the @GeneratedValue(strategy = GenerationType.SEQUENCE, ... ... when extending the class AbstractPersistable, but I don’t know if that’s possible.
From what I saw in the documentation the class AbstractPersistable has the attribute Id with the annotation @GeneratedValue but does not state what strategy is used by the annotation @GeneratedValue to create the sequence used by the Spring framework.
How do I use the GenerationType.SEQUENCE specifically extending the class AbstractPersistable to have greater productivity?
Only use
SequenceGeneratorin the entity that inherits fromAbstractPersistable, No? Then you’d have to do it on all the ones you inherit fromAbstractPersistable. To abstract this, create aAbstractPersistableown.– Bruno César
It’s true, some developers use this practice. You can demonstrate how to create an Abstractpersistable @Brunocesar;
– Pena Pintada