1 package ru
.rentdom
.entities
.housing
;
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
;
31 private boolean active
;
32 private HousingType type
;
34 private Integer price
;
35 private String currency
;
37 public String
getAddress() {
40 public void setAddress(String address
) {
41 this.address
= address
;
44 @ManyToOne(optional
=true)
45 public MetroStation
getMetroStation() {
48 public void setMetroStation(MetroStation metroStation
) {
49 this.metroStation
= metroStation
;
52 @ManyToOne(optional
=false)
53 public District
getDistrict() {
56 public void setDistrict(District district
) {
57 this.district
= district
;
60 @ManyToOne(optional
=false)
61 public User
getOwner() {
64 public void setOwner(User owner
) {
67 public Date
getCreated() {
70 public void setCreated(Date created
) {
71 this.created
= created
;
73 public Date
getUpdated() {
76 public void setUpdated(Date updated
) {
77 this.updated
= updated
;
79 public boolean isActive() {
82 public void setActive(boolean active
) {
86 @ManyToOne(optional
=false)
87 public Town
getTown() {
90 public void setTown(Town town
) {
94 @Enumerated(EnumType
.ORDINAL
)
95 public HousingType
getType() {
98 public void setType(HousingType type
) {
101 public Byte
getRooms() {
104 public void setRooms(Byte rooms
) {
107 public Integer
getPrice() {
110 public void setPrice(Integer price
) {
115 public String
getCurrency() {
118 public void setCurrency(String currency
) {
119 this.currency
= currency
;