|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
org.domdrides.hibernate.repository.HibernateRepository<EntityType,IdType>
@Repository public abstract class HibernateRepository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>
A Hibernate-based repository implementation.
| Field Summary | |
|---|---|
static String |
UNCHECKED
|
| Fields inherited from class org.springframework.dao.support.DaoSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
protected |
HibernateRepository(Class<EntityType> entityClass)
Constructs a repository which supports entityClass. |
| Method Summary | |
|---|---|
EntityType |
add(EntityType entity)
|
boolean |
contains(EntityType entity)
|
protected org.hibernate.Criteria |
createCriteria()
Creates a Criteria object which returns the entity type. |
Set<EntityType> |
getAll()
|
EntityType |
getById(IdType id)
|
protected List<EntityType> |
list(org.hibernate.Criteria criteria)
Returns a list of entities based on the provided criteria. |
List<EntityType> |
list(int first,
int max,
String sortProperty,
boolean ascending)
Returns one page of data from this repository. |
protected List<EntityType> |
list(org.hibernate.Query query)
Returns a list of entities based on the provided query. |
void |
remove(EntityType entity)
|
protected Set<EntityType> |
set(org.hibernate.Criteria criteria)
Returns a set of entities based on the provided criteria. |
protected Set<EntityType> |
set(org.hibernate.Query query)
Returns a set of entities based on the provided query. |
int |
size()
|
protected EntityType |
uniqueResult(org.hibernate.Criteria criteria)
Returns a unique result based on the provided criteria. |
protected EntityType |
uniqueResult(org.hibernate.Query query)
Returns a unique result based on the provided query. |
EntityType |
update(EntityType entity)
|
| Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
|---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
| Methods inherited from class org.springframework.dao.support.DaoSupport |
|---|
afterPropertiesSet, initDao |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String UNCHECKED
| Constructor Detail |
|---|
protected HibernateRepository(Class<EntityType> entityClass)
entityClass.
entityClass - the entity class| Method Detail |
|---|
@Transactional(readOnly=true)
public List<EntityType> list(int first,
int max,
String sortProperty,
boolean ascending)
list in interface org.domdrides.repository.PageableRepository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>first - the first entity to returnmax - the maximum number of entities to returnsortProperty - the property to sort byascending - whether or not the sorting is asceding
@Transactional public EntityType add(EntityType entity)
add in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>@Transactional(readOnly=true) public boolean contains(EntityType entity)
contains in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>@Transactional(readOnly=true) public Set<EntityType> getAll()
getAll in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>@Transactional(readOnly=true) public EntityType getById(IdType id)
getById in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>@Transactional public void remove(EntityType entity)
remove in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>@Transactional(readOnly=true) public int size()
size in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>@Transactional public EntityType update(EntityType entity)
update in interface org.domdrides.repository.Repository<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>protected org.hibernate.Criteria createCriteria()
Criteria object which returns the entity type.
Criteria object which returns the entity type@Transactional(readOnly=true) protected List<EntityType> list(org.hibernate.Criteria criteria)
criteria - the criteria
@Transactional(readOnly=true) protected List<EntityType> list(org.hibernate.Query query)
query - the query
@Transactional(readOnly=true) protected Set<EntityType> set(org.hibernate.Criteria criteria)
criteria - the criteria
@Transactional(readOnly=true) protected Set<EntityType> set(org.hibernate.Query query)
query - the query
@Transactional(readOnly=true) protected EntityType uniqueResult(org.hibernate.Criteria criteria)
criteria - the criteria
@Transactional(readOnly=true) protected EntityType uniqueResult(org.hibernate.Query query)
query - the query
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||