Rev 21602 | Rev 21924 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.entity.fofo;import java.io.Serializable;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.EnumType;import javax.persistence.Enumerated;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.NamedQueries;import javax.persistence.NamedQuery;import javax.persistence.Table;import javax.persistence.UniqueConstraint;import com.spice.profitmandi.dao.enumuration.fofo.PaymentOptionType;/*** This class basically contains api details** @author ashikali**/@Entity@Table(name="fofo.payment_option", schema = "fofo", uniqueConstraints = {@UniqueConstraint(columnNames = {"order_id","type"})})@NamedQueries({@NamedQuery(name = "PaymentOption.selectById", query = "select po from PaymentOption po where po.id = :id"),@NamedQuery(name = "PaymentOption.selectByOrderId", query = "select po from PaymentOption po where po.orderId = :orderId"),@NamedQuery(name = "PaymentOption.selectTotalAmountByType", query = "select sum(po.amount) from PaymentOption po where po.type = :type group by po.type"),@NamedQuery(name = "PaymentOption.selectTotalAmountByOrderId", query = "select sum(po.amount) from PaymentOption po where po.orderId = :orderId group by po.orderId")})public class PaymentOption implements Serializable{private static final long serialVersionUID = 1L;public PaymentOption() {}@Id@Column(name="id")@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "order_id")private int orderId;@Enumerated(EnumType.STRING)@Column(name = "type")private PaymentOptionType type;@Column(name = "amount")private float amount;public int getId() {return id;}public void setId(int id) {this.id = id;}public int getOrderId() {return orderId;}public void setOrderId(int orderId) {this.orderId = orderId;}public PaymentOptionType getType() {return type;}public void setType(PaymentOptionType type) {this.type = type;}public float getAmount() {return amount;}public void setAmount(float amount) {this.amount = amount;}@Overridepublic String toString() {return "PaymentOption [id=" + id + ", orderId=" + orderId + ", type=" + type + ", amount=" + amount + "]";}}