com.googlecode.jpattern.orm.crud
Class OrmCRUDQuery

java.lang.Object
  extended by com.googlecode.jpattern.orm.crud.OrmCRUDQuery
All Implemented Interfaces:
IOrmCRUDQuery

public class OrmCRUDQuery
extends Object
implements IOrmCRUDQuery

Author:
Francesco Cina 22/mag/2011

Constructor Summary
OrmCRUDQuery(String deleteQuery, String loadQuery, String saveQuery, String updateQuery, String baseSelectClause, String baseFromClause, boolean generatedKey)
           
 
Method Summary
 boolean generatedKey()
          Return whether in the save query there are automatically generated key (for example using a call to a Sequence in the insert query)
 String getBaseFromClause()
          Return the name of the table (with the schema name if exists)
 String getBaseSelectClause()
          Return the ordered names of the columns using as alias for the table the complete table name (with the schema name if exists).
 String getBaseSelectClause(String rowNamePrefix)
          It wokrs like getBaseSelectClause() but instead of using the complete table name as alias it uses a custom prefix to prepend to the column names
 String getDeleteQuery()
          The pregenerated query to delete an entity
 String getLoadQuery()
          The pregenerated query to load an entity
 String getSaveQuery()
          The pregenerated query to save an entity
 String getUpdateQuery()
          The pregenerated query to update an entity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrmCRUDQuery

public OrmCRUDQuery(String deleteQuery,
                    String loadQuery,
                    String saveQuery,
                    String updateQuery,
                    String baseSelectClause,
                    String baseFromClause,
                    boolean generatedKey)
Method Detail

getLoadQuery

public String getLoadQuery()
Description copied from interface: IOrmCRUDQuery
The pregenerated query to load an entity

Specified by:
getLoadQuery in interface IOrmCRUDQuery
Returns:

getSaveQuery

public String getSaveQuery()
Description copied from interface: IOrmCRUDQuery
The pregenerated query to save an entity

Specified by:
getSaveQuery in interface IOrmCRUDQuery
Returns:

getDeleteQuery

public String getDeleteQuery()
Description copied from interface: IOrmCRUDQuery
The pregenerated query to delete an entity

Specified by:
getDeleteQuery in interface IOrmCRUDQuery
Returns:

getUpdateQuery

public String getUpdateQuery()
Description copied from interface: IOrmCRUDQuery
The pregenerated query to update an entity

Specified by:
getUpdateQuery in interface IOrmCRUDQuery
Returns:

generatedKey

public boolean generatedKey()
Description copied from interface: IOrmCRUDQuery
Return whether in the save query there are automatically generated key (for example using a call to a Sequence in the insert query)

Specified by:
generatedKey in interface IOrmCRUDQuery
Returns:

getBaseSelectClause

public String getBaseSelectClause()
Description copied from interface: IOrmCRUDQuery
Return the ordered names of the columns using as alias for the table the complete table name (with the schema name if exists). This is used to create custom select query

Specified by:
getBaseSelectClause in interface IOrmCRUDQuery
Returns:

getBaseFromClause

public String getBaseFromClause()
Description copied from interface: IOrmCRUDQuery
Return the name of the table (with the schema name if exists)

Specified by:
getBaseFromClause in interface IOrmCRUDQuery
Returns:

getBaseSelectClause

public String getBaseSelectClause(String rowNamePrefix)
Description copied from interface: IOrmCRUDQuery
It wokrs like getBaseSelectClause() but instead of using the complete table name as alias it uses a custom prefix to prepend to the column names

Specified by:
getBaseSelectClause in interface IOrmCRUDQuery
Returns:


Copyright © 2011. All Rights Reserved.