Package com.jk.data.dataaccess.orm
Class JKObjectDataAccessInMemory
java.lang.Object
com.jk.data.dataaccess.orm.JKObjectDataAccessInMemory
- All Implemented Interfaces:
JKObjectDataAccess
This class is used to manage objects of various classes within the memory.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tclone(T model) This method is yet to be implemented (TBI).voidcloseTransaction(boolean commit) This method is yet to be implemented (TBI).<T> TThis method deletes an object from the data storage using its identifier (ID).<T> Tdelete(T model) This method deletes an object from the data storage.<T> voiddetach(T model) This method is yet to be implemented (TBI).<T> List<T>executeQuery(Class<T> clas, String queryString, Object... paramters) This method is yet to be implemented (TBI).<T> TThis method finds an object from the data storage using its identifier (ID).<T> List<T>findByFieldName(Class<T> clas, String fieldName, Object value) This method is yet to be implemented (TBI).<T> TfindOneByFieldName(Class<T> clas, String fieldName, Object fieldValue) This method is yet to be implemented (TBI).<T> List<T>This method retrieves a list of objects of the provided class type from the data storage.<T> List<T>This method is yet to be implemented (TBI).<T> List<T>getListAndCache(Class<T> clas) This method retrieves a list of objects of a specified class type and caches the result.<T> Tinsert(T object) This method inserts the provided object into the data storage.insertOrUpdate(Object object) This method inserts a new object into the data storage if it doesn't exist, or updates an existing object.voidsetMaxResults(int maxResults) This method is yet to be implemented (TBI).voidThis method is yet to be implemented (TBI).This method is yet to be implemented (TBI).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jk.data.dataaccess.orm.JKObjectDataAccess
executeSingleOutputQuery, getTenantId
-
Constructor Details
-
JKObjectDataAccessInMemory
public JKObjectDataAccessInMemory()
-
-
Method Details
-
insert
public <T> T insert(T object) This method inserts the provided object into the data storage.- Specified by:
insertin interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object.- Parameters:
object- Specifies the object to be inserted- Returns:
- the inserted object.
-
find
This method finds an object from the data storage using its identifier (ID).- Specified by:
findin interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object.- Parameters:
clas- Specifies the class type of the object.id- Specifies the identifier (ID) of the object to find.- Returns:
- the found object, or null if not found.
-
delete
This method deletes an object from the data storage using its identifier (ID).- Specified by:
deletein interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object.- Parameters:
clas- Specifies the class type of the object.id- Specifies the object identifier (ID)- Returns:
- the deleted object.
-
update
This method is yet to be implemented (TBI).- Specified by:
updatein interfaceJKObjectDataAccess- Parameters:
object- Specifies the object to update.- Returns:
- the updated object.
-
insertOrUpdate
This method inserts a new object into the data storage if it doesn't exist, or updates an existing object.- Specified by:
insertOrUpdatein interfaceJKObjectDataAccess- Parameters:
object- Specifies the object to insert or update in the data storage.- Returns:
- the inserted or updated object.
-
getList
This method retrieves a list of objects of the provided class type from the data storage.- Specified by:
getListin interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object.- Parameters:
clas- Specifies the class type of the objects.- Returns:
- a list of objects from data storage that are of the provided class type.
-
delete
public <T> T delete(T model) This method deletes an object from the data storage.- Specified by:
deletein interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object.- Parameters:
model- Specifies the object to delete.- Returns:
- the deleted object.
-
getList
This method is yet to be implemented (TBI).- Specified by:
getListin interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of objects to retrieve.- Parameters:
clas- Specifies the class of objects to retrieve.paramters- Specifies a map of parameters or criteria for filtering the objects.- Returns:
- a list of objects matching the specified class and criteria.
-
executeQuery
This method is yet to be implemented (TBI).- Specified by:
executeQueryin interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of objects to retrieve.- Parameters:
clas- Specifies the class of objects to retrieve.queryString- Specifies the query string to execute.paramters- Specifies the optional parameters to bind to the query.- Returns:
- a list of objects matching the specified class and query criteria.
-
findByFieldName
This method is yet to be implemented (TBI).- Specified by:
findByFieldNamein interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of objects to retrieve.- Parameters:
clas- Specifies the class of objects to retrieve.fieldName- Specifies the name of the field to search by.value- Specifies the value to search for within the specified field.- Returns:
- a list of objects matching the specified class and field value criteria.
-
findOneByFieldName
This method is yet to be implemented (TBI).- Specified by:
findOneByFieldNamein interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of object to retrieve.- Parameters:
clas- Specifies the class of the object to retrieve.fieldName- Specifies the name of the field to use as a filter.fieldValue- Specifies the value to match in the specified field.- Returns:
- the retrieved object, or null if no matching object is found.
-
setMaxResults
public void setMaxResults(int maxResults) This method is yet to be implemented (TBI).- Specified by:
setMaxResultsin interfaceJKObjectDataAccess- Parameters:
maxResults- Specifies the new max results shown from any executed query.
-
detach
public <T> void detach(T model) This method is yet to be implemented (TBI).- Specified by:
detachin interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object to detach.- Parameters:
model- Specifies the object to detach from the persistence context.
-
clone
public <T> T clone(T model) This method is yet to be implemented (TBI).- Specified by:
clonein interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object to clone.- Parameters:
model- Specifies the object to create a detached copy of.- Returns:
- a detached copy of the input object.
-
startTransaction
public void startTransaction()This method is yet to be implemented (TBI).- Specified by:
startTransactionin interfaceJKObjectDataAccess
-
closeTransaction
public void closeTransaction(boolean commit) This method is yet to be implemented (TBI).- Specified by:
closeTransactionin interfaceJKObjectDataAccess- Parameters:
commit- Indicates whether to commit (true) the transaction or to roll it back (false).
-
getListAndCache
This method retrieves a list of objects of a specified class type and caches the result.- Specified by:
getListAndCachein interfaceJKObjectDataAccess- Type Parameters:
T- Specifies the type of the object.- Parameters:
clas- Specifies the class type of the objects to retrieve.- Returns:
- a list of objects of the specified class type.
-