Enterprise Computing
Tuesday, November 15, 2005
  Simple EJB-QL Examples

// findByMethodObjectId(String objectId);

SELECT OBJECT(x) FROM PlutoObject x WHERE x.objectId = ?1

// Object is the ejb collection of entities
// PlutoObject is the entity name
// ?1 is the first parameter in the java method
// x is the table/entity alais

// findByObjectIdAndStatus(String objectId, String status)

SELECT OBJECT(x) FROM PlutoObject x WHERE x.objectId = ?1 AND x.status = ?2

SELECT OBJECT(s) FROM Shortcut s WHERE s.targetId = ?1

 




<< Home
Alistair Thomas's 'everything to do with enterprise computing'.

Archives
03/01/2004 - 04/01/2004 / 04/01/2004 - 05/01/2004 / 05/01/2004 - 06/01/2004 / 08/01/2004 - 09/01/2004 / 03/01/2005 - 04/01/2005 / 04/01/2005 - 05/01/2005 / 06/01/2005 - 07/01/2005 / 08/01/2005 - 09/01/2005 / 09/01/2005 - 10/01/2005 / 11/01/2005 - 12/01/2005 / 02/01/2010 - 03/01/2010 / 06/01/2013 - 07/01/2013 /


Powered by Blogger

Subscribe to
Posts [Atom]