Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Sorting by Date , I can't solve it
Sorting by Date , I can't solve it [message #1033529] Thu, 04 April 2013 10:30 Go to next message
mohamed ibrahim mohamed is currently offline mohamed ibrahim mohamedFriend
Messages: 6
Registered: April 2013
Junior Member
I have Entities object graph like that .



@Entity
....
public class ReferralRequestEO implements Serializable
{
 ....


 private List<ReferralSpecialtyEO> specialties;

}


@Entity
....
public class ReferralSpecialtyEO implements Serializable
{
  ......
       private WorkflowTransitionEO activeTransition;

}

@Entity
.....
public class WorkflowTransitionEO implements Serializable
{
   ......
   @Temporal(Temporal.TimeStamp)
   private Date transitionDate;
   
   @oneToOne
   joinColumn(...)
   private InstructionEO instruction;
}

@Entity
.....
public class InstructionEO implements Serializable
{
      private String instructionType;
}




From the above object graph , i would like to know what is the latest WorkflowTransition whose instructiontype "APPROVED" for all referralRequests .

i am using EclipseLink , Spring 3.0 and JSF 2.0
Re: Sorting by Date , I can't solve it [message #1037416 is a reply to message #1033529] Tue, 09 April 2013 14:29 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

There are probably a few way to do this query, perhaps something like,

Select r, t from ReferralRequestEO r join r.specialties s join s.activeTransition t where t.transitionDate = (Select max(t2.transitionDate) from instructiontype WorkflowTransitionEO t2 where t = t2 and t2.instructionType = "APPROVED")

See,
http://en.wikibooks.org/wiki/Java_Persistence/JPQL


James : Wiki : Book : Blog : Twitter
Re: Sorting by Date , I can't solve it [message #1058133 is a reply to message #1037416] Sun, 12 May 2013 10:55 Go to previous message
mohamed ibrahim mohamed is currently offline mohamed ibrahim mohamedFriend
Messages: 6
Registered: April 2013
Junior Member
Dear James ,

I have followed your Query but still does not work , i still have rejected requests appear as approved Requests because they had the approved State before.
Previous Topic:I need to capture database warnings, which log level to use?
Next Topic:Difficult Query to be made in Eclipselink
Goto Forum:
  


Current Time: Tue Apr 16 17:32:48 GMT 2024

Powered by FUDForum. Page generated in 0.22230 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top