Subversion Repositories SmartDukaan

Rev

Rev 23654 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.fofo;

import java.time.LocalDateTime;

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.Table;

import com.spice.profitmandi.dao.enumuration.fofo.ReturnType;

/**
 * @author amit
 *
 */
@Entity
@Table(name="fofo.customer_return_item", schema = "fofo")
public class CustomerReturnItem {
        
        @Id
        @Column(name="id", unique=true, updatable=false)
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;
        
        @Column(name = "fofo_id")
        private int fofoId;
        
        @Column(name="fofo_order_item_id")
        private int fofoOrderItemId;
        
        @Column(name="fofo_order_id")
        private int fofoOrderId;
        
        @Column(name = "inventory_item_id")
        private int inventoryItemId;
        
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
                result = prime * result + creditNoteId;
                result = prime * result + fofoId;
                result = prime * result + fofoOrderId;
                result = prime * result + fofoOrderItemId;
                result = prime * result + id;
                result = prime * result + inventoryItemId;
                result = prime * result + quantity;
                result = prime * result + ((remarks == null) ? 0 : remarks.hashCode());
                result = prime * result + ((type == null) ? 0 : type.hashCode());
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                CustomerReturnItem other = (CustomerReturnItem) obj;
                if (createTimestamp == null) {
                        if (other.createTimestamp != null)
                                return false;
                } else if (!createTimestamp.equals(other.createTimestamp))
                        return false;
                if (creditNoteId != other.creditNoteId)
                        return false;
                if (fofoId != other.fofoId)
                        return false;
                if (fofoOrderId != other.fofoOrderId)
                        return false;
                if (fofoOrderItemId != other.fofoOrderItemId)
                        return false;
                if (id != other.id)
                        return false;
                if (inventoryItemId != other.inventoryItemId)
                        return false;
                if (quantity != other.quantity)
                        return false;
                if (remarks == null) {
                        if (other.remarks != null)
                                return false;
                } else if (!remarks.equals(other.remarks))
                        return false;
                if (type != other.type)
                        return false;
                return true;
        }

        public int getFofoOrderId() {
                return fofoOrderId;
        }

        public void setFofoOrderId(int fofoOrderId) {
                this.fofoOrderId = fofoOrderId;
        }

        @Column(name = "quantity")
        private int quantity;
        
        @Column(name = "remarks")
        private String remarks;
        
        public String getRemarks() {
                return remarks;
        }

        public void setRemarks(String remarks) {
                this.remarks = remarks;
        }

        public LocalDateTime getCreateTimestamp() {
                return createTimestamp;
        }

        public void setCreateTimestamp(LocalDateTime createTimestamp) {
                this.createTimestamp = createTimestamp;
        }

        @Column(name = "type")
        @Enumerated(EnumType.STRING)
        private ReturnType type;
        
        @Column(name="credit_note_id")
        private int creditNoteId;
        
        @Column(name="create_timestamp")
        private LocalDateTime createTimestamp = LocalDateTime.now();
        
        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public int getFofoId() {
                return fofoId;
        }

        public void setFofoId(int fofoId) {
                this.fofoId = fofoId;
        }
        
        public int getInventoryItemId() {
                return inventoryItemId;
        }
        public void setInventoryItemId(int inventoryItemId) {
                this.inventoryItemId = inventoryItemId;
        }
        
        public int getQuantity() {
                return quantity;
        }
        public void setQuantity(int quantity) {
                this.quantity = quantity;
        }

        public ReturnType getType() {
                return type;
        }

        public void setType(ReturnType type) {
                this.type = type;
        }

        public int getFofoOrderItemId() {
                return fofoOrderItemId;
        }

        public void setFofoOrderItemId(int fofoOrderItemId) {
                this.fofoOrderItemId = fofoOrderItemId;
        }

        public int getCreditNoteId() {
                return creditNoteId;
        }

        public void setCreditNoteId(int creditNoteId) {
                this.creditNoteId = creditNoteId;
        }

        @Override
        public String toString() {
                return "CustomerReturnItem [id=" + id + ", fofoId=" + fofoId + ", fofoOrderItemId=" + fofoOrderItemId
                                + ", fofoOrderId=" + fofoOrderId + ", inventoryItemId=" + inventoryItemId + ", quantity=" + quantity
                                + ", remarks=" + remarks + ", type=" + type + ", creditNoteId=" + creditNoteId + ", createTimestamp="
                                + createTimestamp + "]";
        }
        
}