1 package org.kuali.mobility.tours.entity;
2
3 import javax.persistence.Basic;
4 import javax.persistence.Column;
5 import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue;
7 import javax.persistence.GenerationType;
8 import javax.persistence.Id;
9 import javax.persistence.JoinColumn;
10 import javax.persistence.ManyToOne;
11 import javax.persistence.SequenceGenerator;
12 import javax.persistence.Table;
13 import javax.persistence.Transient;
14 import javax.xml.bind.annotation.XmlRootElement;
15
16 @XmlRootElement( name = "phoneNumber")
17 @Entity(name="POIPhoneNumber")
18 @Table(name="TOUR_POI_PHN_NUM_T")
19 public class POIPhoneNumber {
20
21 @Id
22
23
24 @GeneratedValue(strategy = GenerationType.TABLE)
25 @Column(name="PHN_NUM_ID")
26 private Long id;
27
28 @Basic
29 @Column(name="POI_ID", insertable=false, updatable=false)
30 private Long poiId;
31
32 @ManyToOne
33 @JoinColumn(name="POI_ID", nullable=false)
34 private POI poi;
35
36 @Column(name="NM")
37 private String name;
38
39 @Column(name="NMBR")
40 private String number;
41
42 @Transient
43 private String formattedNumber;
44
45 public POIPhoneNumber copy(boolean includeIds) {
46 POIPhoneNumber copy = new POIPhoneNumber();
47 if (includeIds) {
48 copy.setId(new Long(id));
49 }
50 copy.setPoiId(new Long(poiId));
51 copy.setName(new String(name));
52 copy.setNumber(new String(number));
53 return copy;
54 }
55
56 public POI getPoi() {
57 return poi;
58 }
59
60 public void setPoi(POI poi) {
61 this.poi = poi;
62 }
63
64 public Long getId() {
65 return id;
66 }
67
68 public void setId(Long id) {
69 this.id = id;
70 }
71
72 public Long getPoiId() {
73 return poiId;
74 }
75
76 public void setPoiId(Long poiId) {
77 this.poiId = poiId;
78 }
79
80 public String getName() {
81 return name;
82 }
83
84 public void setName(String name) {
85 this.name = name;
86 }
87
88 public String getNumber() {
89 return number;
90 }
91
92 public void setNumber(String number) {
93 this.number = number;
94 }
95
96 public String getFormattedNumber() {
97 return formattedNumber;
98 }
99
100 public void setFormattedNumber(String formattedNumber) {
101 this.formattedNumber = formattedNumber;
102 }
103 }