From 9299bc812a31055de8252d5ea10d646003b87423 Mon Sep 17 00:00:00 2001 From: prwfxgajt <3165503644@qq.com> Date: Sun, 15 Dec 2024 12:15:26 +0800 Subject: [PATCH] Update PmemberDao.java --- .../src/com/cn/dao/PmemberDao.java | 114 ++++++++++-------- 1 file changed, 61 insertions(+), 53 deletions(-) diff --git a/ticketing-master/src/com/cn/dao/PmemberDao.java b/ticketing-master/src/com/cn/dao/PmemberDao.java index 90064c1..c9a16ea 100644 --- a/ticketing-master/src/com/cn/dao/PmemberDao.java +++ b/ticketing-master/src/com/cn/dao/PmemberDao.java @@ -1,63 +1,71 @@ -package com.cn.dao; +package com.cn.dao; // 定义接口所在的包名 -import java.sql.SQLException; -import java.util.List; +import java.sql.SQLException; // 导入SQLException类 +import java.util.List; // 导入List接口 -import com.cn.domain.Pmember; +import com.cn.domain.Pmember; // 导入Pmember实体类 /** - * - * @ClassName: PmemberDao + * PmemberDao接口,定义个人会员数据访问对象(DAO)的操作。 + *

该接口声明了与个人会员相关的数据库操作,包括添加、删除、修改、查询等。

+ * @ClassName: PmemberDao * @Description: pmember表的持久层接口 * @author: ljy * @date: 2019年9月14日 下午5:13:28 */ public interface PmemberDao { - - /** - * 添加个人信息 - * @return 返回1为添加成功 - * @throws SQLException - */ - int add(Pmember pmember) throws SQLException; - - /** - * 删除个人信息 - * @return 返回1为删除成功 - * @throws SQLException - */ - int delete(Integer pmemberId) throws SQLException; - - /** - * 修改个人信息 - * @return 返回1为修改成功 - * @throws SQLException - */ - int update(Pmember pmember) throws SQLException; - - - /** - * 获取所有个人信息 - * @return 返回元素为Pmember对象的list - * @throws SQLException - */ - /* - List getAll() throws SQLException; - */ - - /** - * 根据会员ID查询这个会员的个人信息 - * @param memberId 会员ID - * @return Pmember对象 - * @throws SQLException - */ - Pmember getPmemberByMemberId(Integer memberId) throws SQLException; - - /** - * 根据id查询会员个人信息 - * @return Pmember的对象 - * @throws SQLException - */ - Pmember getById(Integer pmemberId) throws SQLException; - + /** + * 添加个人会员信息到数据库。 + *

该方法接受一个Pmember对象作为参数,将其信息插入到数据库中。

+ * @param pmember 要添加的个人会员对象 + * @return 返回1表示添加成功,返回0表示添加失败 + * @throws SQLException 如果数据库操作出现异常 + */ + int add(Pmember pmember) throws SQLException; + + /** + * 根据个人会员ID从数据库中删除个人会员信息。 + *

该方法接受一个个人会员ID作为参数,根据该ID从数据库中删除对应的个人会员记录。

+ * @param pmemberId 要删除的个人会员ID + * @return 返回1表示删除成功,返回0表示删除失败 + * @throws SQLException 如果数据库操作出现异常 + */ + int delete(Integer pmemberId) throws SQLException; + + /** + * 更新数据库中的个人会员信息。 + *

该方法接受一个Pmember对象作为参数,根据对象中的ID更新数据库中的个人会员记录。

+ * @param pmember 包含更新信息的个人会员对象 + * @return 返回1表示修改成功,返回0表示修改失败 + * @throws SQLException 如果数据库操作出现异常 + */ + int update(Pmember pmember) throws SQLException; + + /** + * 获取数据库中的所有个人会员信息。 + *

该方法返回一个包含所有个人会员信息的列表。

+ * @return 返回包含所有个人会员信息的列表 + * @throws SQLException 如果数据库操作出现异常 + */ + /* + List getAll() throws SQLException; + */ + + /** + * 根据会员ID查询对应的个人会员信息。 + *

该方法接受一个会员ID作为参数,返回包含该ID的个人会员信息。

+ * @param memberId 要查询的会员ID + * @return 返回包含指定ID的个人会员信息 + * @throws SQLException 如果数据库操作出现异常 + */ + Pmember getPmemberByMemberId(Integer memberId) throws SQLException; + + /** + * 根据个人会员ID查询个人会员信息。 + *

该方法接受一个个人会员ID作为参数,返回包含该ID的个人会员信息。

+ * @param pmemberId 要查询的个人会员ID + * @return 返回包含指定ID的个人会员信息 + * @throws SQLException 如果数据库操作出现异常 + */ + Pmember getById(Integer pmemberId) throws SQLException; }