Java通用DAO類:yagdao
yagdao 是一個通用DAO(Data Access Objects)類,支持JPA2和hibernate,用戶不用編寫代碼就能夠實現一些常用的CRUD操作和查詢操作。
public interface SimpleBeanDAO extends GenericDAO<SimpleBean, Long> {
/**
* Sample save method with two properties
*/
@YMethod(type = YMethodType.SAVE)
SimpleBean customSave1(@YParameter("pstring") String p1, @YParameter("pdouble") double p2);
@YMethod(type = YMethodType.UPDATE)
SimpleBean customUpdate1(long id, @YParameter("pstring") String p1, @YParameter("pdouble") double p2);
@YMethod(type = YMethodType.QUERY, query = "select s from SimpleBean s where s.pint>:minint")
List<SimpleBean> customQuery2(@YParameter("minint") int arg1);
@YMethod(type = YMethodType.CRITERIA)
SearchResultList<SimpleBean> criteria1(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1, YPage page);
@YMethod(type = YMethodType.COUNT)
long count1(@YParameter(value = "pint", operator = YOperator.GE) Integer arg1);
}
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!