E
- The entity class.Id
- The entity ID class.public interface EntityDao<E,Id>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
count(java.lang.String queryAlias,
java.lang.Object... queryArguments)
Returns the result count.
|
E |
find(Id entityId)
Finds an entity by its ID.
|
java.lang.Long |
generatePrimaryKey(java.lang.String table)
Returns the generated primary key for a table.
|
E |
merge(E entityUpdate)
Merges (creates or updates) an entity.
|
void |
persist(E entity)
Persists (creates) an entity.
|
java.util.List<E> |
query(java.lang.String queryAlias,
java.lang.Object... queryArguments)
Returns the results of a query with page start and size.
|
org.apache.commons.lang3.tuple.Pair<java.util.List<E>,java.lang.Long> |
queryAndCount(java.lang.String queryAlias,
java.lang.Object... queryArguments)
Returns the results of a query and the result count.
|
java.util.List<E> |
queryWithOffSet(java.lang.String queryAlias,
java.lang.Object... queryArguments)
Returns the results of a query.
|
void |
remove(E entity)
Removes (deletes) an entity.
|
void |
setFields(java.lang.String fields)
Sets the fields to return.
|
void |
setLimit(java.lang.Integer limit)
Sets the maximum number of items to return.
|
void |
setMeta(java.lang.Boolean meta)
Sets whether to return meta data.
|
void |
setOffset(java.lang.Integer offset)
Sets the offset of the first entity to return.
|
void |
setPageSize(java.lang.Integer pageSize)
Sets the page size to return.
|
void |
setPageStart(java.lang.Integer pageStart)
Sets the page start to return.
|
void |
setParameterMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameterMap)
Sets the parameters.
|
void |
setSort(java.lang.String sort)
Sets the sorting rule.
|
static final java.lang.String COPYRIGHT
void setSort(java.lang.String sort)
sort
- The sorting rule.void setOffset(java.lang.Integer offset)
offset
- The offset of the first entity to return.void setLimit(java.lang.Integer limit)
limit
- The maximum number of items to return.void setPageStart(java.lang.Integer pageStart)
page
- start The page start to return.void setPageSize(java.lang.Integer pageSize)
page
- size The page size to return.void setFields(java.lang.String fields)
fields
- The fields to return.void setMeta(java.lang.Boolean meta)
meta
- Whether to return meta data.void setParameterMap(java.util.Map<java.lang.String,java.util.List<java.lang.String>> parameterMap)
parameterMap
- The parameters.E find(Id entityId)
entityId
- The entity ID.java.util.List<E> queryWithOffSet(java.lang.String queryAlias, java.lang.Object... queryArguments)
queryAlias
- The query alias. Can be null.queryArguments
- The query arguments.java.util.List<E> query(java.lang.String queryAlias, java.lang.Object... queryArguments)
queryAlias
- The query alias. Can be null.queryArguments
- The query arguments.java.lang.Long count(java.lang.String queryAlias, java.lang.Object... queryArguments)
queryAlias
- The query alias. Can be null.queryArguments
- The query arguments.org.apache.commons.lang3.tuple.Pair<java.util.List<E>,java.lang.Long> queryAndCount(java.lang.String queryAlias, java.lang.Object... queryArguments)
queryAlias
- The query alias. Can be null.queryArguments
- The query arguments.void persist(E entity)
entity
- The entity.E merge(E entityUpdate)
entityUpdate
- Update to the entity.void remove(E entity)
entity
- The entity.java.lang.Long generatePrimaryKey(java.lang.String table)
table
- The table name.