Package top.codef.dao
Class AbstractDao
java.lang.Object
top.codef.dao.AbstractDao
- All Implemented Interfaces:
AmebaDao
- Direct Known Subclasses:
BaseDao
,TypedBaseDao
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> void
create
(T entity) 持久化实体<T> void
createOrUpdate
(T entity) <T> void
delete
(Class<T> clazz, Serializable id) 通过id删除实体<T> void
delete
(T value) 删除实体<T> void
detach
(T entity) 游离化实体void
flush()
同步持久化上下文<T> T
get
(Class<? extends T> clazz, Serializable id) 根据id获取实体jakarta.persistence.EntityManager
获取当前数据连接对应的entitymanagerorg.hibernate.Session
获取hibernate session<T> void
lock
(T entity, jakarta.persistence.LockModeType lockModeType) 给实体对象加锁<T> void
merge
(T entity) 合并实体<T> void
refresh
(T entity) 同步持久化对象Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface top.codef.dao.AmebaDao
conditionHandle, conditionHandle, generateUid, groupBy, groupBy, joinTable, limit, orderBy, orderBy, orderBy, orderBy, select, seperate, where
-
Constructor Details
-
AbstractDao
public AbstractDao()
-
-
Method Details
-
getEntityManager
public jakarta.persistence.EntityManager getEntityManager()获取当前数据连接对应的entitymanager- Specified by:
getEntityManager
in interfaceAmebaDao
-
getSession
public org.hibernate.Session getSession()获取hibernate session- Returns:
-
create
public <T> void create(T entity) 持久化实体- Type Parameters:
T
- Entity实体类型- Parameters:
entity
- 要创建的实体
-
detach
public <T> void detach(T entity) 游离化实体- Type Parameters:
T
-- Parameters:
entity
-
-
createOrUpdate
public <T> void createOrUpdate(T entity) - Type Parameters:
T
-- Parameters:
entity
-
-
merge
public <T> void merge(T entity) 合并实体- Type Parameters:
T
-- Parameters:
entity
-
-
delete
通过id删除实体- Type Parameters:
T
-- Parameters:
clazz
-id
- 实体id
-
delete
public <T> void delete(T value) 删除实体- Type Parameters:
T
-- Parameters:
value
-
-
get
根据id获取实体- Type Parameters:
T
-- Parameters:
clazz
-id
- 实体id- Returns:
-
flush
public void flush()同步持久化上下文 -
refresh
public <T> void refresh(T entity) 同步持久化对象- Type Parameters:
T
-- Parameters:
entity
-
-
lock
public <T> void lock(T entity, jakarta.persistence.LockModeType lockModeType) 给实体对象加锁- Type Parameters:
T
-- Parameters:
entity
-lockModeType
-
-