There is one field in my form when the user do not fill, my application should put the value from id inside this field and generate the insert.
This value from id comes hibernate sequence like this:
@Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_ORDEM_SERVICO") @Column(name="actordemservicoid") private Long ordemServicoId;
That works fine. But, i can not get ordemServicoId before calls entityManager.persist() of my EntityHome. So, is there any way to get this sequence value?
I am using hibernate 3.2.6 and seam 2.1.2...
Thanks for any answer,
I solved my problem using an ugly way :s
I had to create one trigger BEFORE INSERT and in my code, after persist and flush, i call refresh method from EntityManager.