package com.epay.dao;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.epay.pojo.TblGoods;
import com.epay.pojo.TblPrice;
import com.epay.pojo.TblUser;
public class TblPriceDAOimpl extends HibernateDaoSupport implements PriceDAO {
private static final Log log = LogFactory.getLog(TblPriceDAOimpl.class);
/* (non-Javadoc)
* @see com.epay.dao.PriceDAO#save(com.epay.pojo.TblPrice)
*/
public void save(TblPrice transientInstance) {
log.debug("saving TblPrice instance");
try {
getHibernateTemplate().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.epay.dao.PriceDAO#delete(com.epay.pojo.TblPrice)
*/
public void delete(TblPrice persistentInstance) {
log.debug("deleting TblPrice instance");
try {
getHibernateTemplate().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.epay.dao.PriceDAO#findById(java.lang.Integer)
*/
public TblPrice findById(java.lang.Integer id) {
log.debug("getting TblPrice instance with id: " + id);
try {
TblPrice instance = (TblPrice) getHibernateTemplate().get(
"com.epay.pojo.TblPrice", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.epay.dao.PriceDAO#findByExample(com.epay.pojo.TblPrice)
*/
public List findByExample(TblPrice instance) {
log.debug("finding TblPrice instance by example");
try {
List results = getHibernateTemplate().findByExample(instance);
log.debug("find by example successful, result size: "
+ results.size());
return results;
} catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.epay.dao.PriceDAO#findByProperty(java.lang.String, java.lang.Object)
*/
public List findByProperty(String propertyName, Object value) {
log.debug("finding TblPrice instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from TblPrice as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.epay.dao.PriceDAO#findAll()
*/
public List findAll() {
log.debug("finding all TblPrice instances");
try {
String queryString = "from TblPrice";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
/* 用户登录后查看竞价商品
* @see com.epay.dao.PriceDAO#seeRouped(com.epay.pojo.TblPrice)
*/
public List seeRouped( TblPrice tblprice) {
String hql="select new TblPrice(price.tblGoods,price.tblUserByBuyerid,price.buyprice" +
",price.buytime) from TblPrice price,TblUser user,TblGoods good where price." +
"tblUserByBuyerid.uid=user.uid and price.tblGoods.goodsid=good.goodsid and price.tblGoods.goodsid =?";
List list=getHibernateTemplate().find(hql, tblprice.getTblGoods().getGoodsid());
return list;
}
/* 对浏览商品进行竞价购买
* @see com.epay.dao.PriceDAO#toBuy(com.epay.pojo.TblPrice, com.epay.pojo.TblGoods)
*/
public boolean toBuy(TblPrice price,TblGoods good) {
String hql1="update TblGoods g set g.goodsstatus=2 where g.goodsid=?";
getHibernateTemplate().save(price);
int num2 = getHibernateTemplate().bulkUpdate(hql1,good.getGoodsid());
if(num2!=0){
return true;
}else
return false;
}
/* 卖方选择买家进行交易
* @see com.epay.dao.PriceDAO#bargain(com.epay.pojo.TblPrice, com.epay.pojo.TblGoods)
*/
public boolean bargain(TblPrice price,TblGoods good){
String hql="update TblPrice p set p.buystatue=2 where p.tblGoods.goodsid=?";
String hql1="update TblGoods g set g.goodsstatus=3 where g.goodsid=?";
int num = getHibernateTemplate().bulkUpdate(hql, price.getTblGoods().getGoodsid());
int num1=getHibernateTemplate().bulkUpdate(hql1, good.getGoodsid());
if(num!=0&&num1!=0){
return true;
}
return false;
}
// public static void main(String [] args){
// ApplicationContext contx=new ClassPathXmlApplicationContext("applicationContext.xml");
// TblPriceDAOimpl price=(TblPriceDAOimpl) contx.getBean("TblPriceDAO");
// TblPrice tblprice=new TblPrice();
// TblGoods good=new TblGoods();
// TblUser user = new TblUser();
// TblUser user1=new TblUser();
//
// good.setGoodsid(38);
// user.setUid(11);
// user1.setUid(12);
//
// tblprice.setTblGoods(good);
// tblprice.setTblUserByBuyerid(user);
// tblprice.setTblUserBySalerid(user1);
// tblprice.setBuyprice("123");
// tblprice.setBuytime("2008/10/30");
// tblprice.setBuystatue(1);
//
// price.toBuy(tblprice,good);
// }
}
没有合适的资源?快使用搜索试试~ 我知道了~
在线拍卖系统 Myeclipse+SSHA+MSSQL2005
共157个文件
jpg:29个
class:27个
java:25个
需积分: 9 40 下载量 123 浏览量
2009-07-25
17:46:10
上传
评论 1
收藏 2MB RAR 举报
温馨提示
一套完善的在线拍卖系统,采用SSHA框架完成,附带数据库,项目文档。实现登陆、竞价、购买、分页等功能。Myeclipse开发,MSSQL2005数据库
资源推荐
资源详情
资源评论
收起资源包目录
在线拍卖系统 Myeclipse+SSHA+MSSQL2005 (157个子文件)
TblPriceDAOimpl.class 5KB
TblUserDAOimpl.class 4KB
TblGoodsDAOimpl.class 4KB
TopayAction.class 4KB
TblGoods.class 4KB
GoodsinfoAction.class 4KB
TblUser.class 4KB
UserAction.class 4KB
TblPrice.class 3KB
LoadviewgoodsAction.class 2KB
TblGoodsDAOimpl$2.class 2KB
AdminAction.class 2KB
UserBizimpl.class 2KB
TblGoodsDAOimpl$1.class 1KB
AsAction.class 1KB
GoodsBizimpl.class 1KB
PriceBizimpl.class 1010B
GoodsForm.class 932B
CharSet.class 883B
PriceForm.class 631B
UserForm.class 621B
PriceDAO.class 537B
UserDAO.class 536B
GoodsDAO.class 523B
IUserBiz.class 329B
IGoodsBiz.class 312B
IPriceBiz.class 265B
.classpath 2KB
style.css 265B
Thumbs.db 135KB
ploice1.gif 5KB
ploice2.gif 5KB
buycar_logo.gif 3KB
logoV3A[1].gif 3KB
xianzaizhuce.gif 2KB
lianxiwo.gif 2KB
login_submit[1].gif 2KB
pa[2].gif 2KB
features_01.gif 1KB
features_02.gif 1KB
icon_features_04.gif 1KB
CftLargeIco.gif 1KB
icon_features_03.gif 1KB
security_icon[1].gif 1KB
gift_icon[1].gif 1KB
xinyong.gif 1KB
diy_icon[1].gif 1KB
safe14[1].gif 1KB
showResult[1].gif 445B
express[1].gif 250B
dwr.jar 491KB
log4j-1.2.14.jar 359KB
sqljdbc.jar 227KB
commons-beanutils.jar 184KB
TblPriceDAOimpl.java 5KB
TblGoodsDAOimpl.java 5KB
TblUserDAOimpl.java 4KB
UserAction.java 4KB
TopayAction.java 4KB
TblGoods.java 4KB
TblUser.java 3KB
GoodsinfoAction.java 3KB
TblPrice.java 2KB
LoadviewgoodsAction.java 1KB
AsAction.java 1KB
UserBizimpl.java 1KB
PriceBizimpl.java 1KB
AdminAction.java 1001B
GoodsBizimpl.java 988B
PriceDAO.java 859B
UserDAO.java 732B
CharSet.java 622B
GoodsForm.java 613B
GoodsDAO.java 583B
IPriceBiz.java 495B
IUserBiz.java 470B
UserForm.java 412B
IGoodsBiz.java 367B
PriceForm.java 332B
179.jpg 94KB
banner3.jpg 78KB
index_q_400_258[1].jpg 42KB
index_gq_400_258[1].jpg 40KB
index_258_400[1].jpg 40KB
index_huaz_400_258.jpg 39KB
index_sp_400_258[1].jpg 37KB
help_cb2.jpg 25KB
sccxpdky_760x90_080814_tea.jpg 25KB
liumangtu.jpg 20KB
nokia5000.jpg 15KB
top.jpg 13KB
mouse1.jpg 9KB
mouse.jpg 8KB
paly.jpg 7KB
index_index_pp_so_0917[1].jpg 6KB
lg.jpg 3KB
search_title[1].jpg 3KB
jiuyang.jpg 3KB
lcddianshi.jpg 3KB
003.jpg 2KB
共 157 条
- 1
- 2
资源评论
azhqiang
- 粉丝: 11
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 功率拓扑快速参考指南-ti,TI官方出品
- 开关电源拓朴图表,各种电路拓扑表格
- 登录和注册 前端:vue3+iview plus +axios 后台:spring boot +mybatis
- 软件测试入门简介:从基础到实践的全面介绍
- 2024CDA Level Ⅰ 认证考试大纲
- YOLO 数据集:淋巴病灶检测(1类别,包含训练集、验证集)
- 基于AT91RM9200处理器+XC3S250E(FPGA)+AD5322采集板Cadence ORCAD(硬件原理图+PCB)
- java+vue2实现zebra打印机,js实现
- J-link烧录软件,用于hex文件烧录
- VB打开时间同步页面/Internet时间设置.vbs
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功