Class DataEntityDAO
java.lang.Object
fr.paris.lutece.portal.business.datastore.DataEntityDAO
- All Implemented Interfaces:
IDataEntityDAO
This class provides Data Access methods for Entity objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete a record from the tablevoidinsert(DataEntity entity) Insert a new record in the table.booleaninsertIfAbsent(DataEntity entity) Atomically inserts a new record only if no record with the same primary key already exists.Load the data of the entity from the tableselectEntitiesByPrefix(String strPrefix) Load the data of all the entity objects whose key share a prefixLoad the data of all the entitys and returns them as a Listvoidstore(DataEntity entity) Update the record in the table
-
Constructor Details
-
DataEntityDAO
public DataEntityDAO()
-
-
Method Details
-
insert
Insert a new record in the table.- Specified by:
insertin interfaceIDataEntityDAO- Parameters:
entity- instance of the Entity object to insert
-
insertIfAbsent
Atomically inserts a new record only if no record with the same primary key already exists. Relies on the database-level primary key uniqueness constraint, which makes the operation safe under concurrent calls from multiple application instances (multi-instance deployment).Portable across SQL databases (MariaDB, PostgreSQL, Oracle, H2...) — does not use vendor-specific syntax like
ON CONFLICTorINSERT IGNORE.- Specified by:
insertIfAbsentin interfaceIDataEntityDAO- Parameters:
entity- instance of the Entity object to insert- Returns:
trueif the row was inserted,falseif a row with the same key already existed
-
load
Load the data of the entity from the table- Specified by:
loadin interfaceIDataEntityDAO- Parameters:
strKey- The identifier of the entity- Returns:
- the instance of the Entity
-
delete
Delete a record from the table- Specified by:
deletein interfaceIDataEntityDAO- Parameters:
strKey- The identifier of the entity
-
store
Update the record in the table- Specified by:
storein interfaceIDataEntityDAO- Parameters:
entity- The reference of the entity
-
selectEntitiesList
Load the data of all the entitys and returns them as a List- Specified by:
selectEntitiesListin interfaceIDataEntityDAO- Returns:
- The List which contains the data of all the entitys
-
selectEntitiesByPrefix
Description copied from interface:IDataEntityDAOLoad the data of all the entity objects whose key share a prefix- Specified by:
selectEntitiesByPrefixin interfaceIDataEntityDAO- Parameters:
strPrefix- the prefix- Returns:
- the list which contains the data of all the entity objects whose key share a prefix
-