您好,登錄后才能下訂單哦!
Java小項(xiàng)目之:旅游網(wǎng)站
旅游網(wǎng)站應(yīng)用到的技術(shù):
1.Hibernate
2.Tomcat Servlet
3.Jsp,javaScript,jquery , Ajax,EL表達(dá)式
前臺(tái)功能:
1用戶(hù)的注冊(cè)和登錄,
2旅游線路的報(bào)名(一人只能報(bào)一條線路);
3用戶(hù)對(duì)每條旅游線路的評(píng)論。
4查詢(xún)一個(gè)城市的所有線路
5查詢(xún)單一的一條線路
后臺(tái)管理功能:
1旅游線路的增刪改查
2對(duì)用戶(hù)評(píng)論的刪除或回復(fù)
3刪除查詢(xún)用戶(hù)
部分代碼展示:
package biz;
import java.util.List;
import java.util.Set;
import org.hibernate.Transaction;
import util.HibernateUtil;
import dao.ManagerDAO;
import dao.ManagerDAOImpl;
import entity.Manage;
import entity.User;
import entity.Word;
public class ManagerBizImpl implements ManagerBiz {
private ManagerDAO manageDAO = new ManagerDAOImpl();
private final int PAGESIZE = 3;
public boolean queryManage(Manage manage) {
return manageDAO.queryManage(manage);
}
public boolean saveManage(Manage manage) {
Transaction ts = HibernateUtil.getCurrentSession().beginTransaction();
boolean b = manageDAO.saveManage(manage);
ts.commit();
return b;
}
public Set<User> queryAllUser(int page) {
Set<User> users = manageDAO.queryAllUser(page, PAGESIZE);
return users;
}
public int queryUserCount() {
int count = manageDAO.queryUserCount();
int totalPage = 0;
if(count % PAGESIZE == 0) {
totalPage = count / PAGESIZE;
} else {
totalPage = (count / PAGESIZE) + 1;
}
return totalPage;
}
public Set<User> queryUserByUsername(String username) {
return manageDAO.queryUserByUsername(username);
}
public boolean deleteUserByUsername(Integer id) {
Transaction ts = HibernateUtil.getCurrentSession().beginTransaction();
boolean b = manageDAO.deleteUserByUsername(id);
ts.commit();
return b;
}
public List<Word> getAllWords(int page) {
return manageDAO.queryAllWords(page, PAGESIZE);
}
public boolean updateWord(Integer id, String restore) {
Transaction ts = HibernateUtil.getCurrentSession().beginTransaction();
boolean b = manageDAO.updateWord(id, restore);
ts.commit();
return b;
}
public boolean deleteWordById(Integer id) {
Transaction ts = HibernateUtil.getCurrentSession().beginTransaction();
boolean b = manageDAO.deleteWordById(id);
ts.commit();
return b;
}
public Word queryWordById(Integer id) {
return manageDAO.queryWordById(id);
}
public int queryWordCount() {
int count = manageDAO.queryWordCount();
int totalPage = 0;
if(count % PAGESIZE == 0) {
totalPage = count / PAGESIZE;
} else {
totalPage = (count / PAGESIZE) + 1;
}
return totalPage;
}
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。