-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Help with formula field
PostPosted: Fri Jul 14, 2006 9:20 am 
Newbie

Joined: Tue Nov 08, 2005 8:31 pm
Posts: 5
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!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 1:34 pm 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
Hibernate Reference Documentation
Chapter 7. Association Mappings
7.6. More complex association mappings

There's an example very similar to your problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.