This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problematic ejb ql query

 
Liat Barda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic