|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openwms.core.integration.jpa.PreferencesDaoImpl
@Transactional(propagation=MANDATORY) @Repository(value="preferencesJpaDao") public class PreferencesDaoImpl
A PreferencesDaoImpl is a JPA implementation of PreferenceWriter
and
implicitly of PreferenceDao
to find, remove and save preference
objects to the persistent storage. It can be injected by name
"preferencesJpaDao".
All methods have to be invoked within an active transaction context.
Field Summary | |
---|---|
static String |
COMPONENT_NAME
Springs component name. |
Constructor Summary | |
---|---|
PreferencesDaoImpl()
|
Method Summary | ||
---|---|---|
List<AbstractPreference> |
findAll()
Find all entities and return them as a List . |
|
AbstractPreference |
findByKey(Long id)
Find and return the entity identified by the natural unique key. |
|
|
findByType(Class<T> clazz)
Find all preferences of a particular type. |
|
|
persist(T entity)
Force a persist of a new entity. |
|
void |
remove(AbstractPreference entity)
Removes an already persistent entity. |
|
|
save(T entity)
Save an entity with the persistence layer and return it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMPONENT_NAME
Constructor Detail |
---|
public PreferencesDaoImpl()
Method Detail |
---|
public AbstractPreference findByKey(Long id)
findByKey
in interface PreferenceDao<Long>
id
- Natural key to find the entity (also known as business key)
PreferenceDao.findByKey(java.io.Serializable)
public <T extends AbstractPreference> List<T> findByType(Class<T> clazz)
findByType
in interface PreferenceDao<Long>
T
- Any subtype of AbstractPreference
clazz
- The type to search for
PreferenceDao.findByType(java.lang.Class)
public List<AbstractPreference> findAll()
List
.
findAll
in interface PreferenceDao<Long>
PreferenceDao.findAll()
public <T extends AbstractPreference> T save(T entity)
EntityManager.persist(Object)
for transient instances and
EntityManager.merge(Object)
for detached and managed ones.
save
in interface PreferenceWriter<Long>
T
- Any subtype of AbstractPreference
entity
- Entity instance to be synchronized with the persistence layer
PreferenceWriter.save(org.openwms.core.domain.system.AbstractPreference)
public <T extends AbstractPreference> void persist(T entity)
persist
in interface PreferenceWriter<Long>
T
- Some kind ofAbstractPreferenceentity
- The entity to persistPreferenceWriter.persist(org.openwms.core.domain.system.AbstractPreference)
public void remove(AbstractPreference entity)
entity
is not already managed, call
EntityManager.merge(Object)
before to attach it to the
persistence context.
remove
in interface PreferenceWriter<Long>
entity
- Entity instance to be removedPreferenceWriter.remove(org.openwms.core.domain.system.AbstractPreference)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |