?? genericdao.java
字號:
package com.mycompany.myapp.dao;import java.io.Serializable;import java.util.List;/** * Generic DAO (Data Access Object) with common methods to CRUD POJOs. * * <p>Extend this interface if you want typesafe (no casting necessary) DAO's for your * domain objects. * * @param <T> a type variable * @param <PK> the primary key for that type */public interface GenericDao <T, PK extends Serializable> { /** * Generic method used to get all objects of a particular type. This * is the same as lookup up all rows in a table. * @return List of populated objects */ List<T> getAll(); /** * Generic method to get an object based on class and identifier. An * ObjectRetrievalFailureException Runtime Exception is thrown if * nothing is found. * * @param id the identifier (primary key) of the object to get * @return a populated object * @see org.springframework.orm.ObjectRetrievalFailureException */ T get(PK id); /** * Generic method to insert an object. * @param object the object to insert * @return the persisted object */ T insert(T object); /** * Generic method to update an object. * @param object the object to update * @return the persisted object */ T update(T object); /** * Generic method to delete an object based on class and id * @param id the identifier (primary key) of the object to remove */ void remove(PK id);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -