T
- Type of the entity this dao is for.@Transactional public abstract class HibernateDaoImpl<T extends Serializable> extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements HibernateDao<T>
Constructor and Description |
---|
HibernateDaoImpl(Class<? extends T> type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Collection<T> |
create(Collection<T> entities)
Creates all given entities within the database.
|
T |
create(T entity)
Creates a new entity within the database.
|
void |
evict(T entity)
See HibernateTemplate#evit
|
T |
load(Long id)
Loads the requested entity.
|
Collection<T> |
loadAll()
Loads all entities.
|
void |
postConstruct()
Method to finally initialize this class.
|
void |
remove(Collection<T> entities)
Removes all given entities.
|
void |
remove(Long id)
Removes the given entity.
|
void |
remove(T entity)
Removes the given entity.
|
void |
update(Collection<T> entities)
Updates all given entities.
|
void |
update(T entity)
Updates the given entity.
|
@PostConstruct public void postConstruct()
@Transactional(readOnly=true) public Collection<T> loadAll()
loadAll
in interface HibernateDao<T extends Serializable>
@Transactional(readOnly=true) public T load(Long id)
load
in interface HibernateDao<T extends Serializable>
id
- Id of the entity to load.public T create(T entity)
create
in interface HibernateDao<T extends Serializable>
entity
- The entity to create.public Collection<T> create(Collection<T> entities)
create
in interface HibernateDao<T extends Serializable>
entities
- The entities to create.public void update(T entity)
update
in interface HibernateDao<T extends Serializable>
entity
- The entity to update.public void update(Collection<T> entities)
update
in interface HibernateDao<T extends Serializable>
entities
- The entities to update.public void remove(T entity)
remove
in interface HibernateDao<T extends Serializable>
entity
- The entity to remove.public void remove(Long id)
remove
in interface HibernateDao<T extends Serializable>
id
- Id of the entity to remove.public void remove(Collection<T> entities)
remove
in interface HibernateDao<T extends Serializable>
entities
- Collection of entities to remove.public void evict(T entity)
evict
in interface HibernateDao<T extends Serializable>
entity
- The entity to evict.Copyright © 2019 Communote team. All rights reserved.