|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ebasetech.ufs.utility.PersistenceHelper
Singleton Helper class to handle much of the persistence processing for classes in the process package. This class requires that objects that are to be persisted implement Persistent.
Field Summary | |
private static java.lang.String |
_dbType
|
private static PersistenceHelper |
_Instance
|
Fields inherited from interface com.ebasetech.ufs.utility.PersistenceConstants |
AND, COLON, COMMA, CONNECTION_ERROR, DELETE_ERROR, DELETE_FROM, DESC, ENACTMENT, EQ_QUERY, EQUALS, ERROR_ID, FAILED_CLOSING_CONNECTION, FAILED_CLOSING_RESULTSET, FAILED_CLOSING_STATEMENT, FATAL_JDBC_ERROR, FOR_UPDATE, FROM, GREATER_THAN_QUERY, IN, INSERT_ERROR, INSERT_INTO, ISNULL, JDBC_SQL_ERROR, LE_QUERY, LEFT_OUTER_JOIN, LESS_THAN_QUERY, LIKE_QUERY, LOAD_ERROR, LOCK_ERROR, LPAREN, NO, NOT_EMPTY, OBJECT_ALREADY_MODIFIED, OBJECT_NOT_FOUND_ERROR, ON, OR, ORDER_BY, PERIOD, PLUS_ONE, PRODUCT_NAME_MYSQL, PRODUCT_NAME_ORACLE, PRODUCT_NAME_SQLSERVER, QUERY, QUERY_ERROR, QUOTE, RPAREN, SCRIPT_READ_ERROR, SELECT, SELECT_FROM, SET, SPACE, SQL_ERROR, UPDATE, UPDATE_ERROR, VALUES, WHERE, WILDCARD, WITH_ERROR |
Constructor Summary | |
PersistenceHelper()
|
Method Summary | |
java.lang.String |
chooseDbSpecificString(com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy,
java.lang.String mysqlString,
java.lang.String oracleString,
java.lang.String sqlserverString)
Works out from the supplied proxy and table name what sort of database is being accessed and uses that information to choose which of the type-specific strings are required, and returns that string. |
void |
delete(PersistentDeleteable object,
java.sql.Connection con)
Delete the supplied Persistent object from the repository entirely |
void |
delete(PersistentDeleteable object,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Delete the supplied Persistent object |
java.sql.Connection |
getConnection(com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Given a ServletContextProxy, answer the database connection that is available inside it |
java.lang.String |
getDbType(com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
|
static PersistenceHelper |
Instance()
Answer the single instance of PersistenceHelper |
void |
load(PersistentLoadable object,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Load persistent object using the connection provided |
void |
lock(PersistentOptimistic object,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
As part of the checks to see if an object is allowed to be updated, lock (using Select for update) the record for the supplied object |
void |
query(PersistentQueryable queryObject,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Perform the supplied query on the connection provided |
void |
save(PersistentSaveable object,
java.sql.Connection connection)
|
void |
save(PersistentSaveable object,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Save an implementation of Persistent to the database |
void |
update(PersistentUpdateable object,
java.sql.Connection con,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Updates the single record for the supplied persistent object |
void |
update(PersistentUpdateable object,
com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
Update an implementation of Persistent to the database |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static PersistenceHelper _Instance
private static java.lang.String _dbType
Constructor Detail |
public PersistenceHelper()
Method Detail |
public static PersistenceHelper Instance()
public void save(PersistentSaveable object, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws PersistenceException
PersistenceException
public void save(PersistentSaveable object, java.sql.Connection connection) throws PersistenceException
PersistenceException
public void load(PersistentLoadable object, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws PersistenceException
PersistenceException
public void update(PersistentUpdateable object, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws PersistenceException
PersistenceException
public void update(PersistentUpdateable object, java.sql.Connection con, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws PersistenceException
PersistenceException
public void delete(PersistentDeleteable object, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws PersistenceException, java.sql.SQLException
PersistenceException
java.sql.SQLException
public void delete(PersistentDeleteable object, java.sql.Connection con) throws PersistenceException
PersistenceException
public java.sql.Connection getConnection(com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy)
public void lock(PersistentOptimistic object, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws ConcurrentUpdateException, PersistenceException
ConcurrentUpdateException
PersistenceException
public void query(PersistentQueryable queryObject, com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws PersistenceException
PersistenceException
public java.lang.String chooseDbSpecificString(com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy, java.lang.String mysqlString, java.lang.String oracleString, java.lang.String sqlserverString) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getDbType(com.ebasetech.ufs.kernel.IUFSServletContextProxy proxy) throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |