-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem with Formula
PostPosted: Fri Dec 29, 2006 12:31 pm 
Newbie

Joined: Fri Dec 29, 2006 12:20 pm
Posts: 8
Hi,

I have a problem with searching. I have an Equipment entity which can have n EquipmentInstances. Each EquipmentInstance (call it inst) has a "last visited date" and each Equipment (call it equi) has a "checking period".

I want to find the instances which has the following condition:
Code:
inst.lastVisitedTime + equi.checkingPeriod < now


What I myself think is to use formula, but I don't know how.

Any help will be appreciated. Thanks inadvance.

_________________
--
REZA++


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 29, 2006 5:07 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Well, could you precise what you want to do, because from what you say, if you need to search, you don't want to use formula, but a query instead (sql, hql, or criteria say).

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


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 30, 2006 6:34 am 
Newbie

Joined: Fri Dec 29, 2006 12:20 pm
Posts: 8
Hi,

I have two problems, one is calculating the date (to calculate n day after a date) and the other one is that I should follow the foreign keys to find the appropriate Equipment of each EquipmentInstance (which I couldn't do we Criteria).

If you have any other solution (Criteria, HQL, ...) that may help me, I will be grateful.

Thanks again.

_________________
--
REZA++


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