com.jpattern.orm.crud
Class OrmCRUDQuery

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

public class OrmCRUDQuery
extends Object
implements CRUDQuery

Author:
Francesco Cina 22/mag/2011

Constructor Summary
OrmCRUDQuery()
           
 
Method Summary
 String getBaseFromClause()
          Return the name of the table (with the schema name if exists)
 String getBaseSelectClause()
          Return the ordered names of the columns used as alias for the table with the complete table name (with the schema name if exists).
 String getBaseSelectClause(String rowNamePrefix)
          It works like getBaseSelectClause() but instead of using the complete table name as alias it uses a custom prefix to prepend to the column names
 String getBeanVersionQuery()
          If the bean has a version field, it will return the query to retrieve the updated version of the record
 String getDeleteQuery()
          The pregenerated query to delete an entity
 String getExistQuery()
          The pregenerated count query to check if an entity exists
 String getLoadQuery()
          The pregenerated query to load an entity
 String getSaveQuery()
          The pregenerated query to save an entity
 String getSaveQueryWithoutGenerators()
          The pregenerated query to save an entity ignoring the generators if needed
 String getUpdateQuery()
          The pregenerated query to update an entity
 void setBaseFromClause(String baseFromClause)
           
 void setBaseSelectClause(String baseSelectClause)
           
 void setBeanVersionQuery(String beanVersionQuery)
           
 void setDeleteQuery(String deleteQuery)
           
 void setExistQuery(String existQuery)
           
 void setLoadQuery(String loadQuery)
           
 void setSaveQuery(String saveQuery)
           
 void setSaveQueryWithoutGenerators(String saveQueryWithoutGenerators)
           
 void setUpdateQuery(String updateQuery)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrmCRUDQuery

public OrmCRUDQuery()
Method Detail

getLoadQuery

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

Specified by:
getLoadQuery in interface CRUDQuery
Returns:

getSaveQuery

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

Specified by:
getSaveQuery in interface CRUDQuery
Returns:

getDeleteQuery

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

Specified by:
getDeleteQuery in interface CRUDQuery
Returns:

getUpdateQuery

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

Specified by:
getUpdateQuery in interface CRUDQuery
Returns:

getBaseSelectClause

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

Specified by:
getBaseSelectClause in interface CRUDQuery
Returns:

getBaseFromClause

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

Specified by:
getBaseFromClause in interface CRUDQuery
Returns:

getBaseSelectClause

public String getBaseSelectClause(String rowNamePrefix)
Description copied from interface: CRUDQuery
It works 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 CRUDQuery
Returns:

getBeanVersionQuery

public String getBeanVersionQuery()
Description copied from interface: CRUDQuery
If the bean has a version field, it will return the query to retrieve the updated version of the record

Specified by:
getBeanVersionQuery in interface CRUDQuery
Returns:

getSaveQueryWithoutGenerators

public String getSaveQueryWithoutGenerators()
Description copied from interface: CRUDQuery
The pregenerated query to save an entity ignoring the generators if needed

Specified by:
getSaveQueryWithoutGenerators in interface CRUDQuery
Returns:

setUpdateQuery

public void setUpdateQuery(String updateQuery)
Parameters:
updateQuery - the updateQuery to set

setDeleteQuery

public void setDeleteQuery(String deleteQuery)
Parameters:
deleteQuery - the deleteQuery to set

setLoadQuery

public void setLoadQuery(String loadQuery)
Parameters:
loadQuery - the loadQuery to set

setSaveQuery

public void setSaveQuery(String saveQuery)
Parameters:
saveQuery - the saveQuery to set

setBaseSelectClause

public void setBaseSelectClause(String baseSelectClause)
Parameters:
baseSelectClause - the baseSelectClause to set

setBaseFromClause

public void setBaseFromClause(String baseFromClause)
Parameters:
baseFromClause - the baseFromClause to set

setBeanVersionQuery

public void setBeanVersionQuery(String beanVersionQuery)
Parameters:
beanVersionQuery - the beanVersionQuery to set

setSaveQueryWithoutGenerators

public void setSaveQueryWithoutGenerators(String saveQueryWithoutGenerators)
Parameters:
saveQueryWithoutGenerators - the saveQueryWithoutGenerators to set

getExistQuery

public String getExistQuery()
Description copied from interface: CRUDQuery
The pregenerated count query to check if an entity exists

Specified by:
getExistQuery in interface CRUDQuery
Returns:

setExistQuery

public void setExistQuery(String existQuery)


Copyright © 2013. All Rights Reserved.