packagecom.alex.zone.pojo;importjava.util.Date;publicclassHostReply{privateInteger id ;privateString content ;privateDate hostReplyDate ;privateUserBasic author ;//M:1privateReply reply ;//1:1publicHostReply(){}// ... get set方法}
packagecom.alex.zone.pojo;importjava.util.Date;publicclassReply{privateInteger id ;privateString content ;privateDate replyDate ;privateUserBasic author ;//M:1privateTopic topic ;//M:1privateHostReply hostReply ;//1:1publicReply(){}// ... get set方法}
packagecom.alex.zone.pojo;importjava.util.Date;importjava.util.List;publicclassTopic{privateInteger id ;privateString title ;privateString content ;privateDate topicDate ;privateUserBasic author ;//M:1privateList<Reply> replyList ;//1:NpublicTopic(){}// ... get set方法}
packagecom.alex.zone.pojo;importjava.util.List;publicclassUserBasic{privateInteger id ;privateString loginId ;privateString nickName ;privateString pwd ;privateString headImg ;privateUserDetail userDetail ;//1:1privateList<Topic> topicList ;//1:NprivateList<UserBasic> friendList ;//M:NpublicUserBasic(){}// ... get set方法}
packagecom.alex.zone.pojo;importjava.sql.Date;publicclassUserDetail{privateInteger id ;privateString realName ;privateString tel ;privateString email ;privateDate birth ;privateString star ;publicUserDetail(){}// ... get set方法}//父类:java.util.Date 年月日时分秒毫秒//子类:java.sql.Date 年月日//子类:java.sql.Time 时分秒
packagecom.alex.zone.dao.impl;importcom.alex.myssm.basedao.BaseDAO;importcom.alex.zone.dao.UserBasicDAO;importcom.alex.zone.pojo.UserBasic;importjava.util.List;publicclassUserBasicDAOImplextendsBaseDAO<UserBasic>implementsUserBasicDAO{@OverridepublicUserBasicgetUserBasic(String loginId,String pwd){returnsuper.load("select * from t_user_basic where loginId = ? and pwd = ? ", loginId , pwd);}@OverridepublicList<UserBasic>getUserBasicList(UserBasic userBasic){String sql ="SELECT fid as 'id' FROM t_friend WHERE uid = ?";returnsuper.executeQuery(sql,userBasic.getId());}@OverridepublicUserBasicgetUserBasicById(Integer id){returnload("select * from t_user_basic where id = ? ", id);}}
packagecom.alex.zone.dao.impl;importcom.alex.myssm.basedao.BaseDAO;importcom.alex.zone.dao.TopicDAO;importcom.alex.zone.pojo.Topic;importcom.alex.zone.pojo.UserBasic;importjava.util.List;publicclassTopicDAOImplextendsBaseDAO<Topic>implementsTopicDAO{@OverridepublicList<Topic>getTopicList(UserBasic userBasic){returnsuper.executeQuery("select * from t_topic where author = ? ", userBasic.getId());}@OverridepublicvoidaddTopic(Topic topic){}@OverridepublicvoiddelTopic(Topic topic){}@OverridepublicTopicgetTopic(Integer id){returnnull;}}