Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ir.tic.model;
- import org.compass.annotations.SearchableId;
- import org.compass.annotations.SearchableProperty;
- import org.hibernate.annotations.Columns;
- import javax.persistence.*;
- import java.io.Serializable;
- import java.util.Date;
- /**
- * Created by IntelliJ IDEA.
- * User: yaya
- * Date: 2/18/11
- * Time: 3:31 PM
- * To change this template use File | Settings | File Templates.
- */
- @Entity
- @Table(name = "trafficcity")
- public class TrafficCity extends BaseObject {
- private Long Id;
- private String trafficCityId;
- private String trafficCityName;
- private TrafficState trafficState;
- private Date trafficCityInsertDate;
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- @SearchableId
- public Long getId() {
- return Id;
- }
- public void setId(Long id) {
- Id = id;
- }
- @Column(nullable = false, length = 50)
- @SearchableProperty
- public String getTrafficCityId() {
- return trafficCityId;
- }
- public void setTrafficCityId(String trafficCityId) {
- this.trafficCityId = trafficCityId;
- }
- @Column(nullable = false, length = 50)
- @SearchableProperty
- public String getTrafficCityName() {
- return trafficCityName;
- }
- public void setTrafficCityName(String trafficCityName) {
- this.trafficCityName = trafficCityName;
- }
- @OneToMany(mappedBy = "trafficCity")
- public TrafficState getTrafficState() {
- return trafficState;
- }
- public void setTrafficState(TrafficState trafficState) {
- this.trafficState = trafficState;
- }
- public Date getTrafficCityInsertDate() {
- return trafficCityInsertDate;
- }
- public void setTrafficCityInsertDate(Date trafficCityInsertDate) {
- this.trafficCityInsertDate = trafficCityInsertDate;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TrafficCity that = (TrafficCity) o;
- if (Id != null ? !Id.equals(that.Id) : that.Id != null) return false;
- if (trafficCityId != null ? !trafficCityId.equals(that.trafficCityId) : that.trafficCityId != null)
- return false;
- if (trafficCityInsertDate != null ? !trafficCityInsertDate.equals(that.trafficCityInsertDate) : that.trafficCityInsertDate != null)
- return false;
- if (trafficCityName != null ? !trafficCityName.equals(that.trafficCityName) : that.trafficCityName != null)
- return false;
- if (trafficState != null ? !trafficState.equals(that.trafficState) : that.trafficState != null) return false;
- return true;
- }
- @Override
- public int hashCode() {
- int result = Id != null ? Id.hashCode() : 0;
- result = 31 * result + (trafficCityId != null ? trafficCityId.hashCode() : 0);
- result = 31 * result + (trafficCityName != null ? trafficCityName.hashCode() : 0);
- result = 31 * result + (trafficState != null ? trafficState.hashCode() : 0);
- result = 31 * result + (trafficCityInsertDate != null ? trafficCityInsertDate.hashCode() : 0);
- return result;
- }
- @Override
- public String toString() {
- return "TrafficCity{" +
- "Id=" + Id +
- ", trafficCityId='" + trafficCityId + '\'' +
- ", trafficCityName='" + trafficCityName + '\'' +
- ", trafficState=" + trafficState +
- ", trafficCityInsertDate=" + trafficCityInsertDate +
- '}';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement