-->
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.  [ 1 post ] 
Author Message
 Post subject: How to map Relationship that is based on date within a range
PostPosted: Wed Mar 28, 2007 8:24 pm 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:50 pm
Posts: 22
I am having difficulties knowing where to start on the following:

I have an entity Building. Building has a date field.
I want to utilise the date field to find its relation to another entity, BuildingPriceIndex using the date as a in range query relationship.

For example, If Building.buildingDate has a value of '3/1/07' it will have a 1-1 relationship to a BuildingPriceIndex which has a dateStart of 1/1/07 and dateEnd of 31/1/07.

How should I structure my Building mapping file to join the BuildingPriceIndex to Building based on buildingDate between a date range. Since Building has no fk to BuildingPriceIndex.

I initially had the entity querying the service layer to retrieve the BuildingPriceIndex but my entities shouldn't really be talking to the service layer....


class Building
{
int buildingId
DateTime buildingDate
BuildingPriceIndex bpi
}

class BuildingPriceIndex
{
int buildingPriceIndexId
DateTime dateStart
DateTime dateEnd
}


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

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.