Subversion Repositories SmartDukaan

Rev

Rev 23269 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

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

import java.io.Serializable;

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

/**
 * This class basically contains tag details
 * 
 * @author ashikali
 *
 */
@Entity
@Table(name="catalog.retailer_tag", uniqueConstraints = {@UniqueConstraint(columnNames = {"retailer_id","tag_id"})})
public class RetailerTag implements Serializable{
        
        private static final long serialVersionUID = 1L;
        
        public RetailerTag() {
        }
        
        @Id
        @Column(name="retailer_id")
        private int retailerId;
        
        @Id
        @Column(name = "tag_id")
        private int tagId;
        
        @Column(name = "active", columnDefinition="tinyint(1) default 0")
        private boolean active;
        
        public int getRetailerId() {
                return retailerId;
        }
        public void setRetailerId(int retailerId) {
                this.retailerId = retailerId;
        }
        public int getTagId() {
                return tagId;
        }
        public void setTagId(int tagId) {
                this.tagId = tagId;
        }
    public boolean isActive() {
                return active;
        }
    public void setActive(boolean active) {
                this.active = active;
        }
    
    
    
        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + retailerId;
                result = prime * result + tagId;
                return result;
        }
        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                RetailerTag other = (RetailerTag) obj;
                if (retailerId != other.retailerId)
                        return false;
                if (tagId != other.tagId)
                        return false;
                return true;
        }
        
        @Override
        public String toString() {
                return "FofoTag [retailerId=" + retailerId + ", tagId=" + tagId + ", active=" + active + "]";
        }

}