Rev 31860 | 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 com.fasterxml.jackson.annotation.JsonIgnore;import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;import javax.persistence.*;import java.io.Serializable;import java.time.LocalDate;import java.time.LocalDateTime;import java.util.List;/*** This class basically contains details** @author ashikali**//*** @author amit**/@Entity@Table(name = "fofo.customer")@NamedQueries({ @NamedQuery(name = "Customer.selectById", query = "select c from Customer c where c.id= :id") })public class Customer implements Serializable {private static final long serialVersionUID = 1L;public Customer() {}@Id@Column(name = "id")@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "first_name", length = 20)private String firstName;@Column(name = "last_name", length = 20)private String lastName;@Column(name = "email_id", length = 20)private String emailId;@Column(name = "mobile_number", length = 20)private String mobileNumber;@Column(name = "gender")private String gender;@Column(name = "date_of_birth")private LocalDate dob;@Column(name = "profile_image_id")private Integer profileImageId;@Column(name = "is_smart_seller")private boolean isSmartSeller;public boolean isSmartSeller() {return isSmartSeller;}public void setSmartSeller(boolean isSmartSeller) {this.isSmartSeller = isSmartSeller;}public Integer getProfileImageId() {return profileImageId;}public void setProfileImageId(Integer profileImageId) {this.profileImageId = profileImageId;}@Column(name = "password")@JsonIgnoreprivate String password;@Transientprivate boolean passwordExist;public String getGender() {return gender;}public void setGender(String gender) {this.gender = gender;}public LocalDate getDob() {return dob;}public void setDob(LocalDate dob) {this.dob = dob;}public boolean isPasswordExist() {return passwordExist;}public void setPasswordExist(boolean passwordExist) {this.passwordExist = passwordExist;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name = "create_timestamp")private LocalDateTime createTimestamp = LocalDateTime.now();@JsonIgnore@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)@JoinColumn(name = "customer_id", insertable = false, updatable = false, nullable = false)private List<CustomerAddress> customerAddress;public List<CustomerAddress> getCustomerAddress() {return customerAddress;}public void setCustomerAddress(List<CustomerAddress> customerAddress) {this.customerAddress = customerAddress;}public int getId() {return id;}public void setId(int id) {this.id = id;}public String getFirstName() {return firstName;}public void setFirstName(String firstName) {this.firstName = firstName;}public String getLastName() {return lastName;}public void setLastName(String lastName) {this.lastName = lastName;}public String getEmailId() {return emailId;}public void setEmailId(String emailId) {this.emailId = emailId;}public String getMobileNumber() {return mobileNumber;}public void setMobileNumber(String mobileNumber) {this.mobileNumber = mobileNumber;}@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;Customer other = (Customer) obj;if (id != other.id)return false;return true;}@Overridepublic String toString() {return "Customer [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", emailId=" + emailId+ ", mobileNumber=" + mobileNumber + ", gender=" + gender + ", dob=" + dob + ", profileImageId="+ profileImageId + ", password=" + password + ", passwordExist=" + passwordExist + ", createTimestamp="+ createTimestamp + ", customerAddress=" + customerAddress + ", isSmartSeller=" + isSmartSeller + "]";}}