Files
DataManagerSystem/src/backend/dao/interfaces/DataItemDao.java

52 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package backend.dao.interfaces;
import backend.model.DataItem;
import java.util.*;
import java.sql.*;
/**
* 数据项DAO接口提供数据项的增删改查操作
*/
public interface DataItemDao {
/**
* 根据ID查找数据项
* @param id 数据项ID
* @return 找到的数据项对象如果未找到则返回null
*/
DataItem findById(int id);
/**
* 查找所有数据项
* @return 包含所有数据项的列表
*/
List<DataItem> findAll();
/**
* 根据关键字搜索数据项
* @param keyword 搜索关键字
* @return 匹配关键字的数据项列表
*/
List<DataItem> searchByKeyword(String keyword);
/**
* 添加数据项
* @param item 要添加的数据项对象
* @return 添加成功返回true失败返回false
*/
boolean addItem(DataItem item);
/**
* 更新数据项
* @param item 包含更新信息的数据项对象
* @return 更新成功返回true失败返回false
*/
boolean updateItem(DataItem item);
/**
* 删除数据项
* @param id 要删除的数据项ID
* @return 删除成功返回true失败返回false
*/
boolean deleteItem(int id);
}