petserviceimpl.java

来自「用Struts+hibernate写的宠物医院」· Java 代码 · 共 44 行

JAVA
44
字号
package com.sean.pet.model.service.impl;

import java.util.List;

import com.sean.pet.hibernate.dao.PetDao;
import com.sean.pet.hibernate.po.Pet;
import com.sean.pet.model.service.PetService;
import com.sean.pet.modelfactory.ModelFactory;

public class PetServiceImpl implements PetService {

	private PetDao petDao = null;
	
	public PetServiceImpl(){
		petDao = (PetDao)ModelFactory.getBean("com.sean.pet.hibernate.dao.impl.PetDaoImpl");
	}
	
	public void delete(String id) {
		// TODO Auto-generated method stub
		this.petDao.delete(id);
	}

	public List findAll() {
		// TODO Auto-generated method stub
		return this.petDao.findAll();
	}

	public Pet findByID(String id) {
		// TODO Auto-generated method stub
		return this.petDao.findByID(id);
	}

	public void save(Pet pet) {
		// TODO Auto-generated method stub
		this.petDao.save(pet);
	}

	public void update(Pet pet) {
		// TODO Auto-generated method stub
		this.petDao.update(pet);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?