OSDN Git Service

EAからOracle用DDLが吐けるようになった
[ea2ddl/ea2ddl.git] / ea2ddl-dao / src / main / java / jp / sourceforge / ea2ddl / dao / bsbhv / BsTOperationBhv.java
1 package jp.sourceforge.ea2ddl.dao.bsbhv;\r
2 \r
3 \r
4 import java.util.List;\r
5 \r
6 import jp.sourceforge.ea2ddl.dao.allcommon.*;\r
7 import jp.sourceforge.ea2ddl.dao.allcommon.bhv.setup.ValueLabelSetupper;\r
8 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.ConditionBean;\r
9 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.ListResultBean;\r
10 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.ResultBeanBuilder;\r
11 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingHandler;\r
12 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingInvoker;\r
13 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingBean;\r
14 import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingResultBean;\r
15 import jp.sourceforge.ea2ddl.dao.allcommon.dbmeta.DBMeta;\r
16 import jp.sourceforge.ea2ddl.dao.exdao.*;\r
17 import jp.sourceforge.ea2ddl.dao.exentity.*;\r
18 import jp.sourceforge.ea2ddl.dao.bsentity.dbmeta.*;\r
19 import jp.sourceforge.ea2ddl.dao.cbean.*;\r
20 \r
21 \r
22 /**\r
23  * The behavior of t_operation.\r
24  * <pre>\r
25  * [primary-key]\r
26  *     \r
27  * \r
28  * [column]\r
29  *     OperationID, Object_ID, Name, Scope, Type, ReturnArray, Stereotype, IsStatic, Concurrency, Notes, Behaviour, GenOption, Pos, Style, Pure, Classifier, Code, IsRoot, IsLeaf, IsQuery, StateFlags, ea_guid, StyleEx\r
30  * \r
31  * [sequence]\r
32  *     \r
33  * \r
34  * [identity]\r
35  *     \r
36  * \r
37  * [version-no]\r
38  *     \r
39  * \r
40  * [foreign-table]\r
41  *     t_object\r
42  * \r
43  * [referrer-table]\r
44  *     \r
45  * \r
46  * [foreign-property]\r
47  *     tObject\r
48  * \r
49  * [referrer-property]\r
50  *     \r
51  * </pre>\r
52  * @author DBFlute(AutoGenerator)\r
53  */\r
54 public abstract class BsTOperationBhv extends jp.sourceforge.ea2ddl.dao.allcommon.bhv.AbstractBehaviorReadable {\r
55 \r
56     // ===================================================================================\r
57     //                                                                          Definition\r
58     //                                                                          ==========\r
59     /*df:BehaviorQueryPathBegin*/\r
60     /*df:BehaviorQueryPathEnd*/\r
61 \r
62     // ===================================================================================\r
63     //                                                                           Attribute\r
64     //                                                                           =========\r
65     protected TOperationDao _dao;\r
66 \r
67     // ===================================================================================\r
68     //                                                                          Table name\r
69     //                                                                          ==========\r
70     /** @return The name on database of table. (NotNull) */\r
71     public String getTableDbName() { return "t_operation"; }\r
72 \r
73     // ===================================================================================\r
74     //                                                                              DBMeta\r
75     //                                                                              ======\r
76     /** @return The meta data of the database. (NotNull) */\r
77     public DBMeta getDBMeta() { return TOperationDbm.getInstance(); }\r
78 \r
79     /** @return The meta data of the database as my table type. (NotNull) */\r
80     public TOperationDbm getMyDBMeta() { return TOperationDbm.getInstance(); }\r
81 \r
82     // ===================================================================================\r
83     //                                                                        Dao Accessor\r
84     //                                                                        ============\r
85     public TOperationDao getMyDao() { return _dao; }\r
86     public void setMyDao(TOperationDao dao) { assertObjectNotNull("dao", dao); _dao = dao; }\r
87     public DaoReadable getDaoReadable() { return getMyDao(); }\r
88 \r
89     // ===================================================================================\r
90     //                                                                        New Instance\r
91     //                                                                        ============\r
92     public Entity newEntity() { return newMyEntity(); }\r
93     public ConditionBean newConditionBean() { return newMyConditionBean(); }\r
94     public TOperation newMyEntity() { return new TOperation(); }\r
95     public TOperationCB newMyConditionBean() { return new TOperationCB(); }\r
96 \r
97     // ===================================================================================\r
98     //                                                                        Count Select\r
99     //                                                                        ============\r
100     /**\r
101      * Select the count of the condition-bean. {IgnorePagingCondition}\r
102      * @param cb The condition-bean of TOperation. (NotNull)\r
103      * @return The selected count.\r
104      */\r
105     public int selectCount(TOperationCB cb) {\r
106         assertConditionBeanNotNull(cb);\r
107         return delegateSelectCount(cb);\r
108     }\r
109 \r
110     // ===================================================================================\r
111     //                                                                       Entity Select\r
112     //                                                                       =============\r
113     /**\r
114      * Select the entity by the condition-bean.\r
115      * @param cb The condition-bean of TOperation. (NotNull)\r
116      * @return The selected entity. (Nullalble)\r
117      * @exception jp.sourceforge.ea2ddl.dao.allcommon.exception.EntityDuplicatedException When the entity has been duplicated.\r
118      */\r
119     public TOperation selectEntity(final TOperationCB cb) {\r
120         return helpSelectEntityInternally(cb, new InternalSelectEntityCallback<TOperation, TOperationCB>() {\r
121             public List<TOperation> callbackSelectList(TOperationCB cb) { return selectList(cb); } });\r
122     }\r
123 \r
124     /**\r
125      * Select the entity by the condition-bean with deleted check.\r
126      * @param cb The condition-bean of TOperation. (NotNull)\r
127      * @return The selected entity. (NotNull)\r
128      * @exception jp.sourceforge.ea2ddl.dao.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted.\r
129      * @exception jp.sourceforge.ea2ddl.dao.allcommon.exception.EntityDuplicatedException When the entity has been duplicated.\r
130      */\r
131     public TOperation selectEntityWithDeletedCheck(final TOperationCB cb) {\r
132         return helpSelectEntityWithDeletedCheckInternally(cb, new InternalSelectEntityWithDeletedCheckCallback<TOperation, TOperationCB>() {\r
133             public List<TOperation> callbackSelectList(TOperationCB cb) { return selectList(cb); } });\r
134     }\r
135 \r
136 \r
137     // ===================================================================================\r
138     //                                                                         List Select\r
139     //                                                                         ===========\r
140     /**\r
141      * Select the list as result bean.\r
142      * @param cb The condition-bean of TOperation. (NotNull)\r
143      * @return The result bean of selected list. (NotNull)\r
144      */\r
145     public ListResultBean<TOperation> selectList(TOperationCB cb) {\r
146         assertConditionBeanNotNull(cb);\r
147         return new ResultBeanBuilder<TOperation>(getTableDbName()).buildListResultBean(cb, delegateSelectList(cb));\r
148     }\r
149 \r
150     // ===================================================================================\r
151     //                                                                         Page Select\r
152     //                                                                         ===========\r
153     /**\r
154      * Select the page as result bean.\r
155      * @param cb The condition-bean of TOperation. (NotNull)\r
156      * @return The result bean of selected page. (NotNull)\r
157      */\r
158     public PagingResultBean<TOperation> selectPage(final TOperationCB cb) {\r
159         assertConditionBeanNotNull(cb);\r
160         final PagingInvoker<TOperation> invoker = new PagingInvoker<TOperation>(getTableDbName());\r
161         final PagingHandler<TOperation> handler = new PagingHandler<TOperation>() {\r
162             public PagingBean getPagingBean() { return cb; }\r
163             public int count() { return selectCount(cb); }\r
164             public List<TOperation> paging() { return selectList(cb); }\r
165         };\r
166         return invoker.invokePaging(handler);\r
167     }\r
168 \r
169     // ===================================================================================\r
170     //                                                                      Various Select\r
171     //                                                                      ==============\r
172     /**\r
173      * Select the list of value-label.\r
174      * @param cb The condition-bean of TOperation. (NotNull)\r
175      * @param valueLabelSetupper The setupper of value-label. (NotNull)\r
176      * @return The list of value-label. (NotNull)\r
177      */\r
178     public List<java.util.Map<String, Object>> selectValueLabelList(TOperationCB cb, ValueLabelSetupper<TOperation> valueLabelSetupper) {\r
179         return createValueLabelList(selectList(cb), valueLabelSetupper);\r
180     }\r
181 \r
182 \r
183 \r
184     // ===================================================================================\r
185     //                                                                     Pullout Foreign\r
186     //                                                                     ===============\r
187     /**\r
188      * Pull out the list of foreign table 'TObject'.\r
189      * @param tOperationList The list of tOperation. (NotNull)\r
190      * @return The list of foreign table. (NotNull)\r
191      */\r
192     public List<TObject> pulloutTObject(List<TOperation> tOperationList) {\r
193         return helpPulloutInternally(tOperationList, new InternalPulloutCallback<TOperation, TObject>() {\r
194             public TObject callbackGetForeignEntity(TOperation entity) { return entity.getTObject(); } });\r
195     }\r
196   \r
197     // ===================================================================================\r
198     //                                                                     Delegate Method\r
199     //                                                                     ===============\r
200     // -----------------------------------------------------\r
201     //                                                Select\r
202     //                                                ------\r
203     protected int delegateSelectCount(TOperationCB cb) { assertConditionBeanNotNull(cb); return getMyDao().selectCount(cb); }\r
204     protected List<TOperation> delegateSelectList(TOperationCB cb) { assertConditionBeanNotNull(cb); return getMyDao().selectList(cb); }\r
205 \r
206     // ===================================================================================\r
207     //                                                                Optimistic Lock Info\r
208     //                                                                ====================\r
209     @Override\r
210     protected boolean hasVersionNoValue(Entity entity) {\r
211         return false;\r
212     }\r
213 \r
214     @Override\r
215     protected boolean hasUpdateDateValue(Entity entity) {\r
216         return false;\r
217     }\r
218 \r
219     // ===================================================================================\r
220     //                                                                              Helper\r
221     //                                                                              ======\r
222     protected TOperation downcast(Entity entity) {\r
223         return helpDowncastInternally(entity, TOperation.class);\r
224     }\r
225 }\r