Entity
- Any entity.Key
- Key of the entity.public abstract class AbstractGenericComponent<Entity,Key> extends Object implements GenericComponent<Entity,Key>
Constructor and Description |
---|
AbstractGenericComponent() |
Modifier and Type | Method and Description |
---|---|
Collection<Entity> |
addOrUpdate(Collection<Entity> entities)
Adds or update all the persistent entities.
|
Entity |
addOrUpdate(Entity entity)
Adds or update the persistent entity.
|
Collection<Entity> |
getAll(Integer firstResult,
Integer maxResults)
Gets all entities of the kind.
|
Entity |
getByAttribute(String attributeName,
Object attributeValue)
Gets an entity by its attribute.
|
Collection<Entity> |
getByAttribute(String attributeName,
Object attributeValue,
Integer firstResult,
Integer maxResults)
Gets all entities with the given attribute value.
|
Entity |
getById(Key identifier)
Gets an entity by its identifier.
|
abstract AbstractGenericDAO<Entity,Key> |
getEntityDAO()
Gets the entityDAO.
|
void |
remove(Collection<Entity> entities)
Removes persistent entities.
|
void |
remove(Entity entity)
Removes a persistent entity.
|
public abstract AbstractGenericDAO<Entity,Key> getEntityDAO()
public Entity addOrUpdate(Entity entity)
GenericComponent
addOrUpdate
in interface GenericComponent<Entity,Key>
entity
- The entity to be persisted.GenericComponent.addOrUpdate(java.lang.Object)
public Collection<Entity> addOrUpdate(Collection<Entity> entities)
GenericComponent
addOrUpdate
in interface GenericComponent<Entity,Key>
entities
- The entities to be persisted.GenericComponent.addOrUpdate(java.util.Collection)
public void remove(Entity entity)
GenericComponent
remove
in interface GenericComponent<Entity,Key>
entity
- The entity to be removed.GenericComponent.remove(java.lang.Object)
public void remove(Collection<Entity> entities)
GenericComponent
remove
in interface GenericComponent<Entity,Key>
entities
- The entities to be removed.GenericComponent.remove(java.util.Collection)
public Entity getById(Key identifier)
GenericComponent
getById
in interface GenericComponent<Entity,Key>
identifier
- The identifier of the entity.GenericComponent.getById(java.lang.Object)
public Collection<Entity> getByAttribute(String attributeName, Object attributeValue, Integer firstResult, Integer maxResults)
GenericComponent
getByAttribute
in interface GenericComponent<Entity,Key>
attributeName
- The attribute name.attributeValue
- The attribute value.firstResult
- The first result that should be considered by the query.maxResults
- The maximum numbers of results to be considered by the query.GenericComponent.getByAttribute(java.lang.String,
java.lang.Object, java.lang.Integer, java.lang.Integer)
public Entity getByAttribute(String attributeName, Object attributeValue)
GenericComponent
getByAttribute
in interface GenericComponent<Entity,Key>
attributeName
- The attribute name.attributeValue
- The attribute value.GenericComponent.getByAttribute(java.lang.String,
java.lang.Object)
public Collection<Entity> getAll(Integer firstResult, Integer maxResults)
GenericComponent
getAll
in interface GenericComponent<Entity,Key>
firstResult
- The first result that should be considered by the query.maxResults
- The maximum numbers of results to be considered by the query.GenericComponent.getAll(java.lang.Integer, java.lang.Integer)
Copyright © 2013. All Rights Reserved.