Hello,
I am wondering if it is possible to use the @GeneratedValue and @GenericGenerator annotations also on non id columns (columns not annotated with @Id)?
I tested it with some classes and it seems, that the generator is only used, when the @Id annotation is set.
Because we don't want to use fields, which are used outside the system as identifiers for data, as primary keys we have an internal primary key, which is already annotated with @Id and generated via a sequence. Additionally there is the mentioned second field which data is communicated to other applications.
This second field is basically also unqiue and should also be generated via a (second) sequence (in fact we like to use a custom generator).
Is there any chance to use the hibernate functionalities also for this column or does we have to implement some own functionality?
Best regards and thanks for help,
Oliver
|