// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/customer/Customer.java
// @Entity
// public class Customer {
// 
// 	@Id
// 	@GeneratedValue
// 	private Long customerId;
// 
// 	@Column(nullable = false)
// 	private String name;
// 
// 	@Column(nullable = false)
// 	private String firstname;
// 
// 	@Column(nullable = false)
// 	@Email
// 	private String email;
// 
// 	public Customer() {
// 		super();
// 		customerId = 0l;
// 	}
// 
// 	public Customer(String firstname, String name, String email, String street, String city) {
// 		super();
// 		this.name = name;
// 		this.firstname = firstname;
// 		this.email = email;
// 	}
// 
// 	public String getEmail() {
// 		return email;
// 	}
// 
// 	public void setEmail(String email) {
// 		this.email = email;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getFirstname() {
// 		return firstname;
// 	}
// 
// 	public void setFirstname(String firstname) {
// 		this.firstname = firstname;
// 	}
// 
// 	public Long getCustomerId() {
// 		return customerId;
// 	}
// 
// 	public void setCustomerId(Long id) {
// 		this.customerId = id;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return ToStringBuilder.reflectionToString(this);
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		return HashCodeBuilder.reflectionHashCode(this);
// 
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		return EqualsBuilder.reflectionEquals(this, obj);
// 	}
// 
// }
// 
// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/customer/CustomerRepository.java
// @RepositoryRestResource(exported = false)
// public interface CustomerRepository extends PagingAndSortingRepository<Customer, Long> {
// 
// 	List<Customer> findByName(@Param("name") String name);
// 
// }
// 
// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/item/ItemRepository.java
// @RepositoryRestResource(exported = false)
// public interface ItemRepository extends PagingAndSortingRepository<Item, Long> {
// 
// 	List<Item> findByName(@Param("name") String name);
// 
// 	List<Item> findByNameContaining(@Param("name") String name);
// 
// 	@Query("SELECT price FROM Item i WHERE i.itemId=?1")
// 	double price(long itemId);
// 
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.ModelAndView;
import com.ewolff.microservice.order.customer.Customer;
import com.ewolff.microservice.order.customer.CustomerRepository;
import com.ewolff.microservice.order.item.ItemRepository;
	}

	@ModelAttribute("customers")
	public Iterable<Customer> customers() {
		return customerRepository.findAll();
	}

	@RequestMapping("/")
	public ModelAndView orderList() {
		return new ModelAndView("orderlist", "orders", orderRepository.findAll());
	}

	@RequestMapping(value = "/feed", produces = "application/atom+xml")
	public ModelAndView orderFeed(WebRequest webRequest) {
		if ((orderRepository.lastUpdate() != null)
				&& (webRequest.checkNotModified(orderRepository.lastUpdate().getTime()))) {
			log.trace("Not Modified returned - request with If-Modified-Since {}",
					webRequest.getHeader(HttpHeaders.IF_MODIFIED_SINCE));
			return null;
		}
		log.trace("Returned Feed");
		return new ModelAndView(new OrderAtomFeedView(orderRepository), "orders", orderRepository.findAll());
	}

	@RequestMapping(value = "/form.html", method = RequestMethod.GET)
	public ModelAndView form() {
		return new ModelAndView("orderForm", "order", new Order());
	}

	@RequestMapping(value = "/line", method = RequestMethod.POST)
// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/customer/Customer.java
// @Entity
// public class Customer {
// 
// 	@Id
// 	@GeneratedValue
// 	private Long customerId;
// 
// 	@Column(nullable = false)
// 	private String name;
// 
// 	@Column(nullable = false)
// 	private String firstname;
// 
// 	@Column(nullable = false)
// 	@Email
// 	private String email;
// 
// 	public Customer() {
// 		super();
// 		customerId = 0l;
// 	}
// 
// 	public Customer(String firstname, String name, String email, String street, String city) {
// 		super();
// 		this.name = name;
// 		this.firstname = firstname;
// 		this.email = email;
// 	}
// 
// 	public String getEmail() {
// 		return email;
// 	}
// 
// 	public void setEmail(String email) {
// 		this.email = email;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getFirstname() {
// 		return firstname;
// 	}
// 
// 	public void setFirstname(String firstname) {
// 		this.firstname = firstname;
// 	}
// 
// 	public Long getCustomerId() {
// 		return customerId;
// 	}
// 
// 	public void setCustomerId(Long id) {
// 		this.customerId = id;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return ToStringBuilder.reflectionToString(this);
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		return HashCodeBuilder.reflectionHashCode(this);
// 
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		return EqualsBuilder.reflectionEquals(this, obj);
// 	}
// 
// }
// 
// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/customer/CustomerRepository.java
// @RepositoryRestResource(exported = false)
// public interface CustomerRepository extends PagingAndSortingRepository<Customer, Long> {
// 
// 	List<Customer> findByName(@Param("name") String name);
// 
// }
// 
// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/item/ItemRepository.java
// @RepositoryRestResource(exported = false)
// public interface ItemRepository extends PagingAndSortingRepository<Item, Long> {
// 
// 	List<Item> findByName(@Param("name") String name);
// 
// 	List<Item> findByNameContaining(@Param("name") String name);
// 
// 	@Query("SELECT price FROM Item i WHERE i.itemId=?1")
// 	double price(long itemId);
// 
// }


// Path: microservice-atom/microservice-atom-order/src/main/java/com/ewolff/microservice/order/logic/OrderController.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.ModelAndView;
import com.ewolff.microservice.order.customer.Customer;
import com.ewolff.microservice.order.customer.CustomerRepository;
import com.ewolff.microservice.order.item.ItemRepository;

	}

	@ModelAttribute("customers")
	public Iterable<Customer> customers() {
		return customerRepository.findAll();
	}

	@RequestMapping("/")
	public ModelAndView orderList() {
		return new ModelAndView("orderlist", "orders", orderRepository.findAll());
	}

	@RequestMapping(value = "/feed", produces = "application/atom+xml")
	public ModelAndView orderFeed(WebRequest webRequest) {
		if ((orderRepository.lastUpdate() != null)
				&& (webRequest.checkNotModified(orderRepository.lastUpdate().getTime()))) {
			log.trace("Not Modified returned - request with If-Modified-Since {}",
					webRequest.getHeader(HttpHeaders.IF_MODIFIED_SINCE));
			return null;
		}
		log.trace("Returned Feed");
		return new ModelAndView(new OrderAtomFeedView(orderRepository), "orders", orderRepository.findAll());
	}

	@RequestMapping(value = "/form.html", method = RequestMethod.GET)
	public ModelAndView form() {
		return new ModelAndView("orderForm", "order", new Order());
	}

	@RequestMapping(value = "/line", method = RequestMethod.POST)
	public ModelAndView addLine(Order order) {