org.tranql.builder
Class EJBQueryBuilder

java.lang.Object
  extended byorg.tranql.builder.EJBQueryBuilder

public class EJBQueryBuilder
extends java.lang.Object

Version:
$Revision: 336 $ $Date: 2006-05-27 13:50:08 +0200 (Sat, 27 May 2006) $

Constructor Summary
EJBQueryBuilder(IdentityDefinerBuilder identityDefinerBuilder)
           
 
Method Summary
 UpdateCommand buildCreate(java.lang.String name)
          INSERT INTO ejb VALUES(...)
 QueryCommand buildFindByPrimaryKey(java.lang.String name, boolean local)
          SELECT OBJECT(e) FROM ejb AS e WHERE e.pk = ?
 QueryCommand buildLoad(java.lang.String name, java.lang.String[] attrNames)
          SELECT e.a1, e.a2 FROM ejb AS e WHERE e.pk = ?
 UpdateCommand buildMTMCreate(Association association)
           
 UpdateCommand buildMTMRemove(Association association)
           
 UpdateCommand buildRemove(java.lang.String name)
           
 UpdateCommand buildStore(java.lang.String name)
          UPDATE ejb AS e SET e.f1 ?= ?, e.f2 ?= ? WHERE e.pk = ?
 UpdateCommand buildStore(java.lang.String name, CacheRow cacheRow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJBQueryBuilder

public EJBQueryBuilder(IdentityDefinerBuilder identityDefinerBuilder)
Method Detail

buildFindByPrimaryKey

public QueryCommand buildFindByPrimaryKey(java.lang.String name,
                                          boolean local)
                                   throws QueryException
SELECT OBJECT(e) FROM ejb AS e WHERE e.pk = ?

Parameters:
name - the global name of the EJB
Returns:
a select Query
Throws:
QueryException

buildLoad

public QueryCommand buildLoad(java.lang.String name,
                              java.lang.String[] attrNames)
                       throws QueryException
SELECT e.a1, e.a2 FROM ejb AS e WHERE e.pk = ?

Parameters:
name - the global name of the EJB
attrNames - the name of the attributes to load
Returns:
a select Query
Throws:
QueryException

buildCreate

public UpdateCommand buildCreate(java.lang.String name)
                          throws QueryException
INSERT INTO ejb VALUES(...)

Parameters:
name - the global name of the EJB
Returns:
an insert query
Throws:
QueryException

buildStore

public UpdateCommand buildStore(java.lang.String name)
                         throws QueryException
UPDATE ejb AS e SET e.f1 ?= ?, e.f2 ?= ? WHERE e.pk = ?

Parameters:
name -
Returns:
Throws:
QueryException

buildStore

public UpdateCommand buildStore(java.lang.String name,
                                CacheRow cacheRow)
                         throws QueryException
Throws:
QueryException

buildRemove

public UpdateCommand buildRemove(java.lang.String name)
                          throws QueryException
Throws:
QueryException

buildMTMCreate

public UpdateCommand buildMTMCreate(Association association)
                             throws QueryException
Throws:
QueryException

buildMTMRemove

public UpdateCommand buildMTMRemove(Association association)
                             throws QueryException
Throws:
QueryException


Copyright © -2006 The Codehaus. All Rights Reserved.