Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 3.47 KB | None | 0 0
  1. package ir.tic.model;
  2.  
  3. import org.compass.annotations.SearchableId;
  4. import org.compass.annotations.SearchableProperty;
  5. import org.hibernate.annotations.Columns;
  6.  
  7. import javax.persistence.*;
  8. import java.io.Serializable;
  9. import java.util.Date;
  10.  
  11. /**
  12.  * Created by IntelliJ IDEA.
  13.  * User: yaya
  14.  * Date: 2/18/11
  15.  * Time: 3:31 PM
  16.  * To change this template use File | Settings | File Templates.
  17.  */
  18.  
  19. @Entity
  20. @Table(name = "trafficcity")
  21. public class TrafficCity extends BaseObject {
  22.  
  23.  
  24.     private Long Id;
  25.     private String trafficCityId;
  26.     private String trafficCityName;
  27.     private TrafficState trafficState;
  28.     private Date trafficCityInsertDate;
  29.  
  30.     @Id
  31.     @GeneratedValue(strategy = GenerationType.AUTO)
  32.     @SearchableId
  33.     public Long getId() {
  34.         return Id;
  35.     }
  36.  
  37.     public void setId(Long id) {
  38.         Id = id;
  39.     }
  40.  
  41.     @Column(nullable = false, length = 50)
  42.     @SearchableProperty
  43.     public String getTrafficCityId() {
  44.         return trafficCityId;
  45.     }
  46.  
  47.     public void setTrafficCityId(String trafficCityId) {
  48.         this.trafficCityId = trafficCityId;
  49.     }
  50.  
  51.     @Column(nullable = false, length = 50)
  52.     @SearchableProperty
  53.  
  54.     public String getTrafficCityName() {
  55.         return trafficCityName;
  56.     }
  57.  
  58.     public void setTrafficCityName(String trafficCityName) {
  59.         this.trafficCityName = trafficCityName;
  60.     }
  61.  
  62.     @OneToMany(mappedBy = "trafficCity")
  63.     public TrafficState getTrafficState() {
  64.         return trafficState;
  65.     }
  66.  
  67.     public void setTrafficState(TrafficState trafficState) {
  68.         this.trafficState = trafficState;
  69.     }
  70.  
  71.     public Date getTrafficCityInsertDate() {
  72.         return trafficCityInsertDate;
  73.     }
  74.  
  75.     public void setTrafficCityInsertDate(Date trafficCityInsertDate) {
  76.         this.trafficCityInsertDate = trafficCityInsertDate;
  77.     }
  78.  
  79.     @Override
  80.     public boolean equals(Object o) {
  81.         if (this == o) return true;
  82.         if (o == null || getClass() != o.getClass()) return false;
  83.  
  84.         TrafficCity that = (TrafficCity) o;
  85.  
  86.         if (Id != null ? !Id.equals(that.Id) : that.Id != null) return false;
  87.         if (trafficCityId != null ? !trafficCityId.equals(that.trafficCityId) : that.trafficCityId != null)
  88.             return false;
  89.         if (trafficCityInsertDate != null ? !trafficCityInsertDate.equals(that.trafficCityInsertDate) : that.trafficCityInsertDate != null)
  90.             return false;
  91.         if (trafficCityName != null ? !trafficCityName.equals(that.trafficCityName) : that.trafficCityName != null)
  92.             return false;
  93.         if (trafficState != null ? !trafficState.equals(that.trafficState) : that.trafficState != null) return false;
  94.  
  95.         return true;
  96.     }
  97.  
  98.     @Override
  99.     public int hashCode() {
  100.         int result = Id != null ? Id.hashCode() : 0;
  101.         result = 31 * result + (trafficCityId != null ? trafficCityId.hashCode() : 0);
  102.         result = 31 * result + (trafficCityName != null ? trafficCityName.hashCode() : 0);
  103.         result = 31 * result + (trafficState != null ? trafficState.hashCode() : 0);
  104.         result = 31 * result + (trafficCityInsertDate != null ? trafficCityInsertDate.hashCode() : 0);
  105.         return result;
  106.     }
  107.  
  108.     @Override
  109.     public String toString() {
  110.         return "TrafficCity{" +
  111.                 "Id=" + Id +
  112.                 ", trafficCityId='" + trafficCityId + '\'' +
  113.                 ", trafficCityName='" + trafficCityName + '\'' +
  114.                 ", trafficState=" + trafficState +
  115.                 ", trafficCityInsertDate=" + trafficCityInsertDate +
  116.                 '}';
  117.     }
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement