OSDN Git Service

DBFlute-0.9.3に更新
[ea2ddl/ea2ddl.git] / ea2ddl-dao / src / main / java / jp / sourceforge / ea2ddl / dao / bsentity / BsTMethod.java
1 package jp.sourceforge.ea2ddl.dao.bsentity;\r
2 \r
3 import java.io.Serializable;\r
4 import java.util.*;\r
5 \r
6 import org.seasar.dbflute.Entity;\r
7 import org.seasar.dbflute.dbmeta.DBMeta;\r
8 import jp.sourceforge.ea2ddl.dao.allcommon.DBMetaInstanceHandler;\r
9 \r
10 /**\r
11  * The entity of t_method that the type is TABLE. <br />\r
12  * <pre>\r
13  * [primary-key]\r
14  *     \r
15  * \r
16  * [column]\r
17  *     Object_ID, Name, Scope, Type\r
18  * \r
19  * [sequence]\r
20  *     \r
21  * \r
22  * [identity]\r
23  *     \r
24  * \r
25  * [version-no]\r
26  *     \r
27  * \r
28  * [foreign-table]\r
29  *     \r
30  * \r
31  * [referrer-table]\r
32  *     \r
33  * \r
34  * [foreign-property]\r
35  *     \r
36  * \r
37  * [referrer-property]\r
38  *     \r
39  * </pre>\r
40  * @author DBFlute(AutoGenerator)\r
41  */\r
42 public abstract class BsTMethod implements Entity, Serializable {\r
43 \r
44     // ===================================================================================\r
45     //                                                                          Definition\r
46     //                                                                          ==========\r
47     /** Serial version UID. (Default) */\r
48     private static final long serialVersionUID = 1L;\r
49 \r
50     // ===================================================================================\r
51     //                                                                           Attribute\r
52     //                                                                           =========\r
53     // -----------------------------------------------------\r
54     //                                                Column\r
55     //                                                ------\r
56     /** Object_ID: {UQ : INTEGER} */\r
57     protected java.lang.Integer _objectId;\r
58 \r
59     /** Name: {UQ : VARCHAR(255)} */\r
60     protected String _name;\r
61 \r
62     /** Scope: {VARCHAR(50)} */\r
63     protected String _scope;\r
64 \r
65     /** Type: {VARCHAR(50)} */\r
66     protected String _type;\r
67 \r
68     // -----------------------------------------------------\r
69     //                                              Internal\r
70     //                                              --------\r
71     /** The attribute of entity modified properties. (for S2Dao) */\r
72     protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties();\r
73     \r
74     // ===================================================================================\r
75     //                                                                          Table Name\r
76     //                                                                          ==========\r
77     public String getTableDbName() {\r
78         return "t_method";\r
79     }\r
80 \r
81     public String getTablePropertyName() { // as JavaBeansRule\r
82         return "TMethod";\r
83     }\r
84 \r
85     // ===================================================================================\r
86     //                                                                              DBMeta\r
87     //                                                                              ======\r
88     public DBMeta getDBMeta() {\r
89         return DBMetaInstanceHandler.findDBMeta(getTableDbName());\r
90     }\r
91 \r
92     // ===================================================================================\r
93     //                                                          Classification Classifying\r
94     //                                                          ==========================\r
95     // ===================================================================================\r
96     //                                                        Classification Determination\r
97     //                                                        ============================\r
98     // ===================================================================================\r
99     //                                                           Classification Name/Alias\r
100     //                                                           =========================\r
101     // ===================================================================================\r
102     //                                                                    Foreign Property\r
103     //                                                                    ================\r
104     // ===================================================================================\r
105     //                                                                   Referrer Property\r
106     //                                                                   =================\r
107     // ===================================================================================\r
108     //                                                                       Determination\r
109     //                                                                       =============\r
110     public boolean hasPrimaryKeyValue() {\r
111         return false;\r
112     }\r
113 \r
114     // ===================================================================================\r
115     //                                                                 Modified Properties\r
116     //                                                                 ===================\r
117     public Set<String> getModifiedPropertyNames() {\r
118         return _modifiedProperties.getPropertyNames();\r
119     }\r
120 \r
121     protected EntityModifiedProperties newEntityModifiedProperties() {\r
122         return new EntityModifiedProperties();\r
123     }\r
124 \r
125     public void clearModifiedPropertyNames() {\r
126         _modifiedProperties.clear();\r
127     }\r
128 \r
129     public boolean hasModification() {\r
130         return !_modifiedProperties.isEmpty();\r
131     }\r
132 \r
133     // ===================================================================================\r
134     //                                                                      Basic Override\r
135     //                                                                      ==============\r
136     /**\r
137      * If the all-column value of the other is same as this one, returns true.\r
138      * @param other Other entity. (Nullable)\r
139      * @return Comparing result. If other is null, returns false.\r
140      */\r
141     public boolean equals(Object other) {\r
142         if (other == null || !(other instanceof BsTMethod)) { return false; }\r
143         final BsTMethod otherEntity = (BsTMethod)other;\r
144         if (!helpComparingValue(getObjectId(), otherEntity.getObjectId())) { return false; }\r
145         if (!helpComparingValue(getName(), otherEntity.getName())) { return false; }\r
146         if (!helpComparingValue(getScope(), otherEntity.getScope())) { return false; }\r
147         if (!helpComparingValue(getType(), otherEntity.getType())) { return false; }\r
148         return true;\r
149     }\r
150 \r
151     protected boolean helpComparingValue(Object value1, Object value2) {\r
152         if (value1 == null && value2 == null) { return true; }\r
153         return value1 != null && value2 != null && value1.equals(value2);\r
154     }\r
155 \r
156     /**\r
157      * Calculates hash-code from all columns.\r
158      * @return Hash-code from all-columns.\r
159      */\r
160     public int hashCode() {\r
161         int result = 17;\r
162         if (this.getObjectId() != null) { result = result + this.getObjectId().hashCode(); }\r
163         if (this.getName() != null) { result = result + this.getName().hashCode(); }\r
164         if (this.getScope() != null) { result = result + this.getScope().hashCode(); }\r
165         if (this.getType() != null) { result = result + this.getType().hashCode(); }\r
166         return result;\r
167     }\r
168 \r
169     /**\r
170      * @return The view string of columns. (NotNull)\r
171      */\r
172     public String toString() {\r
173         String delimiter = ",";\r
174         StringBuilder sb = new StringBuilder();\r
175         sb.append(delimiter).append(getObjectId());\r
176         sb.append(delimiter).append(getName());\r
177         sb.append(delimiter).append(getScope());\r
178         sb.append(delimiter).append(getType());\r
179         if (sb.length() > 0) { sb.delete(0, delimiter.length()); }\r
180         sb.insert(0, "{").append("}");\r
181         return sb.toString();\r
182     }\r
183 \r
184     // ===================================================================================\r
185     //                                                                            Accessor\r
186     //                                                                            ========\r
187     /**\r
188      * Object_ID: {UQ : INTEGER} <br />\r
189      * @return The value of the column 'Object_ID'. (Nullable)\r
190      */\r
191     public java.lang.Integer getObjectId() {\r
192         return _objectId;\r
193     }\r
194 \r
195     /**\r
196      * Object_ID: {UQ : INTEGER} <br />\r
197      * @param objectId The value of the column 'Object_ID'. (Nullable)\r
198      */\r
199     public void setObjectId(java.lang.Integer objectId) {\r
200         _modifiedProperties.addPropertyName("objectId");\r
201         this._objectId = objectId;\r
202     }\r
203 \r
204     /**\r
205      * Name: {UQ : VARCHAR(255)} <br />\r
206      * @return The value of the column 'Name'. (Nullable)\r
207      */\r
208     public String getName() {\r
209         return _name;\r
210     }\r
211 \r
212     /**\r
213      * Name: {UQ : VARCHAR(255)} <br />\r
214      * @param name The value of the column 'Name'. (Nullable)\r
215      */\r
216     public void setName(String name) {\r
217         _modifiedProperties.addPropertyName("name");\r
218         this._name = name;\r
219     }\r
220 \r
221     /**\r
222      * Scope: {VARCHAR(50)} <br />\r
223      * @return The value of the column 'Scope'. (Nullable)\r
224      */\r
225     public String getScope() {\r
226         return _scope;\r
227     }\r
228 \r
229     /**\r
230      * Scope: {VARCHAR(50)} <br />\r
231      * @param scope The value of the column 'Scope'. (Nullable)\r
232      */\r
233     public void setScope(String scope) {\r
234         _modifiedProperties.addPropertyName("scope");\r
235         this._scope = scope;\r
236     }\r
237 \r
238     /**\r
239      * Type: {VARCHAR(50)} <br />\r
240      * @return The value of the column 'Type'. (Nullable)\r
241      */\r
242     public String getType() {\r
243         return _type;\r
244     }\r
245 \r
246     /**\r
247      * Type: {VARCHAR(50)} <br />\r
248      * @param type The value of the column 'Type'. (Nullable)\r
249      */\r
250     public void setType(String type) {\r
251         _modifiedProperties.addPropertyName("type");\r
252         this._type = type;\r
253     }\r
254 }\r