Hibernate version: 3.0
Hi!
I am writting hibernate mappings for my POJOs and i got a doubt:
I have two Entities: Pendency and Movement
Each entity have its own table.
A Movement holds the change history of a Pendency, so it is a many-to-one relationship.
My doubt is for Pendency mapping. It is not useful for our model to have a Set or List of Movements in a Pendency object, but just the Last one.
So i would like to have an attribute called lastMovement of Movement type and write an SQL or HQL statement on how to retrieve the last entity.
How could i do this?
Thank you very much!
|