📄 productdao.java
字号:
package com.ssh.hibernate.dao;
import java.util.List;
import com.ssh.hibernate.pojo.Product;
/**
* Interface, Product Access Object
* provides methods to access the table PRODUCT with actions of save, delete, update,
* list,find by id,and find by product name
* @author T.Xin.Jun
*/
public interface ProductDao {
/**
* Method save
* provides action to save a record to database
* @param product
* @return boolean
*/
public boolean save(Product product);
/**
* Method delete
* provides action to delete a record from database
* @param product
* @return boolean
*/
public boolean delete(Product product);
/**
* Method update
* provides action to update a record to database
* @param product
* @return boolean
*/
public boolean update(Product product);
/**
* Method load
* providers action to load a record by product id from database
* @param id
* @return Product
*/
public Product load(Long id);
/**
* Method findByName
* providers action to list the records by the product name from database
* @param name
* @return List
*/
public List<Product> findByName(String name, int start, int count);
/**
* Method findBySort
* providers action to list the records by the sort name from database
* @param name
* @return List
*/
public List<Product> findBySort(String sortName, int start, int count);
/**
* Method List
* provides action to list all the records from database
* @param id
* @return List
*/
public List<Product> list(int start, int count);
/**
* Method getTotalCount
* get total counts with query type and query keyword
* @param type
* @param keyword
* @return
*/
public int getTotalCount(String type, String keyword);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -