forked from ebean-orm/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountry.java
More file actions
53 lines (41 loc) · 840 Bytes
/
Copy pathCountry.java
File metadata and controls
53 lines (41 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package org.example.domain;
import io.ebean.Model;
import io.ebean.annotation.Cache;
import org.example.domain.finder.CountryFinder;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;
/**
* Country entity bean.
*/
@Cache
@Entity
@Table(name = "country")
public class Country extends Model {
public static final CountryFinder find = new CountryFinder();
@Id
@Size(max = 2)
final String code;
@Size(max = 60)
final String name;
public Country(String code, String name) {
this.code = code;
this.name = name;
}
public String toString() {
return code;
}
/**
* Return code.
*/
public String getCode() {
return code;
}
/**
* Return name.
*/
public String getName() {
return name;
}
}