This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes problematic ejb ql query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "problematic ejb ql query" Watch "problematic ejb ql query" New topic
Author

problematic ejb ql query

Liat Barda
Greenhorn

Joined: Sep 17, 2003
Posts: 9
I got an alerts table that contains alerts recived by servers the columns are: serverip, time stamp,alert type.
I would like to get a list of all alerts but if two alerts have the same ip and type - i want to check thier time stamp and only if alert a.timestame >alertb.timestamp + 60 sec - i want to see both of them
otherwise only one of then should be returned from the query(the newer one).
will be happy to see some complex examples of ejb ql.
thanks
liat


liat barda
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

Liat,
That seems to complex to do in EJB-QL. You can write a simpler finder and put the logic in a session bean. In other words, call the session bean and filter the results there.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: problematic ejb ql query
 
jQuery in Action, 3rd edition