📄 basedao.java
字号:
package com.struts2.framework.dao;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public interface BaseDao {
Class getFeaturedClass();
/**
* Generic method used to get all objects of a particular type. This is the
* same as lookup up all rows in a table.
*
* @param clazz
* the type of objects (a.k.a. while table) to get data from
* @return List of populated objects
*/
public Collection getObjects(Class clazz);
/**
* Generic method to get an object based on class and identifier. An
* ObjectRetrievalFailureException Runtime Exception is thrown if nothing is
* found.
*
* @param clazz
* model class to lookup
* @param id
* the identifier (primary key) of the class
* @return a populated object
* @see org.springframework.orm.ObjectRetrievalFailureException
*/
public Object getObject(Class clazz, Serializable id);
/**
* Generic method to save an object - handles insert.
*
* @param o
* the object to save
*/
public Object saveObject(Object o);
/**
* Generic method to save an object - handles update .
*
* @param o
* the object to save
*/
public int updateObject(Object o);
/**
* Generic method to delete an object based on class and id
*
* @param clazz
* model class to lookup
* @param id
* the identifier (primary key) of the class
*/
public void removeObject(Class clazz, Serializable id);
/**
* Generic method to query object based on class and querry parameters
*
* @param clazz
* model class to lookup
* @param parameters
* query parameters under where conditions
*/
public Collection getObjects(Class clazz, Object parameters);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -