E
- entity type.K
- primary key.public interface Dao<E extends PersistentEntity<K>,K extends Serializable>
In order to use AutoDAO CRUD operations just inherit your DAO interface from this one.
See CRUD operations for usage.
Modifier and Type | Method and Description |
---|---|
void |
create(E o)
Persist the new instance object into database.
|
void |
delete(E o)
Remove an object from persistent storage in the database.
|
E |
get(K id)
Retrieve an object that was previously persisted to the database using the indicated id as primary key.
|
E |
merge(E o)
Merge object with persistent object.
|
void |
refresh(E o)
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
|
void |
saveOrUpdate(E o)
Save or update object.
|
void |
update(E o)
Update the given object.
|
void create(@NotNull E o) throws org.springframework.dao.DataAccessException
o
- transient object.org.springframework.dao.DataAccessException
Session.persist(Object)
@Nullable E get(@NotNull K id) throws org.springframework.dao.DataAccessException
id
- primary keynull
if object is not found.org.springframework.dao.DataAccessException
Session.get(Class, java.io.Serializable)
void update(@NotNull E o) throws org.springframework.dao.DataAccessException
o
- instance of object to update.org.springframework.dao.DataAccessException
Session.update(Object)
void delete(@NotNull E o) throws org.springframework.dao.DataAccessException
o
- object.org.springframework.dao.DataAccessException
Session.delete(Object)
void saveOrUpdate(@NotNull E o) throws org.springframework.dao.DataAccessException
o
- object.org.springframework.dao.DataAccessException
Session.saveOrUpdate(Object)
@NotNull E merge(@NotNull E o) throws org.springframework.dao.DataAccessException
o
- object to merge.org.springframework.dao.DataAccessException
Session.merge(Object)
void refresh(@NotNull E o) throws org.springframework.dao.DataAccessException
o
- object.org.springframework.dao.DataAccessException
Session.refresh(Object)
Copyright © 2008–2017. All rights reserved.