1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.waarp.openr66.pojo;
22
23 import com.fasterxml.jackson.annotation.JsonIgnore;
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import org.waarp.common.database.exception.WaarpDatabaseSqlException;
26
27 import java.sql.Types;
28
29 import static org.waarp.common.database.data.AbstractDbData.*;
30
31
32
33
34 public class Business {
35
36 @JsonProperty("HOSTID")
37 private String hostid;
38
39 @JsonProperty("BUSINESS")
40 private String business;
41
42 @JsonProperty("ROLES")
43 private String roles;
44
45 @JsonProperty("ALIASES")
46 private String aliases;
47
48 @JsonProperty("OTHERS")
49 private String others;
50
51 @JsonProperty("UPDATEDINFO")
52 private UpdatedInfo updatedInfo = UpdatedInfo.UNKNOWN;
53
54
55
56
57 public Business() {
58
59 }
60
61 public Business(final String hostid, final String business,
62 final String roles, final String aliases, final String others,
63 final UpdatedInfo updatedInfo)
64 throws WaarpDatabaseSqlException {
65 this(hostid, business, roles, aliases, others);
66 this.updatedInfo = updatedInfo;
67 }
68
69 public Business(final String hostid, final String business,
70 final String roles, final String aliases, final String others)
71 throws WaarpDatabaseSqlException {
72 this.hostid = hostid;
73 this.business = business;
74 this.roles = roles;
75 this.aliases = aliases;
76 this.others = others;
77 checkValues();
78 }
79
80 @JsonIgnore
81 public final void checkValues() throws WaarpDatabaseSqlException {
82 validateLength(Types.LONGVARCHAR, business, roles, aliases, others);
83 validateLength(Types.NVARCHAR, hostid);
84 }
85
86 public final String getHostid() {
87 return hostid;
88 }
89
90 public final void setHostid(final String hostid) {
91 this.hostid = hostid;
92 }
93
94 public final String getBusiness() {
95 return business;
96 }
97
98 public final void setBusiness(final String business) {
99 this.business = business;
100 }
101
102 public final String getRoles() {
103 return roles;
104 }
105
106 public final void setRoles(final String roles) {
107 this.roles = roles;
108 }
109
110 public final String getAliases() {
111 return aliases;
112 }
113
114 public final void setAliases(final String aliases) {
115 this.aliases = aliases;
116 }
117
118 public final String getOthers() {
119 return others;
120 }
121
122 public final void setOthers(final String others) {
123 this.others = others;
124 }
125
126 public final UpdatedInfo getUpdatedInfo() {
127 return updatedInfo;
128 }
129
130 public final void setUpdatedInfo(final UpdatedInfo info) {
131 updatedInfo = info;
132 }
133 }