public abstract class AbstractDynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery> extends Object implements DynamicService<E,I,Q>
| 限定符和类型 | 字段和说明 |
|---|---|
protected DataAccess<E,I,Q> |
dataAccess |
protected List<EntityAspect<E>> |
entityAspects |
protected CacheWrapper<E> |
entityCacheWrapper |
protected Class<E> |
entityClass |
protected CacheWrapper<List<E>> |
queryCacheWrapper |
protected org.springframework.transaction.support.TransactionOperations |
transactionOperations |
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractDynamicService() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
cacheable() |
protected void |
clearCache() |
long |
count(Q query) |
void |
create(E e) |
int |
create(Iterable<E> entities,
String... columns)
执行INSERT INTO [TABLE] (col1, col2) VALUES (?)
|
E |
delete(IdWrapper<I> w)
Delete entity from sharding table
|
int |
delete(Q query)
执行DELETE FORM [TABLE] WHERE ...
|
protected void |
evictCache(String key) |
E |
fetch(IdWrapper<I> w)
force to get a new entity object from database
|
protected String |
generateCacheKey(Q query) |
E |
get(IdWrapper<I> w)
Get origin entity from sharding table
|
protected String |
getCacheName() |
protected org.springframework.jdbc.core.RowMapper<E> |
getRowMapper() |
int |
patch(E e) |
int |
patch(E e,
Q q)
执行UPDATE [TABLE] SET ...
|
List<E> |
query(Q query) |
<V> List<V> |
queryColumns(Q query,
Class<V> clazz,
String... columns) |
List<I> |
queryIds(Q query) |
protected String |
resolveCacheKey(IdWrapper<I> w) |
void |
setCacheList(String caches) |
void |
setCacheManager(org.springframework.cache.CacheManager cacheManager) |
void |
setJdbcOperations(org.springframework.jdbc.core.JdbcOperations jdbcOperations) |
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) |
int |
update(E e) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchInsert, isNewEntity, saveprotected DataAccess<E extends Persistable<I>,I extends Serializable,Q extends PageQuery> dataAccess
protected final Class<E extends Persistable<I>> entityClass
protected final CacheWrapper<E extends Persistable<I>> entityCacheWrapper
protected final CacheWrapper<List<E extends Persistable<I>>> queryCacheWrapper
@Lazy @Autowired(required=false) protected List<EntityAspect<E extends Persistable<I>>> entityAspects
protected org.springframework.transaction.support.TransactionOperations transactionOperations
@Autowired public void setJdbcOperations(org.springframework.jdbc.core.JdbcOperations jdbcOperations)
protected org.springframework.jdbc.core.RowMapper<E> getRowMapper()
@Autowired(required=false) public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
@Value(value="${doyto.query.caches:}")
public void setCacheList(String caches)
protected String getCacheName()
protected void clearCache()
protected void evictCache(String key)
protected boolean cacheable()
public List<E> query(Q query)
query 在接口中 QueryService<E extends Persistable<I>,Q extends PageQuery>public long count(Q query)
count 在接口中 QueryService<E extends Persistable<I>,Q extends PageQuery>public List<I> queryIds(Q query)
queryIds 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>public <V> List<V> queryColumns(Q query, Class<V> clazz, String... columns)
queryColumns 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>public void create(E e)
create 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>public int update(E e)
update 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>public int patch(E e)
patch 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>public int create(Iterable<E> entities, String... columns)
DynamicServiceEntityAspect.afterCreate(Object)create 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>entities - entities to insertcolumns - update columns on duplicatepublic int patch(E e, Q q)
DynamicServiceEntityAspect.afterUpdate(Object, Object)patch 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>e - entity objectq - query objectpublic int delete(Q query)
DynamicServiceEntityAspect.afterDelete(Object)delete 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>query - query objectpublic E get(IdWrapper<I> w)
DynamicServiceget 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>w - an entity just contains id and information of sharding tablepublic E fetch(IdWrapper<I> w)
DynamicServicefetch 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>w - entity idpublic E delete(IdWrapper<I> w)
DynamicServicedelete 在接口中 DynamicService<E extends Persistable<I>,I extends Serializable,Q extends PageQuery>w - an entity just contains id and information of sharding tablepublic void setCacheManager(org.springframework.cache.CacheManager cacheManager)
Copyright © 2021 DOYToWin. All rights reserved.