Rev 23880 | 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.user;import java.io.Serializable;import java.time.LocalDateTime;import javax.persistence.Column;import javax.persistence.Convert;import javax.persistence.Entity;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 org.hibernate.annotations.UpdateTimestamp;import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;/*** This class basically contains address details** @author ashikali**/@Entity@Table(name="user.address", uniqueConstraints = {@UniqueConstraint(columnNames = {"name", "line_1", "line_2", "landmark", "city", "state", "pin", "country", "phone"})})public class Address implements Serializable{private static final long serialVersionUID = 1L;public Address() {}@Id@Column(name="id", unique=true, updatable=false)@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name="name")private String name;@Column(name = "line_1")private String line1;@Column(name = "line_2")private String line2;@Column(name = "landmark")private String landmark;@Column(name = "city")private String city;@Column(name = "state")private String state;@Column(name = "pin", length = 10)private String pinCode;@Column(name = "country", length = 100)private String country;@Column(name = "phone", length = 20)private String phoneNumber;@Column(name = "enabled", columnDefinition="tinyint(1) default 0")private boolean enabled;@Column(name = "user_id")private int retailerId;@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name="added_on", updatable = false)private LocalDateTime createTimestamp = LocalDateTime.now();@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name="update_timestamp")@UpdateTimestampprivate LocalDateTime updateTimestamp = LocalDateTime.now();public int getId() {return id;}public void setId(int id) {this.id = id;}public void setName(String name) {this.name = name;}public String getName() {return name;}public void setLine1(String line1) {this.line1 = line1;}public String getLine1() {return line1;}public void setLine2(String line2) {this.line2 = line2;}public String getLine2() {return line2;}public void setLandmark(String landmark) {this.landmark = landmark;}public String getLandmark() {return landmark;}public void setCity(String city) {this.city = city;}public String getCity() {return city;}public void setPinCode(String pinCode) {this.pinCode = pinCode;}public String getPinCode() {return pinCode;}public void setState(String state) {this.state = state;}public String getState() {return state;}public void setCountry(String country) {this.country = country;}public String getCountry() {return country;}public void setPhoneNumber(String phoneNumber) {this.phoneNumber = phoneNumber;}public String getPhoneNumber() {return phoneNumber;}public void setEnabled(boolean enabled) {this.enabled = enabled;}public boolean isEnabled() {return enabled;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setUpdateTimestamp(LocalDateTime updateTimestamp) {this.updateTimestamp = updateTimestamp;}public LocalDateTime getUpdateTimestamp() {return updateTimestamp;}public int getRetaierId() {return retailerId;}public void setRetaierId(int retailerId) {this.retailerId = retailerId;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + id;return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;Address other = (Address) obj;if (id != other.id)return false;return true;}@Overridepublic String toString() {return "Address [id=" + id + ", name=" + name + ", line1=" + line1 + ", line2=" + line2 + ", landmark="+ landmark + ", city=" + city + ", state=" + state + ", pinCode=" + pinCode + ", country=" + country+ ", phoneNumber=" + phoneNumber + ", enabled=" + enabled + ", createTimestamp=" + createTimestamp+ ", updateTimestamp=" + updateTimestamp + "]";}}