How do I get the generated ID for an object before hibernate saves it. Here's the code:
@Id
@SequenceGenerator(name="MY_SEQ", sequenceName="MY_SEQ", allocationSize=1 )
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MY_SEQ")
private long id;
Is there any way that I can do this without using a select on currval('MY_SEQ') ?
Thanks