?? basedao.java
字號:
package com.ponyjava.common.hibernate3;
import java.io.Serializable;
import java.util.List;
import com.ponyjava.common.page.Pagination;
public interface BaseDao<T extends Serializable> {
/**
* 通過ID查找對象
*
* @param id
* 記錄的ID
* @param lock
* 是否鎖定對象
* @return 實體對象
*/
public T load(Serializable id, boolean lock);
public T get(Serializable id);
/**
* 通過ID查找對象,不鎖定對象
*
* @param id
* 記錄的ID
* @return 實體對象
*/
public T load(Serializable id);
/**
* 查找所有對象
*
* @return 對象列表
*/
public List<T> findAll();
public List<T> findAll(OrderBy... orders);
public Pagination findAll(int pageNo, int pageSize, OrderBy... orders);
/**
* 通過示例對象查找對象列表
*
* @param eg
* 示例對象
* @param anyWhere
* 是否模糊查詢,默認false。
* @param conds
* 排序和is null的字段。分別為OrderBy和String。
* @param exclude
* 需要排除的屬性
* @return 對象列表
*/
public List<T> findByEgList(T eg, boolean anyWhere, Condition[] conds,
String... exclude);
public List<T> findByEgList(T eg, boolean anyWhere, Condition[] conds,
int firstResult, int maxResult, String... exclude);
public Pagination findByEg(T exampleInstance, boolean anyWhere,
Condition[] conds, int pageNo, int pageSize, String... exclude);
/**
* 按屬性查找對象列表.
*/
public List<T> findByProperty(String propertyName, Object value);
/**
* 按屬性查找唯一對象.
*/
public T findUniqueByProperty(String propertyName, Object value);
/**
* 根據Updater更新對象
*
* @param updater
* @return 持久化對象
*/
public Object updateByUpdater(Updater updater);
public Object updateDefault(Object entity);
/**
* 保存對象
*
* @param entity
* 實體對象
* @return 實體對象
*/
public T save(T entity);
/**
* 更新對象
*
* @param entity
* 實體對象
* @return 實體對象
*/
public Object update(Object entity);
/**
* 保存或更新對象
*
* @param entity
* 實體對象
* @return 實體對象
*/
public Object saveOrUpdate(Object entity);
/**
* 保存或更新對象拷貝
*
* @param entity
* @return 已更新的持久化對象
*/
public Object merge(Object entity);
/**
* 刪除對象
*
* @param entity
* 實體對象
*/
public void delete(Object entity);
/**
* 根據ID刪除記錄
*
* @param id
* 記錄ID
*/
public T deleteById(Serializable id);
/**
* 刷新對象
*
* @param entity
*/
public void refresh(Object entity);
/**
* 獲得實體Class
*
* @return
*/
public Class<T> getPersistentClass();
/**
* 創建實體類的對象
*
* @return
*/
public T createNewEntiey();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -