Subversion Repositories SmartDukaan

Rev

Rev 23297 | Rev 23345 | 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 java.time.LocalDateTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="fofo.scheme_in_out", schema = "fofo")
public class SchemeInOut implements Serializable{

        private static final long serialVersionUID = 1L;
        
        @Id
        @Column(name = "scheme_id")
        private int schemeId;

        @Id
        @Column(name = "inventory_item_id")
        private int inventoryItemId;
        
        @Column(name = "amount")
        private float amount;
        
        @Column(name = "created_timestamp")
        private LocalDateTime createTimestamp = LocalDateTime.now();
        
        public int getSchemeId() {
                return schemeId;
        }
        
        public void setSchemeId(int schemeId) {
                this.schemeId = schemeId;
        }
        
        public int getInventoryItemId() {
                return inventoryItemId;
        }
        
        public void setInventoryItemId(int inventoryItemId) {
                this.inventoryItemId = inventoryItemId;
        }
        
        public float getAmount() {
                return amount;
        }
        
        public void setAmount(float amount) {
                this.amount = amount;
        }
        
        public LocalDateTime getCreateTimestamp() {
                return createTimestamp;
        }
        
        public void setCreateTimestamp(LocalDateTime createTimestamp) {
                this.createTimestamp = createTimestamp;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + Float.floatToIntBits(amount);
                result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
                result = prime * result + inventoryItemId;
                result = prime * result + schemeId;
                return result;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                SchemeInOut other = (SchemeInOut) obj;
                if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
                        return false;
                if (createTimestamp == null) {
                        if (other.createTimestamp != null)
                                return false;
                } else if (!createTimestamp.equals(other.createTimestamp))
                        return false;
                if (inventoryItemId != other.inventoryItemId)
                        return false;
                if (schemeId != other.schemeId)
                        return false;
                return true;
        }

        @Override
        public String toString() {
                return "SchemeInOut [schemeId=" + schemeId + ", inventoryItemId=" + inventoryItemId + ", amount=" + amount
                                + ", createTimestamp=" + createTimestamp + "]";
        }
        
}