com.knots.kcl.orm
Class OrmPersistence
java.lang.Object com.knots.kcl.orm.OrmPersistence
- All Implemented Interfaces:
- IOrmPersistence, IOrmTransaction
- Direct Known Subclasses:
- OrmPersistenceCollection
public class OrmPersistence
- extends java.lang.Object
- implements IOrmPersistence
Persistence Class
Method Summary |
void | abortTransaction() |
void | beginTransaction() |
int | countEntity(java.lang.String entityName) |
int | countEntity(java.lang.String entityName, Condition condition) |
void | endTransaction() |
boolean | findEntity(java.lang.String entityName, Condition condition) |
boolean | findEntity(java.lang.String entityName, int entityId) |
boolean | getAutoCreation() |
boolean | getAutoQueryForLastId() |
DatabaseHelper | getDatabaseHelper() |
OrmDefinitionContext | getDefinitionContext() |
OrmManipulationQueryContext | getManipulationQueryContext() |
OrmTransactionContext | getTransactionContext() |
Entity[] | loadEntity(java.lang.String entityName, Condition condition, java.lang.String fields, Order[] orders, java.lang.Integer start, java.lang.Integer length) |
Entity | loadEntity(java.lang.String entityName, int entityId, java.lang.String fields) |
void | removeEntity(java.lang.String entityName, Condition condition) |
void | removeEntity(java.lang.String entityName, int id) |
int | saveEntity(Entity... entities) |
void | setAutoCreation(boolean auto) |
void | setAutoQueryForLastId(boolean auto) |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OrmPersistence
public OrmPersistence(OrmContexts contexts)
getDatabaseHelper
public DatabaseHelper getDatabaseHelper()
getDefinitionContext
public OrmDefinitionContext getDefinitionContext()
getManipulationQueryContext
public OrmManipulationQueryContext getManipulationQueryContext()
getTransactionContext
public OrmTransactionContext getTransactionContext()
beginTransaction
public void beginTransaction() throws java.lang.Exception
- Specified by:
beginTransaction
in interface IOrmTransaction
- Throws:
java.lang.Exception
abortTransaction
public void abortTransaction() throws java.lang.Exception
- Specified by:
abortTransaction
in interface IOrmTransaction
- Throws:
java.lang.Exception
endTransaction
public void endTransaction() throws java.lang.Exception
- Specified by:
endTransaction
in interface IOrmTransaction
- Throws:
java.lang.Exception
getAutoCreation
public boolean getAutoCreation()
- Specified by:
getAutoCreation
in interface IOrmPersistence
setAutoCreation
public void setAutoCreation(boolean auto)
- Specified by:
setAutoCreation
in interface IOrmPersistence
getAutoQueryForLastId
public boolean getAutoQueryForLastId()
- Specified by:
getAutoQueryForLastId
in interface IOrmPersistence
setAutoQueryForLastId
public void setAutoQueryForLastId(boolean auto)
- Specified by:
setAutoQueryForLastId
in interface IOrmPersistence
countEntity
public int countEntity(java.lang.String entityName) throws java.lang.Exception
- Specified by:
countEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
countEntity
public int countEntity(java.lang.String entityName, Condition condition) throws java.lang.Exception
- Specified by:
countEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
findEntity
public boolean findEntity(java.lang.String entityName, int entityId) throws java.lang.Exception
- Specified by:
findEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
findEntity
public boolean findEntity(java.lang.String entityName, Condition condition) throws java.lang.Exception
- Specified by:
findEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
saveEntity
public int saveEntity(Entity... entities) throws java.lang.Exception
- Specified by:
saveEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
removeEntity
public void removeEntity(java.lang.String entityName, int id) throws java.lang.Exception
- Specified by:
removeEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
removeEntity
public void removeEntity(java.lang.String entityName, Condition condition) throws java.lang.Exception
- Specified by:
removeEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
loadEntity
public Entity loadEntity(java.lang.String entityName, int entityId, java.lang.String fields) throws java.lang.Exception
- Specified by:
loadEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception
loadEntity
public Entity[] loadEntity(java.lang.String entityName, Condition condition, java.lang.String fields, Order[] orders, java.lang.Integer start, java.lang.Integer length) throws java.lang.Exception
- Specified by:
loadEntity
in interface IOrmPersistence
- Throws:
java.lang.Exception