1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.imca.model.entities;
17
18 import javax.persistence.Entity;
19 import javax.persistence.GeneratedValue;
20 import javax.persistence.GenerationType;
21 import javax.persistence.Id;
22 import javax.persistence.NamedQueries;
23 import javax.persistence.NamedQuery;
24 import javax.persistence.OneToOne;
25
26
27
28
29
30
31
32
33 @Entity
34 @NamedQueries( {
35 @NamedQuery(name = "SailingClubBasicSearch",
36 query="SELECT o FROM SailingClubEntity o WHERE " +
37 "o.name = :search")
38 })
39 public class SailingClubEntity {
40
41
42
43
44 @Id
45 @GeneratedValue(strategy=GenerationType.TABLE)
46 private long id;
47
48 private String name = "";
49
50 @OneToOne
51 private AddressEntity address;
52
53 private String url = "";
54
55 public AddressEntity getAddress() {
56 return address;
57 }
58
59 public void setAddress(AddressEntity address) {
60 this.address = address;
61 }
62
63 public long getId() {
64 return id;
65 }
66
67 public void setId(long id) {
68 this.id = id;
69 }
70
71 public String getName() {
72 return name;
73 }
74
75 public void setName(String name) {
76 this.name = name;
77 }
78
79 public String getUrl() {
80 return url;
81 }
82
83 public void setUrl(String url) {
84 this.url = url;
85 }
86
87
88
89
90
91 public String toString(){
92 return name;
93 }
94 }