-->
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.  [ 7 posts ] 
Author Message
 Post subject: component in a component
PostPosted: Fri Mar 23, 2007 11:50 am 
Beginner
Beginner

Joined: Sat Jan 15, 2005 4:50 am
Posts: 23
Hi! i have a TimePeriod class, wich contains begin TimePoint, and end TimePoint. TimePoint class represents a single Date value.

I think id doesn't make sense, to map these classes as entities. I prefer to map them as value objects.

Unfortunatly, i get the following exeption: org.hibernate.QueryException: could not resolve property: end of: com.itcodex.objectpuzzle.party.domain.Person

(Person is a class wich has a TimePeriod association called valid)

I map it like this in Person.hbm.xml:

Code:
<component name="valid" class="com.itcodex.objectpuzzle.framework.fundamental_types.domain.TimePeriod">
         <component name="begin" class="com.itcodex.objectpuzzle.framework.fundamental_types.domain.TimePoint">
            <property name="value" column="BEGIN_VALUE" type="java.util.Date"></property>
         </component>

         <component name="end" class="com.itcodex.objectpuzzle.framework.fundamental_types.domain.TimePoint">
            <property name="value" column="END_VALUE" type="java.util.Date"></property>
         </component>
      </component>


Am i doing something wrong? thanks.


Top
 Profile  
 
 Post subject: Re: component in a component
PostPosted: Fri Mar 23, 2007 12:57 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
1) What is the query you used?
2) The error does not seem to speak about the component, but about the Person class itself, that's why I think there's a problem in the way you're querying.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 23, 2007 1:12 pm 
Beginner
Beginner

Joined: Sat Jan 15, 2005 4:50 am
Posts: 23
Hi!

The query is:

from Person p where p.valid.end is not null and p.valid.end.value >= current_date()) or (p.valid.end is null) ) and p.valid.begin.value <= current_date()


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 24, 2007 11:00 am 
Beginner
Beginner

Joined: Sat Jan 15, 2005 4:50 am
Posts: 23
up


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 3:25 am 
Beginner
Beginner

Joined: Sat Jan 15, 2005 4:50 am
Posts: 23
from Person p where ((p.valid.end is not null and p.valid.end.value >= current_date()) or (p.valid.end is null) ) and p.valid.begin.value <= current_date()


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 10:41 am 
Beginner
Beginner

Joined: Sat Jan 15, 2005 4:50 am
Posts: 23
anybody? :P


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 10:45 am 
Beginner
Beginner

Joined: Sat Jan 15, 2005 4:50 am
Posts: 23
anybody? :P gavin? XD


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.