001 | // 持久化一个实体。 |
002 | void create(E entity) throws DataAccessException; |
003 |
004 | // 持久化多个实体。 |
005 | void create(Collection<E> entities) throws DataAccessException; |
006 |
007 | // 持久化或者更新实体。 |
008 | void createOrUpdate(E entity) throws DataAccessException; |
009 |
010 | // 持久化或者更新多个实体。 |
011 | void createOrUpdate(Collection<E> entities) throws DataAccessException; |
012 |
013 | // 更新实体。 |
014 | void update(E entity) throws DataAccessException; |
015 |
016 | // 更新多个实体。 |
017 | void update(Collection<E> entities) throws DataAccessException; |
018 |
019 | // 更新处于游离状态的实体,更新后实体对象仍然处于游离状态。 |
020 | void merge(E entity) throws DataAccessException; |
021 |
022 | // 保存处于游离状态的多个实体,更新后实体对象仍然处于游离状态。 |
023 | void merge(Collection<E> entities) throws DataAccessException; |
024 |
025 | // 删除一个持久化的实体。 |
026 | void delete(E entity) throws DataAccessException; |
027 |
028 | // 删除多个持久化的实体。 |
029 | void delete(Collection<E> entities) throws DataAccessException; |
030 |
031 | // 删除实体主键id标识的实体。 |
032 | void delete( long id) throws DataAccessException; |
033 |
034 | // 通过复合主键类的实例来删除实体对象。 |
035 | void delete(Serializable key) throws DataAccessException; |
036 |
037 | // 通过给定复合主键的各个属性值来删除实体对象。 |
038 | void delete(String[] keyNames, Object[] keyValues) throws DataAccessException; |
039 |
040 | // 按照实体类型和实体唯一标识查询实体。 |
041 | E find( long id) throws DataAccessException; |
042 |
043 | // 按照实体类型和实体唯一标识查询实体。 |
044 | E find(Serializable id) throws DataAccessException; |
045 |
046 | // 通过给定复合主键的各个属性值来查找实体对象。 |
047 | E find(String[] keyNames, Object[] keyValues) throws DataAccessException; |
048 |
049 | // 按照实体类型和实体唯一标识查询实体,并锁定该实体对象,直到事务结束。 |
050 | E findAndLock( long id) throws DataAccessException; |
051 |
052 | // 按照实体类型和实体唯一标识查询实体,并锁定该实体对象,直到事务结束。 |
053 | E findAndLock(Serializable id) throws DataAccessException; |
054 |
055 | // 按照给定的实体类型和唯一标识查询实体。通用的查询方法,适用于所有的实现KeyedPersistable接口的实体类。 |
056 | KeyedPersistable find(Class clazz, long id) throws DataAccessException; |
057 |
058 | // 按照给定的实体类型和唯一标识查询实体。通用的查询方法,适用于所有的实现KeyedPersistable接口的实体类。 |
059 | KeyedPersistable find(Class clazz, Serializable id) throws DataAccessException; |
060 |
061 | // 按照唯一的(Unique)属性名和属性值,查询得到一个实体对象。 |
062 | E findByUniqueParam(String uniqueParamName, String value) throws DataAccessException; |
063 |
064 | // 按照指定的属性值查询多个实体对象。 |
065 | List<E> findByParam(String paramName, Object value) throws DataAccessException; |
066 |
067 | // 按照指定属性值查找多个实例,并按照分页条件分页,返回指定页的实体集合。 |
068 | List<E> findByParamPagination(String paramName, Object value, int pageSize, int pageNumber) throws DataAccessException; |
069 |
070 | // 按照指定属性值、排序条件和分页条件进行查找指定页的多个实例。 |
071 | List<E> findByParamPagination(String paramName, Object value, String orderParam, |
072 | boolean isDescending, int pageSize, int pageNumber) throws DataAccessException; |
073 |
074 | // 按照指定的属性值映射查找多个实体对象。 |
075 | List<E> findByParams(Map<String, Object> paramMap) throws DataAccessException; |
076 |
077 | // 按照指定的条件表达式查找多个实体对象。 |
078 | List<E> findByParams(String extraCondition, Map<String, Object> extraParams) throws DataAccessException; |
079 |
080 | // 按照指定的属性值映射查找多个实体对象。 |
081 | List<E> findByParams(Map<String, Object> paramMap, String extraCondition, Map<String, Object> extraParams) throws DataAccessException; |
082 |
083 | // 按照指定属性值映射、分页条件查找多个实例。 |
084 | List<E> findByParamsPagination(Map<String, Object> paramMap, int pageSize, int pageNumber) throws DataAccessException; |
085 |
086 | // 按照指定属性值映射查找多个实例,并按照分页条件分页,返回指定页的实体列表。 |
087 | List<E> findByParamsPagination(String condition, Map<String, Object> params, int pageSize, int pageNumber) throws DataAccessException; |
088 |
089 | // 按照指定属性值映射查找多个实例,并按照分页条件分页,返回指定页的实体列表。 |
090 | List<E> findByParamsPagination(Map<String, Object> paramMap, String extraCondition, |
091 | Map<String, Object> extraParams, int pageSize, int pageNumber) throws DataAccessException; |
092 |
093 | // 按照指定属性值映射、排序条件和分页条件进行查找指定页的多个实例。 |
094 | List<E> findByParamsPagination(Map<String, Object> paramMap, String orderParam, boolean isDescending, |
095 | int pageSize, int pageNumber) throws DataAccessException; |
096 |
097 | // 按照指定参数值映射和额外的查询条件、排序条件和分页条件查找多个实例。 |
098 | List<E> findByParamsPagination(Map<String, Object> paramMap, String extraCondition, |
099 | Map<String, Object> extraParams, String orderParam, boolean isDescending, |
100 | int pageSize, int pageNumber) throws DataAccessException; |
101 |
102 | // 按照泛型的实体类型查询得到所有持久化实体。 |
103 | // 如果实体类被设置为缓存的,则该方法首先从缓存中获取。 |
104 | List<E> findAll() throws DataAccessException; |
105 |
106 | // 按照指定实体类型查询得到所有持久化实体。 |
107 | // 如果实体类被设置为缓存的,则该方法首先从缓存中获取。 |
108 | List<E> findAll(Class clazz) throws DataAccessException; |
109 |
110 | // 忽略实体类的缓存配置,直接查询所有持久化实体。 |
111 | List<E> findAllOverCache(Class clazz) throws DataAccessException; |
112 |
113 | // 在所有的持久化实体中查询指定页的实体集合。 |
114 | List<E> findAllByPagination( int pageSize, int pageNumber) throws DataAccessException; |
115 |
116 | // 在所有的持久化实体中按照排序方式查询指定页的实体集合。 |
117 | List<E> findAllByPagination(String orderParam, boolean isDescending, int pageSize, int pageNumber) throws DataAccessException; |
118 |
119 | // 统计所有持久化实体对象的数量。 |
120 | long countAll() throws DataAccessException; |
121 |
122 | // 按条件统计持久化实体对象的数量。 |
123 | long countByParam(String paramName, Object value) throws DataAccessException; |
124 |
125 | // 按给定的限制条件统计持久化实体对象的数量。 |
126 | long countByParams(Map<String, Object> paramMap) throws DataAccessException; |
127 |
128 | // 按给定的限制条件统计实体对象的数量。 |
129 | long countByParams(Map<String, Object> paramMap, String extraCondition, Map<String, Object> extraParams) throws DataAccessException; |
130 |
131 | // 获得指定Sequence的值(仅用于Oracle) |
132 | long getSequence(String seqName) throws DataAccessException; |
联系客服