// Path: facshop-entities/src/main/java/ru/evgeniyosipov/facshop/entity/OrderDetail.java
// @Entity
// @Table(name = "ORDER_DETAIL")
// @NamedQueries({
//     @NamedQuery(name = "OrderDetail.findAll", query = "SELECT o FROM OrderDetail o"),
//     @NamedQuery(name = "OrderDetail.findByOrderId", query = "SELECT o FROM OrderDetail o WHERE o.orderDetailPK.orderId = :orderId"),
//     @NamedQuery(name = "OrderDetail.findByProductId", query = "SELECT o FROM OrderDetail o WHERE o.orderDetailPK.productId = :productId"),
//     @NamedQuery(name = "OrderDetail.findByQty", query = "SELECT o FROM OrderDetail o WHERE o.qty = :qty")})
// public class OrderDetail implements Serializable {
// 
//     private static final long serialVersionUID = 5604812482204021100L;
// 
//     @EmbeddedId
//     protected OrderDetailPK orderDetailPK;
//     @Basic(optional = false)
//     @Column(name = "QTY")
//     private int qty;
//     @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "ID", insertable = false, updatable = false)
//     @ManyToOne(optional = false)
//     private Product product;
// 
//     @JoinColumn(name = "ORDER_ID", referencedColumnName = "ID", insertable = false, updatable = false)
//     @ManyToOne(optional = false)
//     private CustomerOrder customerOrder;
// 
//     public OrderDetail() {
//     }
// 
//     public OrderDetail(OrderDetailPK orderDetailPK) {
//         this.orderDetailPK = orderDetailPK;
//     }
// 
//     public OrderDetail(OrderDetailPK orderDetailPK, int qty) {
//         this.orderDetailPK = orderDetailPK;
//         this.qty = qty;
//     }
// 
//     public OrderDetail(int orderId, int productId) {
//         this.orderDetailPK = new OrderDetailPK(orderId, productId);
//     }
// 
//     public OrderDetailPK getOrderDetailPK() {
//         return orderDetailPK;
//     }
// 
//     public void setOrderDetailPK(OrderDetailPK orderDetailPK) {
//         this.orderDetailPK = orderDetailPK;
//     }
// 
//     public int getQty() {
//         return qty;
//     }
// 
//     public void setQty(int qty) {
//         this.qty = qty;
//     }
// 
//     public Product getProduct() {
//         return product;
//     }
// 
//     public void setProduct(Product product) {
//         this.product = product;
//     }
// 
//     @XmlTransient
//     public CustomerOrder getCustomerOrder() {
//         return customerOrder;
//     }
// 
//     public void setCustomerOrder(CustomerOrder customerOrder) {
//         this.customerOrder = customerOrder;
//     }
// 
//     @Override
//     public int hashCode() {
//         int hash = 0;
//         hash += (orderDetailPK != null ? orderDetailPK.hashCode() : 0);
//         return hash;
//     }
// 
//     @Override
//     public boolean equals(Object object) {
//         if (!(object instanceof OrderDetail)) {
//             return false;
//         }
//         OrderDetail other = (OrderDetail) object;
//         if ((this.orderDetailPK == null && other.orderDetailPK != null) || (this.orderDetailPK != null && !this.orderDetailPK.equals(other.orderDetailPK))) {
//             return false;
//         }
//         return true;
//     }
// 
//     @Override
//     public String toString() {
//         return "ru.evgeniyosipov.facshop.entity.OrderDetail[orderDetailPK=" + orderDetailPK + "]";
//     }
// 
// }


import ru.evgeniyosipov.facshop.entity.OrderDetail;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
package ru.evgeniyosipov.facshop.store.ejb;


@Stateless
public class OrderDetailBean extends AbstractFacade<OrderDetail> {

    @PersistenceContext(unitName = "facshopPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public OrderDetailBean() {
// Path: facshop-entities/src/main/java/ru/evgeniyosipov/facshop/entity/OrderDetail.java
// @Entity
// @Table(name = "ORDER_DETAIL")
// @NamedQueries({
//     @NamedQuery(name = "OrderDetail.findAll", query = "SELECT o FROM OrderDetail o"),
//     @NamedQuery(name = "OrderDetail.findByOrderId", query = "SELECT o FROM OrderDetail o WHERE o.orderDetailPK.orderId = :orderId"),
//     @NamedQuery(name = "OrderDetail.findByProductId", query = "SELECT o FROM OrderDetail o WHERE o.orderDetailPK.productId = :productId"),
//     @NamedQuery(name = "OrderDetail.findByQty", query = "SELECT o FROM OrderDetail o WHERE o.qty = :qty")})
// public class OrderDetail implements Serializable {
// 
//     private static final long serialVersionUID = 5604812482204021100L;
// 
//     @EmbeddedId
//     protected OrderDetailPK orderDetailPK;
//     @Basic(optional = false)
//     @Column(name = "QTY")
//     private int qty;
//     @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "ID", insertable = false, updatable = false)
//     @ManyToOne(optional = false)
//     private Product product;
// 
//     @JoinColumn(name = "ORDER_ID", referencedColumnName = "ID", insertable = false, updatable = false)
//     @ManyToOne(optional = false)
//     private CustomerOrder customerOrder;
// 
//     public OrderDetail() {
//     }
// 
//     public OrderDetail(OrderDetailPK orderDetailPK) {
//         this.orderDetailPK = orderDetailPK;
//     }
// 
//     public OrderDetail(OrderDetailPK orderDetailPK, int qty) {
//         this.orderDetailPK = orderDetailPK;
//         this.qty = qty;
//     }
// 
//     public OrderDetail(int orderId, int productId) {
//         this.orderDetailPK = new OrderDetailPK(orderId, productId);
//     }
// 
//     public OrderDetailPK getOrderDetailPK() {
//         return orderDetailPK;
//     }
// 
//     public void setOrderDetailPK(OrderDetailPK orderDetailPK) {
//         this.orderDetailPK = orderDetailPK;
//     }
// 
//     public int getQty() {
//         return qty;
//     }
// 
//     public void setQty(int qty) {
//         this.qty = qty;
//     }
// 
//     public Product getProduct() {
//         return product;
//     }
// 
//     public void setProduct(Product product) {
//         this.product = product;
//     }
// 
//     @XmlTransient
//     public CustomerOrder getCustomerOrder() {
//         return customerOrder;
//     }
// 
//     public void setCustomerOrder(CustomerOrder customerOrder) {
//         this.customerOrder = customerOrder;
//     }
// 
//     @Override
//     public int hashCode() {
//         int hash = 0;
//         hash += (orderDetailPK != null ? orderDetailPK.hashCode() : 0);
//         return hash;
//     }
// 
//     @Override
//     public boolean equals(Object object) {
//         if (!(object instanceof OrderDetail)) {
//             return false;
//         }
//         OrderDetail other = (OrderDetail) object;
//         if ((this.orderDetailPK == null && other.orderDetailPK != null) || (this.orderDetailPK != null && !this.orderDetailPK.equals(other.orderDetailPK))) {
//             return false;
//         }
//         return true;
//     }
// 
//     @Override
//     public String toString() {
//         return "ru.evgeniyosipov.facshop.entity.OrderDetail[orderDetailPK=" + orderDetailPK + "]";
//     }
// 
// }


// Path: facshop-store/src/main/java/ru/evgeniyosipov/facshop/store/ejb/OrderDetailBean.java
import ru.evgeniyosipov.facshop.entity.OrderDetail;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

package ru.evgeniyosipov.facshop.store.ejb;


@Stateless
public class OrderDetailBean extends AbstractFacade<OrderDetail> {

    @PersistenceContext(unitName = "facshopPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public OrderDetailBean() {
        super(OrderDetail.class);