// Path: src/main/java/cn/com/chenyixiao/rrs/dao/RestaurantDAO.java
// public interface RestaurantDAO {
// 
// 	public void addRestaurant(Restaurant restaurant);
// 	public void updateRestaurant(Restaurant restaurant);
// 	public Restaurant getRestaurant(Long id);
// 	public List<Restaurant> getAllRestaurants();
// 	public void deleteRestaurant(Long id);
// 	public void deleteAllRestaurants();
// 	
// 	public Long count();
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/entity/Restaurant.java
// @Entity
// @Table(name = "restaurant", catalog = "rrs")
// public class Restaurant implements java.io.Serializable {
// 
// 	private long id;
// 	private String name;
// 	private String category;
// 	private String region;
// 
// 	public Restaurant() {
// 	}
// 
// 	public Restaurant(long id) {
// 		this.id = id;
// 	}
// 
// 	public Restaurant(long id, String name, String category, String region) {
// 		this.id = id;
// 		this.name = name;
// 		this.category = category;
// 		this.region = region;
// 	}
// 
// 	@Id
// 
// 	@Column(name = "id", unique = true, nullable = false)
// 	public long getId() {
// 		return this.id;
// 	}
// 
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 
// 	@Column(name = "name")
// 	public String getName() {
// 		return this.name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	@Column(name = "category", length = 45)
// 	public String getCategory() {
// 		return this.category;
// 	}
// 
// 	public void setCategory(String category) {
// 		this.category = category;
// 	}
// 
// 	@Column(name = "region", length = 45)
// 	public String getRegion() {
// 		return this.region;
// 	}
// 
// 	public void setRegion(String region) {
// 		this.region = region;
// 	}
// 
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/service/RestaurantService.java
// public interface RestaurantService {
// 
// 	public void addRestaurant(Restaurant restaurant);
// 	public void updateRestaurant(Restaurant restaurant);
// 	public Restaurant getRestaurant(Long id);
// 	public List<Restaurant> getAllRestaurants();
// 	public void deleteRestaurant(Long id);
// 	public void deleteAllRestaurants();
// 	
// 	public Long count();
// }


import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.com.chenyixiao.rrs.dao.RestaurantDAO;
import cn.com.chenyixiao.rrs.entity.Restaurant;
import cn.com.chenyixiao.rrs.service.RestaurantService;
package cn.com.chenyixiao.rrs.service.impl;




@Service
@Transactional
public class RestaurantServiceImpl implements RestaurantService {

	@Autowired
	private RestaurantDAO restaurantDAO;
	
	public void addRestaurant(Restaurant restaurant) {
		restaurantDAO.addRestaurant(restaurant);
	}

	
	public void updateRestaurant(Restaurant restaurant) {
		restaurantDAO.updateRestaurant(restaurant);
	}

	
// Path: src/main/java/cn/com/chenyixiao/rrs/dao/RestaurantDAO.java
// public interface RestaurantDAO {
// 
// 	public void addRestaurant(Restaurant restaurant);
// 	public void updateRestaurant(Restaurant restaurant);
// 	public Restaurant getRestaurant(Long id);
// 	public List<Restaurant> getAllRestaurants();
// 	public void deleteRestaurant(Long id);
// 	public void deleteAllRestaurants();
// 	
// 	public Long count();
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/entity/Restaurant.java
// @Entity
// @Table(name = "restaurant", catalog = "rrs")
// public class Restaurant implements java.io.Serializable {
// 
// 	private long id;
// 	private String name;
// 	private String category;
// 	private String region;
// 
// 	public Restaurant() {
// 	}
// 
// 	public Restaurant(long id) {
// 		this.id = id;
// 	}
// 
// 	public Restaurant(long id, String name, String category, String region) {
// 		this.id = id;
// 		this.name = name;
// 		this.category = category;
// 		this.region = region;
// 	}
// 
// 	@Id
// 
// 	@Column(name = "id", unique = true, nullable = false)
// 	public long getId() {
// 		return this.id;
// 	}
// 
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 
// 	@Column(name = "name")
// 	public String getName() {
// 		return this.name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	@Column(name = "category", length = 45)
// 	public String getCategory() {
// 		return this.category;
// 	}
// 
// 	public void setCategory(String category) {
// 		this.category = category;
// 	}
// 
// 	@Column(name = "region", length = 45)
// 	public String getRegion() {
// 		return this.region;
// 	}
// 
// 	public void setRegion(String region) {
// 		this.region = region;
// 	}
// 
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/service/RestaurantService.java
// public interface RestaurantService {
// 
// 	public void addRestaurant(Restaurant restaurant);
// 	public void updateRestaurant(Restaurant restaurant);
// 	public Restaurant getRestaurant(Long id);
// 	public List<Restaurant> getAllRestaurants();
// 	public void deleteRestaurant(Long id);
// 	public void deleteAllRestaurants();
// 	
// 	public Long count();
// }


// Path: src/main/java/cn/com/chenyixiao/rrs/service/impl/RestaurantServiceImpl.java
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.com.chenyixiao.rrs.dao.RestaurantDAO;
import cn.com.chenyixiao.rrs.entity.Restaurant;
import cn.com.chenyixiao.rrs.service.RestaurantService;

package cn.com.chenyixiao.rrs.service.impl;




@Service
@Transactional
public class RestaurantServiceImpl implements RestaurantService {

	@Autowired
	private RestaurantDAO restaurantDAO;
	
	public void addRestaurant(Restaurant restaurant) {
		restaurantDAO.addRestaurant(restaurant);
	}

	
	public void updateRestaurant(Restaurant restaurant) {
		restaurantDAO.updateRestaurant(restaurant);
	}

	
	public Restaurant getRestaurant(Long id) {