Package com.im.df.api.support
Interface DFDao
-
public interface DFDaoPerforms the database operations for a single entity. This includes the classic CRUD operations of a DAO, but also includes DDL operations. Each entity type will have a correspondingDFDaoimplementation to perform its database operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<? extends java.lang.Comparable<?>>deleteIds(java.util.List<? extends java.lang.Comparable<?>> ids, com.im.commons.progress.DFEnvironmentRW env)Delete the specified rows.java.util.Map<java.lang.Comparable<?>,java.util.Map<java.lang.String,java.lang.Object>>getData(java.util.Collection<? extends java.lang.Comparable<?>> ids)Fetches data for all fields and the specified row IDs.java.util.Map<java.lang.Comparable<?>,java.util.Map<java.lang.String,java.lang.Object>>getData(java.util.Collection<? extends java.lang.Comparable<?>> ids, java.util.List<DFField> fields)Fetches data for given fields and the specified row IDs.intgetRowCount(com.im.commons.progress.DFEnvironmentRO env)Returns the number of rows in the entity.DFUpdateInfoinsert(java.util.Map<java.lang.String,java.lang.Object> values, java.util.Map<java.lang.String,java.lang.Object> insertOptions, com.im.commons.progress.DFEnvironmentRW env)Inserts new row into the entity.java.util.ListretrieveDistinctValues(java.lang.String fieldId)Retrieves all distinct values from thefield.java.util.Map<DFUpdateDescription,DFUpdateResult>update(java.util.List<DFUpdateDescription> updateDescriptors, boolean readOriginalData, com.im.commons.progress.DFEnvironmentRW env)Updates rows in entity based onDFUpdateDescription.
-
-
-
Method Detail
-
getRowCount
int getRowCount(com.im.commons.progress.DFEnvironmentRO env)
Returns the number of rows in the entity.- Parameters:
env- Environment to use for retrieving the number of rows.- Returns:
- The number of rows.
-
retrieveDistinctValues
java.util.List retrieveDistinctValues(java.lang.String fieldId)
Retrieves all distinct values from thefield.- Parameters:
fieldId- The ID of the field.- Returns:
- List of distinct values in the entity.
-
getData
java.util.Map<java.lang.Comparable<?>,java.util.Map<java.lang.String,java.lang.Object>> getData(java.util.Collection<? extends java.lang.Comparable<?>> ids)
Fetches data for all fields and the specified row IDs.- Parameters:
ids- the row IDs- Returns:
- A map of the data, keyed by the row ID. The values of the first level of
Mapare instances ofMapagain. In these nestedMaps key is id ofDFFieldand value is the read data value.
-
getData
java.util.Map<java.lang.Comparable<?>,java.util.Map<java.lang.String,java.lang.Object>> getData(java.util.Collection<? extends java.lang.Comparable<?>> ids, java.util.List<DFField> fields)Fetches data for given fields and the specified row IDs.- Parameters:
ids- the row IDsfields- Set of fields to retrieve the values from. Ifnullor empty, then all fields of the entity are retrieved.- Returns:
- A map of the data, keyed by the row ID. The values of the first level of
Mapare instances ofMapagain. In these nestedMaps key is id ofDFFieldand value is the read data value. NestedMaps contain only data for eachDFFieldspecified infieldsparameter.
-
deleteIds
java.util.List<? extends java.lang.Comparable<?>> deleteIds(java.util.List<? extends java.lang.Comparable<?>> ids, com.im.commons.progress.DFEnvironmentRW env)Delete the specified rows. NOTE: this method may return null, as JChem's UpdateHandler does not provide a way of determining whether the deletion was successful.- Parameters:
ids- The row IDs to remove.env- The environment to use for removing rows.- Returns:
- The removed row IDs.
-
insert
DFUpdateInfo insert(java.util.Map<java.lang.String,java.lang.Object> values, java.util.Map<java.lang.String,java.lang.Object> insertOptions, com.im.commons.progress.DFEnvironmentRW env)
Inserts new row into the entity.- Parameters:
values- The mapping of field IDs to values in the new row.insertOptions- Options specific to this type of entity. Can be null.env- Environment for writing data.- Returns:
- Update info - id of inserted row and if it's duplicate.
-
update
java.util.Map<DFUpdateDescription,DFUpdateResult> update(java.util.List<DFUpdateDescription> updateDescriptors, boolean readOriginalData, com.im.commons.progress.DFEnvironmentRW env)
Updates rows in entity based onDFUpdateDescription.- Parameters:
updateDescriptors- The update description.readOriginalData- If the resultDFUpdateResulthas to contain the data before the update.env- The environment used for update.- Returns:
- The result of the update is a Map where the keys are the
DFUpdateDescriptions from the parameters and the values are the results of particular updates.
-
-