JavaWeb项目开发案例精粹-第6章报价管理系统-04Service层
1.
- package com.sanqing.service;
- import com.sanqing.dao.DAO;
- import com.sanqing.po.Customer;
- /**
- * 客户业务接口
- */
- public interface CustomerService extends DAO<Customer> {
- }
2.
- package com.sanqing.service;
- import com.sanqing.dao.DAO;
- import com.sanqing.po.Order;
- /**
- * 订单业务接口
- */
- public interface OrderService extends DAO<Order> {
- }
3.
- package com.sanqing.service;
- import com.sanqing.dao.DAO;
- import com.sanqing.po.Product;
- /**
- * 产品业务接口
- */
- public interface ProductService extends DAO<Product> {
- }
4.
- package com.sanqing.service;
- import com.sanqing.dao.DAO;
- import com.sanqing.po.ProductType;
- /**
- * 产品类别业务接口
- */
- public interface ProductTypeService extends DAO<ProductType> {
- }
5.
- package com.sanqing.service;
- import com.sanqing.dao.DAO;
- import com.sanqing.po.Quotation;
- /**
- * 报价业务接口
- */
- public interface QuotationService extends DAO<Quotation> {
- }
6.
- package com.sanqing.service;
- import com.sanqing.dao.DAO;
- import com.sanqing.po.User;
- /**
- * 用户业务接口
- */
- public interface UserService extends DAO<User> {
- /**
- * 判断用户是否存在
- * @param username 用户名
- * @param password 密码
- * @return
- */
- public boolean login(String username, String password) ;
- }
7.
- package com.sanqing.serviceImpl;
- import org.springframework.stereotype.Service;
- import com.sanqing.dao.DaoSupport;
- import com.sanqing.po.Customer;
- import com.sanqing.service.CustomerService;
- @Service
- public class CustomerServiceImpl extends DaoSupport<Customer> implements
- CustomerService {
- }
8.
- package com.sanqing.serviceImpl;
- import java.util.Date;
- import org.springframework.stereotype.Service;
- import com.sanqing.dao.DaoSupport;
- import com.sanqing.po.Order;
- import com.sanqing.service.OrderService;
- @Service
- public class OrderServiceImpl extends DaoSupport<Order> implements OrderService {
- @Override
- public void save(Object entity) {
- Order order = (Order)entity;
- order.setOrderTime(new Date());
- super.save(order);
- }
- @Override
- public void update(Object entity) {
- Order order = (Order)entity;
- order.setOrderTime(new Date());
- super.update(entity);
- }
- }
9.
- package com.sanqing.serviceImpl;
- import org.springframework.stereotype.Service;
- import com.sanqing.dao.DaoSupport;
- import com.sanqing.po.Product;
- import com.sanqing.service.ProductService;
- @Service
- public class ProductServiceImpl extends DaoSupport<Product> implements ProductService {
- }
10.
- package com.sanqing.serviceImpl;
- import org.springframework.stereotype.Service;
- import com.sanqing.dao.DaoSupport;
- import com.sanqing.po.ProductType;
- import com.sanqing.service.ProductTypeService;
- @Service
- public class ProductTypeServiceImpl extends DaoSupport<ProductType> implements
- ProductTypeService {
- }
11.
- package com.sanqing.serviceImpl;
- import java.util.Date;
- import org.springframework.stereotype.Service;
- import com.sanqing.dao.DaoSupport;
- import com.sanqing.po.Quotation;
- import com.sanqing.service.QuotationService;
- @Service
- public class QuotationServiceImpl extends DaoSupport<Quotation> implements
- QuotationService {
- @Override
- public void save(Object entity) {
- Quotation quotation = (Quotation)entity;
- quotation.setQuotationTime(new Date());
- super.save(entity);
- }
- @Override
- public void update(Object entity) {
- Quotation quotation = (Quotation)entity;
- quotation.setQuotationTime(new Date());
- super.update(entity);
- }
- }
12.
- package com.sanqing.serviceImpl;
- import org.springframework.stereotype.Service;
- import com.sanqing.dao.DaoSupport;
- import com.sanqing.po.User;
- import com.sanqing.service.UserService;
- @Service
- public class UserServiceImpl extends DaoSupport<User> implements UserService {
- public boolean login(String username, String password) {
- long count = (Long)em.createQuery("select count(o) from User o where o.username=?1 and o.password=?2")
- .setParameter(1, username).setParameter(2, password).getSingleResult();
- return count>0;
- }
- }
13.
JavaWeb项目开发案例精粹-第6章报价管理系统-04Service层的更多相关文章
- JavaWeb项目开发案例精粹-第6章报价管理系统-05Action层
0. <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC &quo ...
- JavaWeb项目开发案例精粹-第6章报价管理系统-07View层
1. 2.back_index.html <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT= ...
- JavaWeb项目开发案例精粹-第6章报价管理系统-06po层
1. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www ...
- JavaWeb项目开发案例精粹-第6章报价管理系统-03Dao层
1. package com.sanqing.dao; import java.io.Serializable; import java.util.LinkedHashMap; import com. ...
- JavaWeb项目开发案例精粹-第6章报价管理系统-002辅助类及配置文件
1. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www ...
- JavaWeb项目开发案例精粹-第6章报价管理系统-001需求分析及设计
1. 2. 3. 4. 5. 6.
- JavaWeb项目开发案例精粹-第2章投票系统-006view层
1.index.jsp <%@ page language="java" import="java.util.*" pageEncoding=" ...
- JavaWeb项目开发案例精粹-第2章投票系统-004action层
1. package com.sanqing.action; import java.util.UUID; import com.opensymphony.xwork2.ActionSupport; ...
- JavaWeb项目开发案例精粹-第2章投票系统-003Dao层
1. package com.sanqing.dao; import java.util.List; import com.sanqing.bean.Vote; import com.sanqing. ...
随机推荐
- SetTmer函数调用 、取时间函数调用 、计时函数
SetTmer函数调用 #include <iostream> 取时间函数调用 计时函数
- OA Framework - How to Find the Correct Version of JDeveloper to Use with E-Business Suite 11i or Release 12.x (Doc ID 416708.1)
APPLIES TO: Oracle Applications Framework - Version 11.5.10.0 to 12.2.2 [Release 11.5.10 to 12.2] In ...
- JavaScript深复制
转载:http://blog.csdn.net/wanmingtom/article/details/7988284 这原本是StackOverFlow里的一个提问,看到答案后受益良多,于是翻译一下下 ...
- Android -- ViewRoot,关于子线程刷新UI
Android在4.0之后执行线程更新UI操作会报异常:CalledFromWrongThreadException:Only the original thread that created a v ...
- proxy server 代理服务器
有时候,我觉得自己需要去搞明白.搞清楚一个概念,帮我打通一下自己的知识体系,或者说,尝试联络起来. 1. 简介 突破自身IP限制,访问国外站点. 访问单位或者团体内部资源. 突破中国电信的IP封锁. ...
- Beta版软件说明书
软件使用说明书 一. 软件概述 本软件面向广大简易图片使用者,旨在为用户提供简单方便的不对其他软件产生依赖的截图软件,可以脱机使用. 二. 运行环境 个人电脑,Windows7操作系统,. ...
- Hibernate O/R Mapping模拟
作为SSH中的重要一环,有必要理解一下Hibernate对 O/R Mapping的实现. 主要利用java的反射机制来得到完整的SQL语句. 准备工作: 1. Object Student实体类: ...
- 实现IDisposable接口的模式
代码: public class Class2 : IDisposable { ~Class2() { Dispose(false); } public void Dispose() { Dispos ...
- SQL Server 2008中新增的 1.变更数据捕获(CDC) 和 2.更改跟踪
概述 1.变更数据捕获(CDC) 每一次的数据操作都会记录下来 2.更改跟踪 只会记录最新一条记录 以上两种的区别: http://blog.csdn.n ...
- 关于WSDL
Message Operation 最核心的在于Operation 只要关心Operation就可以了,Operation只有Input, Output没有其他内容,是相对固定的.只要关心一下Inpu ...