* removed streets from dictionary
[aramzamzam-ru.rentdom.git] / rentdom-web / src / main / java / ru / rentdom / entities / housing / Housing.java
blobb83f377a10ee889229ee7f252c4172330239736f
1 package ru.rentdom.entities.housing;
3 import java.util.Date;
5 import javax.persistence.Column;
6 import javax.persistence.Entity;
7 import javax.persistence.EnumType;
8 import javax.persistence.Enumerated;
9 import javax.persistence.ManyToOne;
10 import javax.persistence.Table;
12 import net.aramzamzam.commons.hibernate.entities.BasicEntity;
13 import ru.rentdom.entities.User;
14 import ru.rentdom.entities.coords.District;
15 import ru.rentdom.entities.coords.MetroStation;
16 import ru.rentdom.entities.coords.Town;
17 import ru.rentdom.utils.HousingType;
19 @Entity(name="housing")
20 @Table(name="housings")
21 public class Housing extends BasicEntity {
22 private static final long serialVersionUID = -4821414637331301222L;
24 private String address;
25 private MetroStation metroStation;
26 private District district;
27 private Town town;
28 private User owner;
29 private Date created;
30 private Date updated;
31 private boolean active;
32 private HousingType type;
33 private Byte rooms;
34 private Integer price;
35 private String currency;
37 public String getAddress() {
38 return address;
40 public void setAddress(String address) {
41 this.address = address;
44 @ManyToOne(optional=true)
45 public MetroStation getMetroStation() {
46 return metroStation;
48 public void setMetroStation(MetroStation metroStation) {
49 this.metroStation = metroStation;
52 @ManyToOne(optional=false)
53 public District getDistrict() {
54 return district;
56 public void setDistrict(District district) {
57 this.district = district;
60 @ManyToOne(optional=false)
61 public User getOwner() {
62 return owner;
64 public void setOwner(User owner) {
65 this.owner = owner;
67 public Date getCreated() {
68 return created;
70 public void setCreated(Date created) {
71 this.created = created;
73 public Date getUpdated() {
74 return updated;
76 public void setUpdated(Date updated) {
77 this.updated = updated;
79 public boolean isActive() {
80 return active;
82 public void setActive(boolean active) {
83 this.active = active;
86 @ManyToOne(optional=false)
87 public Town getTown() {
88 return town;
90 public void setTown(Town town) {
91 this.town = town;
94 @Enumerated(EnumType.ORDINAL)
95 public HousingType getType() {
96 return type;
98 public void setType(HousingType type) {
99 this.type = type;
101 public Byte getRooms() {
102 return rooms;
104 public void setRooms(Byte rooms) {
105 this.rooms = rooms;
107 public Integer getPrice() {
108 return price;
110 public void setPrice(Integer price) {
111 this.price = price;
114 @Column(length=4)
115 public String getCurrency() {
116 return currency;
118 public void setCurrency(String currency) {
119 this.currency = currency;