Subversion Repositories SmartDukaan

Rev

Rev 28301 | Rev 31447 | 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.dtr;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;

@Entity
@Table(name = "dtr.web_listing", schema = "dtr")
public class WebListing implements Serializable {

        private static final long serialVersionUID = 1L;
        @Id
        @Column(name = "id", columnDefinition = "int(10) unsigned")
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @JsonProperty(defaultValue = "0")
        private int id;

        @Column
        private String title;

        @Column
        @JsonProperty(defaultValue = "0")
        private int rank;

        @Column
        private String url;

        @Column
        private String bannerUrl;

        @Column
        private String headerUrl;

        @Column
        @JsonProperty(defaultValue = "true")
        private boolean active = true;

        @Transient
        private List<FofoCatalogResponse> fofoCatalogResponses;

        public String getBannerUrl() {
                return bannerUrl;
        }

        public void setBannerUrl(String bannerUrl) {
                this.bannerUrl = bannerUrl;
        }

        public int getId() {
                return id;
        }

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

        public String getTitle() {
                return title;
        }

        public void setTitle(String title) {
                this.title = title;
        }

        public int getRank() {
                return rank;
        }

        public void setRank(int rank) {
                this.rank = rank;
        }

        public boolean isActive() {
                return active;
        }

        public void setActive(boolean active) {
                this.active = active;
        }

        public String getUrl() {
                return url;
        }

        public void setUrl(String url) {
                this.url = url;
        }

        public String getHeaderUrl() {
                return headerUrl;
        }

        public void setHeaderUrl(String headerUrl) {
                this.headerUrl = headerUrl;
        }

        @Override
        public String toString() {
                return "WebListing [id=" + id + ", title=" + title + ", rank=" + rank + ", url=" + url + ", active=" + active
                                + "]";
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                result = prime * result + (active ? 1231 : 1237);
                result = prime * result + ((bannerUrl == null) ? 0 : bannerUrl.hashCode());
                result = prime * result + ((fofoCatalogResponses == null) ? 0 : fofoCatalogResponses.hashCode());
                result = prime * result + ((headerUrl == null) ? 0 : headerUrl.hashCode());
                result = prime * result + id;
                result = prime * result + rank;
                result = prime * result + ((title == null) ? 0 : title.hashCode());
                result = prime * result + ((url == null) ? 0 : url.hashCode());
                return result;
        }

        public List<FofoCatalogResponse> getFofoCatalogResponses() {
                return fofoCatalogResponses;
        }

        public void setFofoCatalogResponses(List<FofoCatalogResponse> fofoCatalogResponses) {
                this.fofoCatalogResponses = fofoCatalogResponses;
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                WebListing other = (WebListing) obj;
                if (active != other.active)
                        return false;
                if (bannerUrl == null) {
                        if (other.bannerUrl != null)
                                return false;
                } else if (!bannerUrl.equals(other.bannerUrl))
                        return false;
                if (fofoCatalogResponses == null) {
                        if (other.fofoCatalogResponses != null)
                                return false;
                } else if (!fofoCatalogResponses.equals(other.fofoCatalogResponses))
                        return false;
                if (headerUrl == null) {
                        if (other.headerUrl != null)
                                return false;
                } else if (!headerUrl.equals(other.headerUrl))
                        return false;
                if (id != other.id)
                        return false;
                if (rank != other.rank)
                        return false;
                if (title == null) {
                        if (other.title != null)
                                return false;
                } else if (!title.equals(other.title))
                        return false;
                if (url == null) {
                        if (other.url != null)
                                return false;
                } else if (!url.equals(other.url))
                        return false;
                return true;
        }

}