Hi guys, I'm quite new with Hibernate. I could really use your help. Basically, I have two entities: let's call it Item and ItemRevision.
The Item, for simplicity, only holds an ID property. All information regarding it is stored in an ItemRevision (such as name). The ItemRevision references some Item it describes and has dateValid property. Basically, a revision is valid from its dateValid up to another entry's dateValid. Assuming all entries have dateValid values in the past, the current revision is that which has the latest dateValid.
Now, I wanted to map the current revision to some property in Item. Problem is that I don't have a limit annotation, any hints?
Code:
@Entity
public class Item {
@OneToOne //Currently doesn't work without the limit
@Where("date_valid<=NOW()")
@OrderBy("dateValid desc")
//then some other annotation for the limit?
private ItemLineRevision currentRevision
}