X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ea2ddl-dao%2Fsrc%2Fmain%2Fjava%2Fjp%2Fsourceforge%2Fea2ddl%2Fdao%2Fbsbhv%2FBsTOperationtagBhv.java;h=9a58cc55e46e73d0d78a18d2ed4b478fb1e4b57d;hb=38e8f077bc96f58670463549b885e032cd20c4f0;hp=4e0a078a5fc2d5735ef5ee5002c57e15f2ac3b6d;hpb=385f8b8ea05f8c98bfbad39baa47c98d6b7c1a81;p=ea2ddl%2Fea2ddl.git diff --git a/ea2ddl-dao/src/main/java/jp/sourceforge/ea2ddl/dao/bsbhv/BsTOperationtagBhv.java b/ea2ddl-dao/src/main/java/jp/sourceforge/ea2ddl/dao/bsbhv/BsTOperationtagBhv.java index 4e0a078..9a58cc5 100644 --- a/ea2ddl-dao/src/main/java/jp/sourceforge/ea2ddl/dao/bsbhv/BsTOperationtagBhv.java +++ b/ea2ddl-dao/src/main/java/jp/sourceforge/ea2ddl/dao/bsbhv/BsTOperationtagBhv.java @@ -1,26 +1,25 @@ package jp.sourceforge.ea2ddl.dao.bsbhv; - import java.util.List; +import org.seasar.dbflute.*; +import org.seasar.dbflute.cbean.ConditionBean; +import org.seasar.dbflute.cbean.EntityRowHandler; +import org.seasar.dbflute.cbean.ListResultBean; +import org.seasar.dbflute.cbean.PagingBean; +import org.seasar.dbflute.cbean.PagingHandler; +import org.seasar.dbflute.cbean.PagingInvoker; +import org.seasar.dbflute.cbean.PagingResultBean; +import org.seasar.dbflute.cbean.ResultBeanBuilder; +import org.seasar.dbflute.dbmeta.DBMeta; +import org.seasar.dbflute.jdbc.StatementConfig; import jp.sourceforge.ea2ddl.dao.allcommon.*; -import jp.sourceforge.ea2ddl.dao.allcommon.bhv.setup.ValueLabelSetupper; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.ConditionBean; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.ListResultBean; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.ResultBeanBuilder; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingHandler; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingInvoker; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingBean; -import jp.sourceforge.ea2ddl.dao.allcommon.cbean.PagingResultBean; -import jp.sourceforge.ea2ddl.dao.allcommon.dbmeta.DBMeta; -import jp.sourceforge.ea2ddl.dao.exdao.*; import jp.sourceforge.ea2ddl.dao.exentity.*; import jp.sourceforge.ea2ddl.dao.bsentity.dbmeta.*; import jp.sourceforge.ea2ddl.dao.cbean.*; - /** - * The behavior of t_operationtag. + * The behavior of t_operationtag that the type is TABLE.
*
  * [primary-key]
  *     
@@ -51,7 +50,7 @@ import jp.sourceforge.ea2ddl.dao.cbean.*;
  * 
* @author DBFlute(AutoGenerator) */ -public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allcommon.bhv.AbstractBehaviorReadable { +public abstract class BsTOperationtagBhv extends org.seasar.dbflute.bhv.AbstractBehaviorReadable { // =================================================================================== // Definition @@ -60,11 +59,6 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco /*df:BehaviorQueryPathEnd*/ // =================================================================================== - // Attribute - // ========= - protected TOperationtagDao _dao; - - // =================================================================================== // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -73,20 +67,13 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco // =================================================================================== // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return TOperationtagDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public TOperationtagDbm getMyDBMeta() { return TOperationtagDbm.getInstance(); } // =================================================================================== - // Dao Accessor - // ============ - public TOperationtagDao getMyDao() { return _dao; } - public void setMyDao(TOperationtagDao dao) { assertObjectNotNull("dao", dao); _dao = dao; } - public DaoReadable getDaoReadable() { return getMyDao(); } - - // =================================================================================== // New Instance // ============ public Entity newEntity() { return newMyEntity(); } @@ -95,17 +82,47 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco public TOperationtagCB newMyConditionBean() { return new TOperationtagCB(); } // =================================================================================== + // Current DBDef + // ============= + @Override + protected DBDef getCurrentDBDef() { + return DBCurrent.getInstance().currentDBDef(); + } + + // =================================================================================== + // Default StatementConfig + // ======================= + @Override + protected StatementConfig getDefaultStatementConfig() { + return DBFluteConfig.getInstance().getDefaultStatementConfig(); + } + + // =================================================================================== // Count Select // ============ /** - * Select the count of the condition-bean. {IgnorePagingCondition} + * Select the count by the condition-bean. {IgnorePagingCondition} * @param cb The condition-bean of TOperationtag. (NotNull) * @return The selected count. */ public int selectCount(TOperationtagCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } + + // =================================================================================== + // Cursor Select + // ============= + /** + * Select the cursor by the condition-bean.
+ * Attention: It has a mapping cost from result set to entity. + * @param cb The condition-bean of TOperationtag. (NotNull) + * @param entityRowHandler The handler of entity row of TOperationtag. (NotNull) + */ + public void selectCursor(TOperationtagCB cb, EntityRowHandler entityRowHandler) { + assertCBNotNull(cb); assertObjectNotNull("entityRowHandler", entityRowHandler); + delegateSelectCursor(cb, entityRowHandler); + } // =================================================================================== // Entity Select @@ -114,7 +131,7 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco * Select the entity by the condition-bean. * @param cb The condition-bean of TOperationtag. (NotNull) * @return The selected entity. (Nullalble) - * @exception jp.sourceforge.ea2ddl.dao.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + * @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated. */ public TOperationtag selectEntity(final TOperationtagCB cb) { return helpSelectEntityInternally(cb, new InternalSelectEntityCallback() { @@ -125,8 +142,8 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco * Select the entity by the condition-bean with deleted check. * @param cb The condition-bean of TOperationtag. (NotNull) * @return The selected entity. (NotNull) - * @exception jp.sourceforge.ea2ddl.dao.allcommon.exception.EntityAlreadyDeletedException When the entity has already been deleted. - * @exception jp.sourceforge.ea2ddl.dao.allcommon.exception.EntityDuplicatedException When the entity has been duplicated. + * @exception org.seasar.dbflute.exception.EntityAlreadyDeletedException When the entity has already been deleted. + * @exception org.seasar.dbflute.exception.EntityDuplicatedException When the entity has been duplicated. */ public TOperationtag selectEntityWithDeletedCheck(final TOperationtagCB cb) { return helpSelectEntityWithDeletedCheckInternally(cb, new InternalSelectEntityWithDeletedCheckCallback() { @@ -143,7 +160,7 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco * @return The result bean of selected list. (NotNull) */ public ListResultBean selectList(TOperationtagCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder(getTableDbName()).buildListResultBean(cb, delegateSelectList(cb)); } @@ -156,7 +173,7 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco * @return The result bean of selected page. (NotNull) */ public PagingResultBean selectPage(final TOperationtagCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker invoker = new PagingInvoker(getTableDbName()); final PagingHandler handler = new PagingHandler() { public PagingBean getPagingBean() { return cb; } @@ -167,32 +184,46 @@ public abstract class BsTOperationtagBhv extends jp.sourceforge.ea2ddl.dao.allco } // =================================================================================== - // Various Select - // ============== + // Scalar Select + // ============= /** - * Select the list of value-label. - * @param cb The condition-bean of TOperationtag. (NotNull) - * @param valueLabelSetupper The setupper of value-label. (NotNull) - * @return The list of value-label. (NotNull) + * Select the scalar value derived by a function.
+ * Call a function method after this method called like as follows: + *
+     * tOperationtagBhv.scalarSelect(Date.class).max(new ScalarQuery(TOperationtagCB cb) {
+     *     cb.specify().columnXxxDatetime(); // the required specification of target column
+     *     cb.query().setXxxName_PrefixSearch("S"); // query as you like it
+     * });
+     * 
+ * @param The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) */ - public List> selectValueLabelList(TOperationtagCB cb, ValueLabelSetupper valueLabelSetupper) { - return createValueLabelList(selectList(cb), valueLabelSetupper); + public SLFunction scalarSelect(Class resultType) { + TOperationtagCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + cb.getSqlClause().disableSelectIndex(); // for when you use union + return new SLFunction(cb, resultType); } - - - // =================================================================================== - // Pullout Foreign - // =============== - + // Pull out Foreign + // ================ + // =================================================================================== // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ - protected int delegateSelectCount(TOperationtagCB cb) { assertConditionBeanNotNull(cb); return getMyDao().selectCount(cb); } - protected List delegateSelectList(TOperationtagCB cb) { assertConditionBeanNotNull(cb); return getMyDao().selectList(cb); } + protected int delegateSelectCount(TOperationtagCB cb) { return invoke(createSelectCountCBCommand(cb)); } + protected void delegateSelectCursor(TOperationtagCB cb, EntityRowHandler entityRowHandler) + { invoke(createSelectCursorCBCommand(cb, entityRowHandler, TOperationtag.class)); } + protected int doCallReadCount(ConditionBean cb) { return delegateSelectCount((TOperationtagCB)cb); } + protected List delegateSelectList(TOperationtagCB cb) + { return invoke(createSelectListCBCommand(cb, TOperationtag.class)); } + @SuppressWarnings("unchecked") + protected List doCallReadList(ConditionBean cb) { return (List)delegateSelectList((TOperationtagCB)cb); } // =================================================================================== // Optimistic Lock Info