OSDN Git Service

DBFlute-0.9.3に更新
[ea2ddl/ea2ddl.git] / ea2ddl-dao / src / main / java / jp / sourceforge / ea2ddl / dao / cbean / cq / bs / BsTObjectpropertiesCQ.java
1 package jp.sourceforge.ea2ddl.dao.cbean.cq.bs;\r
2 \r
3 import java.util.Map;\r
4 \r
5 import org.seasar.dbflute.cbean.*;\r
6 import org.seasar.dbflute.cbean.cvalue.ConditionValue;\r
7 import org.seasar.dbflute.cbean.sqlclause.SqlClause;\r
8 import jp.sourceforge.ea2ddl.dao.cbean.cq.ciq.*;\r
9 import jp.sourceforge.ea2ddl.dao.cbean.*;\r
10 import jp.sourceforge.ea2ddl.dao.cbean.cq.*;\r
11 \r
12 /**\r
13  * The base condition-query of t_objectproperties.\r
14  * @author DBFlute(AutoGenerator)\r
15  */\r
16 public class BsTObjectpropertiesCQ extends AbstractBsTObjectpropertiesCQ {\r
17 \r
18     // ===================================================================================\r
19     //                                                                           Attribute\r
20     //                                                                           =========\r
21     protected TObjectpropertiesCIQ _inlineQuery;\r
22 \r
23     // ===================================================================================\r
24     //                                                                         Constructor\r
25     //                                                                         ===========\r
26     public BsTObjectpropertiesCQ(ConditionQuery childQuery, SqlClause sqlClause, String aliasName, int nestLevel) {\r
27         super(childQuery, sqlClause, aliasName, nestLevel);\r
28     }\r
29 \r
30     // ===================================================================================\r
31     //                                                                              Inline\r
32     //                                                                              ======\r
33     /**\r
34      * Prepare inline query. <br />\r
35      * {select ... from ... left outer join (select * from t_objectproperties) where abc = [abc] ...}\r
36      * @return Inline query. (NotNull)\r
37      */\r
38     public TObjectpropertiesCIQ inline() {\r
39         if (_inlineQuery == null) {\r
40             _inlineQuery = new TObjectpropertiesCIQ(getChildQuery(), getSqlClause(), getAliasName(), getNestLevel(), this);\r
41         }\r
42         _inlineQuery.xsetOnClauseInline(false); return _inlineQuery;\r
43     }\r
44     \r
45     /**\r
46      * Prepare on-clause query. <br />\r
47      * {select ... from ... left outer join t_objectproperties on ... and abc = [abc] ...}\r
48      * @return On-clause query. (NotNull)\r
49      */\r
50     public TObjectpropertiesCIQ on() {\r
51         if (isBaseQuery(this)) { throw new UnsupportedOperationException("Unsupported on-clause for local table!"); }\r
52         TObjectpropertiesCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); return inlineQuery;\r
53     }\r
54 \r
55     // ===================================================================================\r
56     //                                                                               Query\r
57     //                                                                               =====\r
58 \r
59     protected ConditionValue _propertyid;\r
60     public ConditionValue getPropertyid() {\r
61         if (_propertyid == null) { _propertyid = new ConditionValue(); }\r
62         return _propertyid;\r
63     }\r
64     protected ConditionValue getCValuePropertyid() { return getPropertyid(); }\r
65 \r
66     public BsTObjectpropertiesCQ addOrderBy_Propertyid_Asc() { regOBA("PropertyID"); return this; }\r
67     public BsTObjectpropertiesCQ addOrderBy_Propertyid_Desc() { regOBD("PropertyID"); return this; }\r
68 \r
69     protected ConditionValue _objectId;\r
70     public ConditionValue getObjectId() {\r
71         if (_objectId == null) { _objectId = new ConditionValue(); }\r
72         return _objectId;\r
73     }\r
74     protected ConditionValue getCValueObjectId() { return getObjectId(); }\r
75 \r
76     protected Map<String, TObjectCQ> _objectId_InScopeSubQuery_TObjectMap;\r
77     public Map<String, TObjectCQ> getObjectId_InScopeSubQuery_TObject() { return _objectId_InScopeSubQuery_TObjectMap; }\r
78     public String keepObjectId_InScopeSubQuery_TObject(TObjectCQ subQuery) {\r
79         if (_objectId_InScopeSubQuery_TObjectMap == null) { _objectId_InScopeSubQuery_TObjectMap = newLinkedHashMap(); }\r
80         String key = "subQueryMapKey" + (_objectId_InScopeSubQuery_TObjectMap.size() + 1);\r
81         _objectId_InScopeSubQuery_TObjectMap.put(key, subQuery); return "objectId_InScopeSubQuery_TObject." + key;\r
82     }\r
83       \r
84     public BsTObjectpropertiesCQ addOrderBy_ObjectId_Asc() { regOBA("Object_ID"); return this; }\r
85     public BsTObjectpropertiesCQ addOrderBy_ObjectId_Desc() { regOBD("Object_ID"); return this; }\r
86 \r
87     protected ConditionValue _property;\r
88     public ConditionValue getProperty() {\r
89         if (_property == null) { _property = new ConditionValue(); }\r
90         return _property;\r
91     }\r
92     protected ConditionValue getCValueProperty() { return getProperty(); }\r
93 \r
94     public BsTObjectpropertiesCQ addOrderBy_Property_Asc() { regOBA("Property"); return this; }\r
95     public BsTObjectpropertiesCQ addOrderBy_Property_Desc() { regOBD("Property"); return this; }\r
96 \r
97     protected ConditionValue _value;\r
98     public ConditionValue getValue() {\r
99         if (_value == null) { _value = new ConditionValue(); }\r
100         return _value;\r
101     }\r
102     protected ConditionValue getCValueValue() { return getValue(); }\r
103 \r
104     public BsTObjectpropertiesCQ addOrderBy_Value_Asc() { regOBA("Value"); return this; }\r
105     public BsTObjectpropertiesCQ addOrderBy_Value_Desc() { regOBD("Value"); return this; }\r
106 \r
107     protected ConditionValue _notes;\r
108     public ConditionValue getNotes() {\r
109         if (_notes == null) { _notes = new ConditionValue(); }\r
110         return _notes;\r
111     }\r
112     protected ConditionValue getCValueNotes() { return getNotes(); }\r
113 \r
114     public BsTObjectpropertiesCQ addOrderBy_Notes_Asc() { regOBA("Notes"); return this; }\r
115     public BsTObjectpropertiesCQ addOrderBy_Notes_Desc() { regOBD("Notes"); return this; }\r
116 \r
117     protected ConditionValue _eaGuid;\r
118     public ConditionValue getEaGuid() {\r
119         if (_eaGuid == null) { _eaGuid = new ConditionValue(); }\r
120         return _eaGuid;\r
121     }\r
122     protected ConditionValue getCValueEaGuid() { return getEaGuid(); }\r
123 \r
124     public BsTObjectpropertiesCQ addOrderBy_EaGuid_Asc() { regOBA("ea_guid"); return this; }\r
125     public BsTObjectpropertiesCQ addOrderBy_EaGuid_Desc() { regOBD("ea_guid"); return this; }\r
126 \r
127     // ===================================================================================\r
128     //                                                           Specified Derived OrderBy\r
129     //                                                           =========================\r
130     public BsTObjectpropertiesCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { registerSpecifiedDerivedOrderBy_Asc(aliasName); return this; }\r
131     public BsTObjectpropertiesCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { registerSpecifiedDerivedOrderBy_Desc(aliasName); return this; }\r
132 \r
133     // ===================================================================================\r
134     //                                                                         Union Query\r
135     //                                                                         ===========\r
136     protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper) {\r
137         TObjectpropertiesCQ baseQuery = (TObjectpropertiesCQ)baseQueryAsSuper;\r
138         TObjectpropertiesCQ unionQuery = (TObjectpropertiesCQ)unionQueryAsSuper;\r
139         if (baseQuery.hasConditionQueryTObject()) {\r
140             unionQuery.queryTObject().reflectRelationOnUnionQuery(baseQuery.queryTObject(), unionQuery.queryTObject());\r
141         }\r
142     }\r
143 \r
144     // ===================================================================================\r
145     //                                                                       Foreign Query\r
146     //                                                                       =============\r
147     public TObjectCQ queryTObject() {\r
148         return getConditionQueryTObject();\r
149     }\r
150     protected TObjectCQ _conditionQueryTObject;\r
151     public TObjectCQ getConditionQueryTObject() {\r
152         if (_conditionQueryTObject == null) {\r
153             _conditionQueryTObject = xcreateQueryTObject();\r
154             xsetupOuterJoinTObject();\r
155         }\r
156         return _conditionQueryTObject;\r
157     }\r
158     protected TObjectCQ xcreateQueryTObject() {\r
159         String nrp = resolveNextRelationPath("t_objectproperties", "tObject");\r
160         String jan = resolveJoinAliasName(nrp, getNextNestLevel());\r
161         TObjectCQ cq = new TObjectCQ(this, getSqlClause(), jan, getNextNestLevel());\r
162         cq.xsetForeignPropertyName("tObject"); cq.xsetRelationPath(nrp); return cq;\r
163     }\r
164     protected void xsetupOuterJoinTObject() {\r
165         TObjectCQ cq = getConditionQueryTObject();\r
166         Map<String, String> joinOnMap = newLinkedHashMap();\r
167         joinOnMap.put(getRealColumnName("Object_ID"), cq.getRealColumnName("Object_ID"));\r
168         registerOuterJoin(cq, joinOnMap);\r
169     }\r
170     public boolean hasConditionQueryTObject() {\r
171         return _conditionQueryTObject != null;\r
172     }\r
173 \r
174     // ===================================================================================\r
175     //                                                                       Very Internal\r
176     //                                                                       =============\r
177     // Very Internal (for Suppressing Warn about 'Not Use Import')\r
178     String xCB() { return TObjectpropertiesCB.class.getName(); }\r
179     String xCQ() { return TObjectpropertiesCQ.class.getName(); }\r
180     String xMap() { return Map.class.getName(); }\r
181 }\r