svnno****@sourc*****
svnno****@sourc*****
2008年 12月 28日 (日) 07:20:25 JST
Revision: 1631 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1631 Author: shinsuke Date: 2008-12-28 07:20:25 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- timecard/trunk/dbflute/_project.bat timecard/trunk/dbflute/_project.sh timecard/trunk/dbflute/build-timecard.properties timecard/trunk/mydbflute/README.txt timecard/trunk/src/main/config/erd/timecard.erd timecard/trunk/src/main/config/sql/timecard.ddl timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java timecard/trunk/src/main/resources/dbflute.dicon timecard/trunk/src/main/webapp/WEB-INF/db/timecard.1.log.db timecard/trunk/src/main/webapp/WEB-INF/db/timecard.data.db Added Paths: ----------- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsdao/ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/exdao/ -------------- next part -------------- Modified: timecard/trunk/dbflute/_project.bat =================================================================== --- timecard/trunk/dbflute/_project.bat 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/dbflute/_project.bat 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=timecard -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: timecard/trunk/dbflute/_project.sh =================================================================== --- timecard/trunk/dbflute/_project.sh 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/dbflute/_project.sh 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=timecard -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: timecard/trunk/dbflute/build-timecard.properties =================================================================== --- timecard/trunk/dbflute/build-timecard.properties 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/dbflute/build-timecard.properties 2008-12-27 22:20:25 UTC (rev 1631) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: timecard/trunk/mydbflute/README.txt =================================================================== --- timecard/trunk/mydbflute/README.txt 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/mydbflute/README.txt 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,3 +1,3 @@ -$ mkdir dbflute-0.8.2 -$ cd dbflute-0.8.2 -$ unzip ../dbflute-0.8.2.zip +$ mkdir dbflute-0.8.7 +$ cd dbflute-0.8.7 +$ unzip ../dbflute-0.8.7.zip Modified: timecard/trunk/src/main/config/erd/timecard.erd =================================================================== --- timecard/trunk/src/main/config/erd/timecard.erd 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/config/erd/timecard.erd 2008-12-27 22:20:25 UTC (rev 1631) @@ -237,6 +237,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>319</x> <y>484</y> @@ -403,6 +408,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>331</x> <y>909</y> @@ -622,6 +632,22 @@ <defaultValue></defaultValue> </net.java.amateras.db.visual.model.ColumnModel> <net.java.amateras.db.visual.model.ColumnModel> + <columnName>status</columnName> + <logicalName>Status</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>1</size> + <notNull>false</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel> <columnName>created_time</columnName> <logicalName>Created Time</logicalName> <columnType class="net.java.amateras.db.dialect.ColumnType"> @@ -651,7 +677,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>updated_time</columnName> <logicalName>Updated Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -673,7 +699,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>deleted_time</columnName> <logicalName>Deleted Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>false</notNull> <primaryKey>false</primaryKey> @@ -710,6 +736,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>315</x> <y>1220</y> @@ -802,7 +833,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>created_time</columnName> <logicalName>Created Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -824,7 +855,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>updated_time</columnName> <logicalName>Updated Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -846,7 +877,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>deleted_time</columnName> <logicalName>Deleted Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>false</notNull> <primaryKey>false</primaryKey> @@ -868,7 +899,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>versionNo</columnName> <logicalName>Version No.</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[22]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[23]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -878,6 +909,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>66</x> <y>1740</y> @@ -947,6 +983,11 @@ <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>70</x> <y>909</y> @@ -1104,7 +1145,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>created_time</columnName> <logicalName>Created Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -1126,7 +1167,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>updated_time</columnName> <logicalName>Updated Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -1148,7 +1189,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>deleted_time</columnName> <logicalName>Deleted Time</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[16]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[17]/columnType"/> <size>10</size> <notNull>false</notNull> <primaryKey>false</primaryKey> @@ -1170,7 +1211,7 @@ <net.java.amateras.db.visual.model.ColumnModel> <columnName>versionNo</columnName> <logicalName>Version No.</logicalName> - <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[22]/columnType"/> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[23]/columnType"/> <size>10</size> <notNull>true</notNull> <primaryKey>false</primaryKey> @@ -1180,6 +1221,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>594</x> <y>1740</y> @@ -1244,6 +1290,11 @@ <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>602</x> <y>909</y> @@ -1629,6 +1680,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>331</x> <y>40</y> @@ -1736,6 +1792,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>40</x> <y>40</y> @@ -1908,6 +1969,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>51</x> <y>484</y> Modified: timecard/trunk/src/main/config/sql/timecard.ddl =================================================================== --- timecard/trunk/src/main/config/sql/timecard.ddl 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/config/sql/timecard.ddl 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,9 +9,9 @@ DROP TABLE role_info; DROP TABLE group_info; -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -28,9 +28,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: Role Information -**********************************/ +/**********************************/ +/* Table Name: Role Information */ +/**********************************/ CREATE TABLE role_info( role_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -47,9 +47,9 @@ versionNo INTEGER NOT NULL ); -/********************************** -Table Name: User Information -**********************************/ +/**********************************/ +/* Table Name: User Information */ +/**********************************/ CREATE TABLE user_info( user_id VARCHAR(255) NOT NULL PRIMARY KEY, given_name VARCHAR(100), @@ -66,6 +66,7 @@ locale VARCHAR(5), role_id VARCHAR(255), group_id VARCHAR(255), + status VARCHAR(1), created_time TIMESTAMP NOT NULL, created_by VARCHAR(255) NOT NULL, updated_time TIMESTAMP NOT NULL, @@ -77,9 +78,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Employee -**********************************/ +/**********************************/ +/* Table Name: Employee */ +/**********************************/ CREATE TABLE employee( id INTEGER NOT NULL IDENTITY PRIMARY KEY, username VARCHAR(255) NOT NULL, @@ -96,9 +97,9 @@ FOREIGN KEY (manager) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Monthly Report -**********************************/ +/**********************************/ +/* Table Name: Monthly Report */ +/**********************************/ CREATE TABLE monthly_report( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, year INTEGER NOT NULL, @@ -120,9 +121,9 @@ FOREIGN KEY (employee_id) REFERENCES employee (id) ); -/********************************** -Table Name: Daily Report -**********************************/ +/**********************************/ +/* Table Name: Daily Report */ +/**********************************/ CREATE TABLE daily_report( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, date INTEGER NOT NULL, @@ -145,9 +146,9 @@ FOREIGN KEY (monthly_report_id) REFERENCES monthly_report (id) ); -/********************************** -Table Name: Group Mapping -**********************************/ +/**********************************/ +/* Table Name: Group Mapping */ +/**********************************/ CREATE TABLE group_mapping( id INTEGER NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -156,9 +157,9 @@ FOREIGN KEY (group_id) REFERENCES group_info (group_id) ); -/********************************** -Table Name: Role Mapping -**********************************/ +/**********************************/ +/* Table Name: Role Mapping */ +/**********************************/ CREATE TABLE role_mapping( id INT NOT NULL IDENTITY PRIMARY KEY, user_id VARCHAR(255) NOT NULL, @@ -167,9 +168,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Working Type -**********************************/ +/**********************************/ +/* Table Name: Working Type */ +/**********************************/ CREATE TABLE working_type( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -185,9 +186,9 @@ versionNo INTEGER DEFAULT 0 NOT NULL ); -/********************************** -Table Name: Monthly Working Report -**********************************/ +/**********************************/ +/* Table Name: Monthly Working Report */ +/**********************************/ CREATE TABLE monthly_working_report( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, value DOUBLE NOT NULL, Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/BehaviorSelector.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,8 +10,7 @@ public interface BehaviorSelector { /** - * Initialize condition-bean meta data. <br /> If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data. <br /> */ public void initializeConditionBeanMetaData(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,8 +1,8 @@ package jp.sf.pal.timecard.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.timecard.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; @@ -31,15 +31,14 @@ // Attribute // ========= /** The cache of behavior. (It's the generic hell!) */ - protected Map<Class<? extends BehaviorReadable>, BehaviorReadable> _behaviorCache = new LinkedHashMap<Class<? extends BehaviorReadable>, BehaviorReadable>(); + protected Map<Class<? extends BehaviorReadable>, BehaviorReadable> _behaviorCache = new ConcurrentHashMap<Class<? extends BehaviorReadable>, BehaviorReadable>(); //========================================================================== // ========= // Initialize // ========== /** - * Initialize condition-bean meta data. <br /> If you call this, Hot Deploy - * of OutsideSql becomes Cool! + * Initialize condition-bean meta data. <br /> */ public void initializeConditionBeanMetaData() { final Map<String, DBMeta> dbmetaMap = DBMetaInstanceHandler @@ -53,8 +52,7 @@ } for (DBMeta dbmeta : dbmetas) { final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); - final DaoReadable dao = bhv.getDaoReadable(); - dao.initializeDaoMetaData("selectList"); + bhv.warmUpCommand(); } if (_log.isInfoEnabled()) { long after = System.currentTimeMillis(); Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon; + +/** + * The auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface CommonColumnAutoSetupper { + + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity); + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,31 @@ +package jp.sf.pal.timecard.db.allcommon; + +/** + * The basic implementation of the auto set-upper of common column. + * + * @author DBFlute(AutoGenerator) + */ +public class CommonColumnBasicAutoSetupper implements CommonColumnAutoSetupper { + + //========================================================================== + // =========== + // Set up + // ====== + /** + * Handle common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Handle common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + public void handleCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,179 @@ +package jp.sf.pal.timecard.db.allcommon; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +/** + * The definition of database. + * + * @author DBFlute(AutoGenerator) + */ +public enum DBDef { + + //========================================================================== + // ========= + // ENUM + // ==== + MySQL("mysql", null), PostgreSQL("postgresql", "postgre"), Oracle("oracle", + null), DB2("db2", null), SQLServer("sqlserver", "mssql"), FireBird( + "firebird", null), H2("h2", null), Derby("derby", null), MSAccess( + "msaccess", null), Unknown("unknown", null); + + //========================================================================== + // ========= + // Static Reference + // ================ + // ----------------------------------------------------- + // Code Value + // ---------- + private static final Map<String, DBDef> _codeValueMap = new HashMap<String, DBDef>(); + static { + for (DBDef value : values()) { + _codeValueMap.put(value.code().toLowerCase(), value); + } + } + + private static final Map<String, DBDef> _codeAliasValueMap = new HashMap<String, DBDef>(); + static { + for (DBDef value : values()) { + if (value.codeAlias() != null) { + _codeAliasValueMap.put(value.codeAlias().toLowerCase(), value); + } + } + } + + /** + * @param code The code of the DB. (Nullable: If the code is null, it + * returns null) + * @return The instance that has the code. (Nullable) + */ + public static DBDef codeOf(String code) { + if (code == null) { + return null; + } + final String lowerCaseCode = code.toLowerCase(); + DBDef def = _codeValueMap.get(lowerCaseCode); + if (def == null) { + def = _codeAliasValueMap.get(lowerCaseCode); + } + return def; + } + + // ----------------------------------------------------- + // Driver Hint + // ----------- + private static final Map<String, DBDef> _driverHintMap; + static { + final Map<String, DBDef> tmpMap = new HashMap<String, DBDef>(); + tmpMap.put("mysql", MySQL); + tmpMap.put("postgresql", PostgreSQL); + tmpMap.put("oracle", Oracle); + tmpMap.put("db2", DB2); + tmpMap.put("sqlserver", SQLServer); + tmpMap.put("firebird", FireBird); + tmpMap.put("org.h2", H2); + tmpMap.put("org.apache.derby", Derby); + _driverHintMap = Collections.unmodifiableMap(tmpMap); + } + + public static DBDef byDriverClassName(String driverClassName) { + final Set<String> keySet = _driverHintMap.keySet(); + for (final Iterator<String> ite = keySet.iterator(); ite.hasNext();) { + final String driverHint = ite.next(); + if (driverClassName.indexOf(driverHint) >= 0) { + final DBDef dbdef = _driverHintMap.get(driverHint); + if (dbdef != null) { + return dbdef; + } + } + } + return null; + } + + //========================================================================== + // ========= + // Current Definition + // ================== + /** The current definition of database. (NotNull, Default 'Unknown') */ + private static DBDef _currentDef; + static { + _currentDef = codeOf("H2"); + if (_currentDef == null) { + _currentDef = Unknown; + } + } + + /** + * @return The current definition of database. (NotNull) + */ + public static DBDef getCurrentDef() { + return _currentDef; + } + + /** + * @param currentDef The current definition of database. (NotNull) + */ + public static void setCurrentDef(DBDef currentDef) { + if (currentDef == null) { + String msg = "The argument 'currentDef' should not be null****@DBDef*****()"; + throw new IllegalArgumentException(msg); + } + _currentDef = currentDef; + } + + /** + * @param dbdef The definition of database. (NotNull) + * @return Is the definition of database current? + */ + public static boolean isCurrentDef(DBDef dbdef) { + if (dbdef == null) { + String msg = "The argument 'dbdef' should not be null****@DBDef*****()"; + throw new IllegalArgumentException(msg); + } + return _currentDef != null ? _currentDef.equals(dbdef) : false; + } + + //========================================================================== + // ========= + // Attribute + // ========= + /** The code of the DB. (NotNull) */ + private String _code; + + /** The code alias of the DB. (Nullable) */ + private String _codeAlias; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param code The code of the DB. (NotNull) + * @param codeAlias The code alias of the DB. (Nullable) + */ + private DBDef(String code, String codeAlias) { + _code = code; + _codeAlias = codeAlias; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * @return The code of the DB. (NotNull) + */ + public String code() { + return _code; + } + + /** + * @return The code alias of the DB. (Nullable) + */ + private String codeAlias() { + return _codeAlias; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/DBFluteConfig.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -24,10 +24,6 @@ // ========= protected StatementConfig _defaultStatementConfig; - protected boolean _conditionBeanFormatSql = true;// This is for - - // compatibility! - protected boolean _queryLogLevelInfo; protected boolean _executeStatusLogLevelInfo; @@ -36,10 +32,6 @@ protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; - protected boolean _sqlExceptionOldStyleHandling = false;// This is for - - // compatibility! - protected String _logDateFormat; protected String _logTimestampFormat; @@ -92,27 +84,6 @@ //========================================================================== // ========= - // ConditionBean Format Sql - // ======================== - public boolean isConditionBeanFormatSql() { - return _conditionBeanFormatSql; - } - - /** - * @param conditionBeanFormatSql The value of the config. - * @deprecated This is for compatibility! - */ - public void setConditionBeanFormatSql(boolean conditionBeanFormatSql) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting conditionBeanFormatSql: " - + conditionBeanFormatSql); - } - _conditionBeanFormatSql = conditionBeanFormatSql; - } - - //========================================================================== - // ========= // Query Log Level Info // ==================== public boolean isQueryLogLevelInfo() { @@ -184,31 +155,8 @@ public boolean isUniqueConstraintException(Throwable t); } - // [DBFlute-0.7.7] //========================================================================== // ========= - // SQL Exception Old Style - // ======================= - public boolean isSqlExceptionOldStyleHandling() { - return _sqlExceptionOldStyleHandling; - } - - /** - * @param sqlExceptionOldStyleHandling The value of the config. - * @deprecated This is for compatibility! - */ - public void setSqlExceptionOldStyleHandling( - boolean sqlExceptionOldStyleHandling) { - assertNotLocked(); - if (_log.isInfoEnabled()) { - _log.info("...Setting sqlExceptionOldStyleHandling: " - + sqlExceptionOldStyleHandling); - } - _sqlExceptionOldStyleHandling = sqlExceptionOldStyleHandling; - } - - //========================================================================== - // ========= // Log Format // ========== public String getLogDateFormat() { @@ -303,7 +251,6 @@ // ============ public void clear() { // the only properties that update OK while executing _defaultStatementConfig = null; - _conditionBeanFormatSql = true; // as default _queryLogLevelInfo = false; _executeStatusLogLevelInfo = false; _useSqlLogRegistry = false; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,12 @@ public interface EntityDefinedCommonColumn extends Entity { /** + * Enable common column auto set up. {for after disable because the default + * is enabled} + */ + public void enableCommonColumnAutoSetup(); + + /** * Disable common column auto set up. */ public void disableCommonColumnAutoSetup(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.timecard.db.allcommon.BehaviorSelector; -import jp.sf.pal.timecard.db.allcommon.DaoSelector; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.timecard.db.allcommon.cbean.PagingHandler; import jp.sf.pal.timecard.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.timecard.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.timecard.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.timecard.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of behavior-readable. + * The abstract class of readable behavior. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBehaviorReadable implements BehaviorReadable { //========================================================================== @@ -50,13 +56,13 @@ * Behavior-selector instance. It's basically referred at loadReferrer. * (Required for loadReferrer) */ - protected BehaviorSelector _behaviorSelector; + protected BehaviorCommandInvoker _behaviorCommandInvoker; /** - * Dao-selector instance. It's basically referred at loadReferrer. (Required - * for OutsideSql) + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) */ - protected DaoSelector _daoSelector; + protected BehaviorSelector _behaviorSelector; //========================================================================== // =========== @@ -83,7 +89,7 @@ * @return Read count. (NotNull) */ public int readCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return callReadCount(cb); } @@ -100,7 +106,7 @@ * When the entity has been duplicated. */ public Entity readEntity(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List<Entity> ls = readList(cb); if (ls.isEmpty()) { return null; @@ -120,7 +126,7 @@ * When the entity has been duplicated. */ public Entity readEntityWithDeletedCheck(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final List<Entity> ls = readList(cb); assertEntityNotDeleted(ls, cb); assertEntitySelectedAsOne(ls, cb); @@ -133,7 +139,7 @@ // =========================== protected <ENTITY extends Entity, CB extends ConditionBean> ENTITY helpSelectEntityInternally( CB cb, InternalSelectEntityCallback<ENTITY, CB> callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List<ENTITY> ls = null; try { @@ -156,7 +162,7 @@ protected <ENTITY extends Entity, CB extends ConditionBean> ENTITY helpSelectEntityWithDeletedCheckInternally( CB cb, InternalSelectEntityWithDeletedCheckCallback<ENTITY, CB> callback) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); cb.checkSafetyResult(1); List<ENTITY> ls = null; try { @@ -175,7 +181,7 @@ } //========================================================================== - // =========== + // ========= // List Read // ========= /** @@ -186,7 +192,7 @@ * list. (NotNull) */ public ListResultBean<Entity> readList(ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder<Entity>( getTableDbName()).buildListResultBean(cb, callReadList(cb)); } @@ -198,7 +204,7 @@ * @return Read page. (NotNull) */ public PagingResultBean<Entity> readPage(final ConditionBean cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Entity> invoker = new PagingInvoker<Entity>( getTableDbName()); final PagingHandler<Entity> handler = new PagingHandler<Entity>() { @@ -225,8 +231,7 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.timecard.db.allcommon.Entity entity, Object searchKey4Log) { + protected void assertEntityNotDeleted(Entity entity, Object searchKey4Log) { if (entity == null) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -239,7 +244,8 @@ * @param searchKey4Log Search-key for Logging. (NotNull) * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException */ - protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + protected void assertEntityNotDeleted(List<? extends Entity> ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -253,7 +259,8 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException */ - protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + protected void assertEntitySelectedAsOne(List<? extends Entity> ls, + Object searchKey4Log) { if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(searchKey4Log); } @@ -274,49 +281,254 @@ //========================================================================== // ========= - // Various Select - // ============== - public OutsideSqlBasicExecutor outsideSql() { - assertDaoSelectorNotNull("outsideSql"); - final OutsideSqlDao outsideSqlDao = _daoSelector - .select(OutsideSqlDao.class); - return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); - } + // Scalar Select + // ============= + /** + * The scalar function. <br /> This is not static class because this uses + * the method 'invoke(BehaviorCommand)' + * + * @param <CB> The type of condition-bean. + * @param <RESULT> The type of result. + */ + public class SLFunction<CB extends ConditionBean, RESULT> { // SL: ScaLar - private void assertDaoSelectorNotNull(String methodName) { - if (_daoSelector == null) { + /** The condition-bean for scalar select. (NotNull) */ + protected CB _conditionBean; + + /** The condition-bean for scalar select. (NotNull) */ + protected Class<RESULT> _resultType; + + /** + * @param conditionBean The condition-bean initialized only for scalar + * select. (NotNull) + * @param resultType The type os result. (NotNull) + */ + public SLFunction(CB conditionBean, Class<RESULT> resultType) { + _conditionBean = conditionBean; + _resultType = resultType; + } + + /** + * Select the maximum value. <br /> + * + * <pre> + * memberBhv.scalarSelect(Date.class).max(new ScalarQuery(MemberCB cb) { + * cb.specify().columnMemberBirthday(); // the required specification of target column + * cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it + * }); + * </pre> + * + * @param scalarQuery The query for scalar. (NotNull) + * @return The maximum value. (Nullable) + */ + public RESULT max(ScalarQuery<CB> scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MAX); + } + + /** + * Select the minimum value. <br /> + * + * <pre> + * memberBhv.scalarSelect(Date.class).min(new ScalarQuery(MemberCB cb) { + * cb.specify().columnMemberBirthday(); // the required specification of target column + * cb.query().setMemberStatusCode_Equal_Formalized(); // query as you like it + * }); + * </pre> + * + * @param scalarQuery The query for scalar. (NotNull) + * @return The minimum value. (Nullable) + */ + public RESULT min(ScalarQuery<CB> scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.MIN); + } + + /** + * Select the summary value. <br /> + * + * <pre> + * purchaseBhv.scalarSelect(Integer.class).sum(new ScalarQuery(PurchaseCB cb) { + * cb.specify().columnPurchaseCount(); // the required specification of target column + * cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it + * }); + * </pre> + * + * @param scalarQuery The query for scalar. (NotNull) + * @return The summary value. (Nullable) + */ + public RESULT sum(ScalarQuery<CB> scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.SUM); + } + + /** + * Select the average value. <br /> + * + * <pre> + * purchaseBhv.scalarSelect(Integer.class).avg(new ScalarQuery(PurchaseCB cb) { + * cb.specify().columnPurchaseCount(); // the required specification of target column + * cb.query().setPurchaseDatetime_GreaterEqual(date); // query as you like it + * }); + * </pre> + * + * @param scalarQuery The query for scalar. (NotNull) + * @return The average value. (Nullable) + */ + public RESULT avg(ScalarQuery<CB> scalarQuery) { + assertObjectNotNull("scalarQuery", scalarQuery); + return exec(scalarQuery, SqlClause.SelectClauseType.AVG); + } + + protected RESULT exec(ScalarQuery<CB> scalarQuery, + SqlClause.SelectClauseType selectClauseType) { + assertObjectNotNull("scalarQuery", scalarQuery); + assertObjectNotNull("selectClauseType", selectClauseType); + assertObjectNotNull("conditionBean", _conditionBean); + assertObjectNotNull("resultType", _resultType); + scalarQuery.query(_conditionBean); + assertScalarSelectRequiredSpecifyColumn(); + return invoke(createSelectScalarCBCommand(_conditionBean, + _resultType, selectClauseType)); + } + + protected void assertScalarSelectRequiredSpecifyColumn() { + final String columnName = _conditionBean.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (columnName == null) { + throwScalarSelectInvalidColumnSpecificationException(); + } + } + + protected void throwScalarSelectInvalidColumnSpecificationException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg - + "Not found the selector of dao as behavior's attributed!" + msg = msg + "The specified column for scalar select was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + " You should call specify().column[TargetColumn]() only once." + getLineSeparator(); - msg = msg + "It is precondition that '" + methodName - + "()' needs the selector instance." + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery<MemberCB>() {" + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery<MemberCB>() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + " cb.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " cb.specify().columnRegisterDatetime(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarQuery<MemberCB>() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean Type]" + getLineSeparator() + + _conditionBean.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Result Type]" + getLineSeparator() + + _resultType.getName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidColumnSpecificationException(msg); } } + public static class ScalarSelectInvalidColumnSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // OutsideSql + // ========== /** - * Create value-label list. + * Get the basic executor of outside-SQL. <br /> The invoker of behavior + * command should be not null when you call this method. * + * <pre> + * You can use the methods for outside-SQL are as follows: + * {Basic} + * o selectList() + * o execute() + * o call() + * + * {Entity} + * o entityHandling().selectEntity() + * o entityHandling().selectEntityWithDeletedCheck() + * + * {Cursor} + * o cursorHandling().selectCursor() + * + * {Paging} + * o autoPaging().selectList() + * o autoPaging().selectPage() + * o manualPaging().selectList() + * o manualPaging().selectPage() + * + * {Option -- Dynamic} + * o dynamicBinding().selectList() + * </pre> + * + * @return The basic executor of outside-SQL. (NotNull) + */ + public OutsideSqlBasicExecutor outsideSql() { + assertBehaviorCommandInvoker("outsideSql"); + return new OutsideSqlBasicExecutor(_behaviorCommandInvoker, + getTableDbName()); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Create the list of value-label. + * * @param <ENTITY> The type of entity. * @param entityList The list of entity. (NotNull) - * @param valueLabelSetupper Value-label-setupper. (NotNull) - * @return Value-label list. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) */ public <ENTITY extends Entity> List<Map<String, Object>> createValueLabelList( List<ENTITY> entityList, @@ -362,10 +574,10 @@ } } - protected Object helpConvertingSequenceObject(Class resultClass, + protected Object helpConvertingSequenceObject(Class<?> resultClass, Object sequenceObject) { try { - final Constructor constructor = resultClass + final Constructor<?> constructor = resultClass .getConstructor(new Class[] { String.class }); return constructor.newInstance(new Object[] { sequenceObject .toString() }); @@ -534,6 +746,7 @@ * @param value The value of primary key. (Nullable) * @return The value of primary key. (Nullable) */ + @SuppressWarnings("unchecked") protected <PK> PK toLowerCasePrimaryKeyIfString(PK value) { return (PK) toLowerCaseIfString(value); } @@ -580,22 +793,22 @@ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "Not found the selector of behavior as behavior's attributed!" + + "Not found the selector of behavior as behavior's attribute!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + "Please confirm the definition of the selector at your component configuration of DBFlute." + getLineSeparator(); msg = msg + "It is precondition that '" + methodName + "()' needs the selector instance." + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); - msg = msg + " _behaviorSelector : " + _behaviorSelector + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + getLineSeparator(); - msg = msg + " _daoSelector : " + _daoSelector - + getLineSeparator(); - msg = msg + "* * * * * * * * * */" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; throw new IllegalStateException(msg); } } @@ -648,14 +861,14 @@ public TokenFileOutputResult outputTokenFile(ConditionBean cb, String filename, TokenFileOutputOption tokenFileOutputOption) throws java.io.FileNotFoundException, java.io.IOException { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); assertStringNotNullAndNotTrimmedEmpty("filename", filename); assertObjectNotNull("tokenFileOutputOption", tokenFileOutputOption); final List<Entity> ls = readList(cb); List<List<String>> rowList = new ArrayList<List<String>>(); - for (java.util.Iterator ite = ls.iterator(); ite.hasNext();) { - final Entity entity = (Entity) ite.next(); + for (java.util.Iterator<Entity> ite = ls.iterator(); ite.hasNext();) { + final Entity entity = ite.next(); final List<String> valueList = getDBMeta() .convertToColumnStringValueList(entity); rowList.add(valueList); @@ -665,9 +878,9 @@ .getFileMakingOption(); final FileMakingHeaderInfo fileMakingHeaderInfo = new FileMakingHeaderInfo(); final List<String> columnDbNameList = new ArrayList<String>(); - for (final java.util.Iterator ite = getDBMeta().getColumnInfoList() - .iterator(); ite.hasNext();) { - final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + for (final java.util.Iterator<ColumnInfo> ite = getDBMeta() + .getColumnInfoList().iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = ite.next(); columnDbNameList.add(columnInfo.getColumnDbName()); } fileMakingHeaderInfo.setColumnNameList(columnDbNameList); @@ -690,7 +903,7 @@ * @return All count. */ protected int callGetCountAll() { - return readCount(newConditionBean()); + return callReadCount(newConditionBean()); } /** @@ -699,7 +912,7 @@ * @return All list. (NotNull) */ protected List<Entity> callGetListAll() { - return readList(newConditionBean()); + return callReadList(newConditionBean()); } /** @@ -710,14 +923,12 @@ * @return Read count. (NotNull) */ protected int callReadCount(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final java.lang.reflect.Method mtd = getMethod(getDaoReadable() - .getClass(), "selectCount", types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return ((Integer) result).intValue(); + assertCBNotNull(cb); + return doCallReadCount(cb); } + protected abstract int doCallReadCount(ConditionBean cb); + /** * The implementation. * @@ -727,42 +938,110 @@ * (NotNull) */ protected List<Entity> callReadList(ConditionBean cb) { - assertConditionBeanNotNull(cb); - final Class[] types = new Class[] { cb.getClass() }; - final Method mtd = getMethod(getDaoReadable().getClass(), "selectList", - types); - final Object result = invoke(mtd, getDaoReadable(), new Object[] { cb }); - return (List<Entity>) result; + assertCBNotNull(cb); + return doCallReadList(cb); } - private Method getMethod(Class clazz, String methodName, Class[] argTypes) { - try { - return clazz.getMethod(methodName, argTypes); - } catch (NoSuchMethodException ex) { - String msg = "class=" + clazz + " method=" + methodName + "-" - + java.util.Arrays.asList(argTypes); - throw new RuntimeException(msg, ex); + protected abstract List<Entity> doCallReadList(ConditionBean cb); + + //========================================================================== + // ========= + // Behavior Command + // ================ + public void warmUpCommand() { + { + SelectCountCBCommand cmd = createSelectCountCBCommand(newConditionBean()); + cmd.setInitializeOnly(true); + invoke(cmd); } + { + SelectListCBCommand<? extends Entity> cmd = createSelectListCBCommand( + newConditionBean(), getDBMeta().getEntityType()); + cmd.setInitializeOnly(true); + invoke(cmd); + } } - private Object invoke(Method method, Object target, Object[] args) { - try { - return method.invoke(target, args); - } catch (java.lang.reflect.InvocationTargetException ex) { - Throwable t = ex.getCause(); - if (t instanceof RuntimeException) { - throw (RuntimeException) t; - } - if (t instanceof Error) { - throw (Error) t; - } - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); - } catch (IllegalAccessException ex) { - String msg = "target=" + target + " method=" + method + "-" - + java.util.Arrays.asList(args); - throw new RuntimeException(msg, ex); + protected SelectCountCBCommand createSelectCountCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createSelectCountCBCommand"); + final SelectCountCBCommand command = xsetupSelectCommand(new SelectCountCBCommand()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + return command; + } + + protected <ENTITY extends Entity> SelectListCBCommand<ENTITY> createSelectListCBCommand( + ConditionBean cb, Class<ENTITY> entityType) { + assertBehaviorCommandInvoker("createSelectListCBCommand"); + final SelectListCBCommand<ENTITY> command = xsetupSelectCommand(new SelectListCBCommand<ENTITY>()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setEntityType(entityType); + return command; + } + + protected <RESULT> SelectNextValCommand<RESULT> createSelectNextValCommand( + Class<RESULT> resultType) { + assertBehaviorCommandInvoker("createSelectNextValCommand"); + final SelectNextValCommand<RESULT> command = xsetupSelectCommand(new SelectNextValCommand<RESULT>()); + command.setResultType(resultType); + return command; + } + + protected <RESULT> SelectScalarCBCommand<RESULT> createSelectScalarCBCommand( + ConditionBean cb, Class<RESULT> resultType, + SqlClause.SelectClauseType selectClauseType) { + assertBehaviorCommandInvoker("createSelectScalarCBCommand"); + final SelectScalarCBCommand<RESULT> command = xsetupSelectCommand(new SelectScalarCBCommand<RESULT>()); + command.setConditionBeanType(cb.getClass()); + command.setConditionBean(cb); + command.setResultType(resultType); + command.setSelectClauseType(selectClauseType); + return command; + } + + private <COMMAND extends AbstractBehaviorCommand<?>> COMMAND xsetupSelectCommand( + COMMAND command) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected <RESULT> RESULT invoke(BehaviorCommand<RESULT> behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + protected void assertBehaviorCommandInvoker(String methodName) { + if (_behaviorCommandInvoker == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the invoker of behavior command as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the invoker at your 'dbflute.dicon'." + + getLineSeparator(); + msg = msg + "It is precondition that '" + methodName + + "()' needs the invoker instance." + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); } } @@ -800,6 +1079,7 @@ return SimpleSystemUtil.getLineSeparator(); } + @SuppressWarnings("unchecked") protected <ENTITY extends Entity> ENTITY helpDowncastInternally( Entity entity, Class<ENTITY> clazz) { assertObjectNotNull("entity", entity); @@ -850,8 +1130,16 @@ * * @param cb Condition-bean. (NotNull) */ - protected void assertConditionBeanNotNull( - jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean cb) { + protected void assertConditionBeanNotNull(ConditionBean cb) { + assertCBNotNull(cb); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertCBNotNull(ConditionBean cb) { assertObjectNotNull("cb", cb); } @@ -896,7 +1184,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndEmpty(List ls) { + protected void assertListNotNullAndEmpty(List<?> ls) { assertObjectNotNull("ls", ls); if (!ls.isEmpty()) { String msg = "The list should be empty: ls=" + ls.toString(); @@ -909,7 +1197,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndNotEmpty(List ls) { + protected void assertListNotNullAndNotEmpty(List<?> ls) { assertObjectNotNull("ls", ls); if (ls.isEmpty()) { String msg = "The list should not be empty: ls=" + ls.toString(); @@ -922,7 +1210,7 @@ * * @param ls List. (NotNull) */ - protected void assertListNotNullAndHasOnlyOne(List ls) { + protected void assertListNotNullAndHasOnlyOne(List<?> ls) { assertObjectNotNull("ls", ls); if (ls.size() != 1) { String msg = "The list should contain only one object: ls=" @@ -936,38 +1224,39 @@ // Accessor // ======== /** - * Get the selector of behavior. + * Get the invoker of behavior command. * - * @return The select of behavior. (Nullable: But normally NotNull) + * @return The invoker of behavior command. (Nullable: But normally NotNull) */ - protected BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; + protected BehaviorCommandInvoker getBehaviorCommandInvoker() { + return _behaviorCommandInvoker; } /** - * Set the selector of behavior. + * Set the invoker of behavior command. * - * @param behaviorSelector The selector of behavior. (NotNull) + * @param behaviorCommandInvoker The invoker of behavior command. (NotNull) */ - public void setBehaviorSelector(BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; + public void setBehaviorCommandInvoker( + BehaviorCommandInvoker behaviorCommandInvoker) { + this._behaviorCommandInvoker = behaviorCommandInvoker; } /** - * Get the selector of DAO. + * Get the selector of behavior. * - * @return The select of DAO. (Nullable: But normally NotNull) + * @return The select of behavior. (Nullable: But normally NotNull) */ - protected DaoSelector getDaoSelector() { - return _daoSelector; + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; } /** - * Set the selector of DAO. + * Set the selector of behavior. * - * @param daoSelector The selector of DAO. (NotNull) + * @param behaviorSelector The selector of behavior. (NotNull) */ - public void setDaoSelector(DaoSelector daoSelector) { - _daoSelector = daoSelector; + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.timecard.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.timecard.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.timecard.db.allcommon.helper.token.file.impl.FileTokenImpl; /** - * The abstract class of behavior-writable. + * The abstract class of writable behavior. * * @author DBFlute(AutoGenerator) */ @@ -29,6 +44,31 @@ //========================================================================== // ========= + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== + // =========== + // Attribute + // ========= + protected CommonColumnAutoSetupper _commonColumnAutoSetupper; + + //========================================================================== + // ========= // Entity Update // ============= // ----------------------------------------------------- @@ -357,7 +397,7 @@ * @param entityList Entity list. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List<Entity> entityList) { + public int[] lumpCreate(List<Entity> entityList) { assertListNotNullAndNotEmpty(entityList); return callCreateList(entityList); } @@ -370,7 +410,7 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpModify(java.util.List<Entity> entityList) { + public int[] lumpModify(List<Entity> entityList) { assertListNotNullAndNotEmpty(entityList); return callModifyList(entityList); } @@ -383,7 +423,7 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * If s2dao's version is over 1.0.47 (contains 1.0.47). */ - public int[] lumpRemove(java.util.List<Entity> entityList) { + public int[] lumpRemove(List<Entity> entityList) { assertListNotNullAndNotEmpty(entityList); return callRemoveList(entityList); } @@ -611,9 +651,11 @@ if (!processBeforeInsert(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().create(entity); + return doCallCreate(entity); } + protected abstract int doCallCreate(Entity entity); + /** * Process before insert. * @@ -645,9 +687,11 @@ if (!processBeforeUpdate(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().modifyModifiedOnly(entity); + return doCallModify(entity); } + protected abstract int doCallModify(Entity entity); + /** * Process before update. * @@ -678,9 +722,11 @@ if (!processBeforeDelete(entity)) { return 1;/* as Normal End */ } - return getDaoWritable().remove(entity); + return doCallRemove(entity); } + protected abstract int doCallRemove(Entity entity); + /** * Process before delete. * @@ -729,8 +775,38 @@ * (NotNull) */ protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfInsertIfNeeds(targetEntity); } + private void assertCommonColumnAutoSetupperNotNull() { + if (_commonColumnAutoSetupper == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the auto set-upper of common column as behavior's attribute!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the set-upper at your component configuration of DBFlute." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Your Behavior's Attributes]" + getLineSeparator(); + msg = msg + " _behaviorCommandInvoker : " + + _behaviorCommandInvoker + getLineSeparator(); + msg = msg + " _behaviorSelector : " + _behaviorSelector + + getLineSeparator(); + msg = msg + " _commonColumnAutoSetupper : " + + _commonColumnAutoSetupper + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg); + } + } + /** * Filter the entity of insert. * @@ -778,6 +854,9 @@ * (NotNull) */ protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + final CommonColumnAutoSetupper setupper = getCommonColumnAutoSetupper(); + assertCommonColumnAutoSetupperNotNull(); + setupper.handleCommonColumnOfUpdateIfNeeds(targetEntity); } /** @@ -843,12 +922,14 @@ * (NotNull) * @return Inserted count. */ - public int[] callCreateList(java.util.List<Entity> entityList) { + public int[] callCreateList(List<Entity> entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeInsertInternally(entityList); - return getDaoWritable().createList(entityList); + return doCreateList(entityList); } + protected abstract int[] doCreateList(List<Entity> entityList); + /** * The implementation. * @@ -856,12 +937,14 @@ * (NotNull) * @return Updated count. */ - public int[] callModifyList(java.util.List<Entity> entityList) { + public int[] callModifyList(List<Entity> entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeUpdateInternally(entityList); - return getDaoWritable().modifyList(entityList); + return doModifyList(entityList); } + protected abstract int[] doModifyList(List<Entity> entityList); + /** * The implementation. * @@ -869,12 +952,14 @@ * (NotNull) * @return Deleted count. */ - public int[] callRemoveList(java.util.List<Entity> entityList) { + public int[] callRemoveList(List<Entity> entityList) { assertObjectNotNull("entityList", entityList); helpFilterBeforeDeleteInternally(entityList); - return getDaoWritable().removeList(entityList); + return doRemoveList(entityList); } + protected abstract int[] doRemoveList(List<Entity> entityList); + protected void assertEntityHasVersionNoValue(Entity entity) { if (!getDBMeta().hasVersionNo()) { return; @@ -994,4 +1079,148 @@ } return filteredList; } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected InsertEntityCommand createInsertEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createInsertEntityCommand"); + return xsetupEntityCommand(new InsertEntityCommand(), entity); + } + + protected UpdateEntityCommand createUpdateEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createUpdateEntityCommand"); + return xsetupEntityCommand(new UpdateEntityCommand(), entity); + } + + protected UpdateNonstrictEntityCommand createUpdateNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createUpdateNonstrictEntityCommand"); + return xsetupEntityCommand(new UpdateNonstrictEntityCommand(), entity); + } + + protected DeleteEntityCommand createDeleteEntityCommand(Entity entity) { + assertBehaviorCommandInvoker("createDeleteEntityCommand"); + return xsetupEntityCommand(new DeleteEntityCommand(), entity); + } + + protected DeleteNonstrictEntityCommand createDeleteNonstrictEntityCommand( + Entity entity) { + assertBehaviorCommandInvoker("createDeleteNonstrictEntityCommand"); + return xsetupEntityCommand(new DeleteNonstrictEntityCommand(), entity); + } + + private <COMMAND extends AbstractEntityCommand> COMMAND xsetupEntityCommand( + COMMAND command, Entity entity) { + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entity.getClass()); + command.setEntity(entity); + return command; + } + + protected BatchInsertEntityCommand createBatchInsertEntityCommand( + List<? extends Entity> entityList) { + assertBehaviorCommandInvoker("createBatchInsertEntityCommand"); + return xsetupListEntityCommand(new BatchInsertEntityCommand(), + entityList); + } + + protected BatchUpdateEntityCommand createBatchUpdateEntityCommand( + List<? extends Entity> entityList) { + assertBehaviorCommandInvoker("createBatchUpdateEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateEntityCommand(), + entityList); + } + + protected BatchUpdateNonstrictEntityCommand createBatchUpdateNonstrictEntityCommand( + List<? extends Entity> entityList) { + assertBehaviorCommandInvoker("createBatchUpdateNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchUpdateNonstrictEntityCommand(), + entityList); + } + + protected BatchDeleteEntityCommand createBatchDeleteEntityCommand( + List<? extends Entity> entityList) { + assertBehaviorCommandInvoker("createBatchDeleteEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteEntityCommand(), + entityList); + } + + protected BatchDeleteNonstrictEntityCommand createBatchDeleteNonstrictEntityCommand( + List<? extends Entity> entityList) { + assertBehaviorCommandInvoker("createBatchDeleteNonstrictEntityCommand"); + return xsetupListEntityCommand(new BatchDeleteNonstrictEntityCommand(), + entityList); + } + + /** + * @param <COMMAND> The type of behavior command for list entity. + * @param command The command of behavior. (NotNull) + * @param entityList The list of entity. (NotNull, NotEmpty) + * @return The command of behavior. (NotNull) + */ + private <COMMAND extends AbstractListEntityCommand> COMMAND xsetupListEntityCommand( + COMMAND command, List<? extends Entity> entityList) { + if (entityList.isEmpty()) { + String msg = "The argument 'entityList' should not be empty: " + + entityList; + throw new IllegalStateException(msg); + } + command.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setEntityType(entityList.get(0).getClass()); // *The list should + // not be empty! + command.setEntityList(entityList); + return command; + } + + protected QueryDeleteCBCommand createQueryDeleteCBCommand(ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryDeleteCBCommand"); + final QueryDeleteCBCommand cmd = new QueryDeleteCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + return cmd; + } + + protected QueryUpdateEntityCBCommand createQueryUpdateEntityCBCommand( + Entity entity, ConditionBean cb) { + assertBehaviorCommandInvoker("createQueryUpdateEntityCBCommand"); + final QueryUpdateEntityCBCommand cmd = new QueryUpdateEntityCBCommand(); + cmd.setTableDbName(getTableDbName()); + _behaviorCommandInvoker.injectComponentProperty(cmd); + cmd.setConditionBeanType(cb.getClass()); + cmd.setConditionBean(cb); + cmd.setEntityType(entity.getClass()); + cmd.setEntity(entity); + return cmd; + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the auto set-upper of common column. + * + * @return The auto set-upper of common column. (Nullable: But normally + * NotNull) + */ + protected CommonColumnAutoSetupper getCommonColumnAutoSetupper() { + return _commonColumnAutoSetupper; + } + + /** + * Set the auto set-upper of common column. + * + * @param commonColumnAutoSetupper The auto set-upper of common column. + * (NotNull) + */ + public void setCommonColumnAutoSetupper( + CommonColumnAutoSetupper commonColumnAutoSetupper) { + this._commonColumnAutoSetupper = commonColumnAutoSetupper; + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,6 +1,5 @@ package jp.sf.pal.timecard.db.allcommon.bhv; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; @@ -16,34 +15,12 @@ //========================================================================== // ========= - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== - // ========= // Table name // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); @@ -52,25 +29,14 @@ // DBMeta // ====== /** - * Get dbmeta. + * Get the instance of DBMeta. * - * @return DBMeta. (NotNull) + * @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta(); //========================================================================== // ========= - // Dao Accessor - // ============ - /** - * Get dao-readable. - * - * @return Dao-readable. (NotNull) - */ - public DaoReadable getDaoReadable(); - - //========================================================================== - // ========= // New Instance // ============ /** @@ -173,4 +139,13 @@ * @return The value of sequence. (NotNull) */ public java.math.BigDecimal readNextVal(); + + //========================================================================== + // ========= + // Warm Up + // ======= + /** + * Warm up the command of behavior. + */ + public void warmUpCommand(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,6 +1,7 @@ package jp.sf.pal.timecard.db.allcommon.bhv; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.timecard.db.allcommon.Entity; /** @@ -10,13 +11,6 @@ */ public interface BehaviorWritable extends BehaviorReadable { - /** - * Get dao-writable. - * - * @return Dao-writable. (NotNull) - */ - public DaoWritable getDaoWritable(); - //========================================================================== // =========== // Basic Entity Update @@ -116,15 +110,15 @@ /** * Lump create the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return The array of created count. */ - public int[] lumpCreate(java.util.List<Entity> entityList); + public int[] lumpCreate(List<Entity> entityList); /** - * Lump Modify the list. + * Lump modify the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Modified count. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpModify(java.util.List<Entity> entityList); + public int[] lumpModify(List<Entity> entityList); /** * Lump remove the list. * - * @param entityList Entity-list. (NotNull and NotEmpty) + * @param entityList The list of entity. (NotNull and NotEmpty) * @return Removed count. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException * When the entity has been duplicated. */ - public int[] lumpRemove(java.util.List<Entity> entityList); + public int[] lumpRemove(List<Entity> entityList); } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,71 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public interface BehaviorCommand<RESULT> { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getTableDbName(); + + public String getCommandName(); + + /** + * Get the return type of command. This type is not related to generic type + * because this is for conversion and check only. + * + * @return The return type of command. (NotNull) + */ + public Class<?> getCommandReturnType(); + + public boolean isInitializeOnly(); + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean(); + + public boolean isOutsideSql(); + + public boolean isProcedure(); + + public boolean isSelect(); + + public boolean isSelectCount(); + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution(); + + public void afterExecuting(); + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey(); + + public SqlExecutionCreator createSqlExecutionCreator(); + + public Object[] getSqlExecutionArgument(); + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean(); + + public String getOutsideSqlPath(); + + public OutsideSqlOption getOutsideSqlOption(); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,23 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorCommandComponentSetup { + + public void setDataSource(DataSource dataSource); + + public void setStatementFactory(StatementFactory statementFactory); + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory); + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory); + + public void setSqlFileEncoding(String sqlFileEncoding); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,842 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.InternalMapContext; +import jp.sf.pal.timecard.db.allcommon.XLog; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.timecard.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.timecard.db.allcommon.util.TraceViewUtil; + +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.util.Disposable; +import org.seasar.framework.util.DisposableUtil; + +/** + * The invoker of behavior command. + * + * <pre> + * public interface methods are as follows: + * + * o injectComponentProperty(BehaviorCommandComponentSetup behaviorCommand); + * o invoke(BehaviorCommand behaviorCommand); + * o isDisposable(); + * o isExecutionCacheEmpty(); + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public class BehaviorCommandInvoker implements Disposable { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Injection Target + // ---------------- + protected DataSource _dataSource; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + // ----------------------------------------------------- + // Fixed Property + // -------------- + protected final StatementFactory _statementFactory = createStatememtFactory(); + + protected final Map<String, SqlExecution> _executionMap = new ConcurrentHashMap<String, SqlExecution>(); + + // ----------------------------------------------------- + // Dispose Status + // -------------- + protected boolean disposable; + + //========================================================================== + // ========= + // Constructor + // =========== + public BehaviorCommandInvoker() { + } + + //========================================================================== + // ========= + // Command Set up + // ============== + /** + * Inject the properties of component to the command of behavior. {Public + * Interface} + * + * @param behaviorCommand The command of behavior. (NotNull) + */ + public void injectComponentProperty( + BehaviorCommandComponentSetup behaviorCommand) { + behaviorCommand.setDataSource(_dataSource); + behaviorCommand.setStatementFactory(_statementFactory); + behaviorCommand.setBeanMetaDataFactory(_beanMetaDataFactory); + behaviorCommand.setValueTypeFactory(_valueTypeFactory); + behaviorCommand.setSqlFileEncoding(getSqlFileEncoding()); + } + + protected String getSqlFileEncoding() { + return "UTF-8"; // This value is set when generating. + } + + //========================================================================== + // ========= + // Command Invoke + // ============== + /** + * Invoke the command of behavior. {Public Interface} This method is an + * entry point! + * + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + public <RESULT> RESULT invoke(BehaviorCommand<RESULT> behaviorCommand) { + clearContext(); + try { + return doInvoke(behaviorCommand); + } finally { + clearContext(); + } + } + + /** + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The result object. (Nullable) + */ + protected <RESULT> RESULT doInvoke(BehaviorCommand<RESULT> behaviorCommand) { + // - - - - - - - - - - - - - + // Initialize SQL Execution + // - - - - - - - - - - - - - + if (behaviorCommand.isInitializeOnly()) { + initializeSqlExecution(behaviorCommand); + return null; // The end! (Initialize Only) + } + behaviorCommand.beforeGettingSqlExecution(); + + SqlExecution execution = null; + try { + final String key = behaviorCommand.buildSqlExecutionKey(); + execution = getSqlExecution(key); + if (execution == null) { + long beforeCmd = 0; + if (isLogEnabled()) { + beforeCmd = System.currentTimeMillis(); + } + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + execution = getSqlExecution(key, creator); + if (isLogEnabled()) { + final long afterCmd = System.currentTimeMillis(); + if (beforeCmd != afterCmd) { + logSqlExecution(behaviorCommand, execution, beforeCmd, + afterCmd); + } + } + } + } finally { + if (isLogEnabled()) { + logInvocation(behaviorCommand); + } + } + + long before = 0; + if (isLogEnabled()) { + before = System.currentTimeMillis(); + } + + Object ret = null; + try { + final Object[] args = behaviorCommand.getSqlExecutionArgument(); + ret = executeSql(execution, args); + } finally { + behaviorCommand.afterExecuting(); + } + final Class<?> retType = behaviorCommand.getCommandReturnType(); + assertRetType(retType, ret); + + if (isLogEnabled()) { + final long after = System.currentTimeMillis(); + logReturn(behaviorCommand, retType, ret, before, after); + } + + // - - - - - - - - - - + // Convert and Return! + // - - - - - - - - - - + if (retType.isPrimitive()) { + ret = convertPrimitiveWrapper(retType, ret); + } else if (Number.class.isAssignableFrom(retType)) { + ret = convertNumber(retType, ret); + } + @SuppressWarnings("unchecked") + final RESULT result = (RESULT) ret; + return result; + } + + //========================================================================== + // ========= + // SQL Execution + // ============= + protected <RESULT> void initializeSqlExecution( + BehaviorCommand<RESULT> behaviorCommand) { + final String key = behaviorCommand.buildSqlExecutionKey(); + SqlExecutionCreator creator = behaviorCommand + .createSqlExecutionCreator(); + getSqlExecution(key, creator); + } + + protected SqlExecution getSqlExecution(String key) { + return _executionMap.get(key); + } + + /** + * @param key The key of SQL execution. (NotNull) + * @param executionCreator The creator of SQL execution. (NotNull) + * @return The SQL execution that may be created then. (NotNull) + */ + protected SqlExecution getSqlExecution(String key, + SqlExecutionCreator executionCreator) { + SqlExecution execution = getSqlExecution(key); + if (execution == null) { + synchronized (_executionMap) { + execution = getSqlExecution(key); + if (execution == null) { + if (isLogEnabled()) { + log("...Initializing sqlExecution for the key '" + key + + "'"); + } + _executionMap.put(key, executionCreator + .createSqlExecution()); + } else { + if (isLogEnabled()) { + log("...Getting sqlExecution as cache because the previous thread have already initilized."); + } + } + } + execution = getSqlExecution(key); + if (execution == null) { + String msg = "sqlExecutionCreator.createSqlCommand() should not return null:"; + msg = msg + " sqlExecutionCreator=" + executionCreator + + " key=" + key; + throw new IllegalStateException(msg); + } + if (!disposable) { + synchronized (this) { + if (!disposable) { + toBeDisposable(); + } + } + } + } + return execution; + } + + protected Object executeSql(SqlExecution execution, Object[] args) { + return execution.execute(args); + } + + //========================================================================== + // ========= + // Log SqlCommand + // ============== + protected <RESULT> void logSqlExecution( + BehaviorCommand<RESULT> behaviorCommand, SqlExecution execution, + long beforeCmd, long afterCmd) { + log("SqlExecution Initialization Cost: [" + + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) + + "]"); + } + + //========================================================================== + // ========= + // Log Invocation + // ============== + protected <RESULT> void logInvocation( + BehaviorCommand<RESULT> behaviorCommand) { + final StackTraceElement[] stackTrace = new Exception().getStackTrace(); + final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); + filterBehaviorResult(behaviorCommand, behaviorResult); + + final String invokeClassName; + final String invokeMethodName; + if (!behaviorResult.isEmptyResult()) { + invokeClassName = behaviorResult.getSimpleClassName(); + invokeMethodName = behaviorResult.getMethodName(); + } else { + invokeClassName = behaviorCommand.getTableDbName(); + invokeMethodName = behaviorCommand.getCommandName(); + } + final String expWithoutKakko = buildInvocationExpressionWithoutKakko( + behaviorCommand, invokeClassName, invokeMethodName); + + // Save behavior invoke name for error message. + putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); + + final String equalBorder = buildFitBorder("", "=", expWithoutKakko, + false); + final String callerExpression = expWithoutKakko + "()"; + + log("/=====================================================" + + equalBorder + "=="); + log(" " + + callerExpression); + log(" " + + equalBorder + "=/"); + + logPath(behaviorCommand, stackTrace, behaviorResult); + + if (behaviorCommand.isOutsideSql() && !behaviorCommand.isProcedure()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + if (outsideSqlContext != null) { + log("path: " + behaviorCommand.getOutsideSqlPath()); + log("option: " + behaviorCommand.getOutsideSqlOption()); + } + } + } + + protected <RESULT> void filterBehaviorResult( + BehaviorCommand<RESULT> behaviorCommand, + InvokeNameResult behaviorResult) { + final String simpleClassName = behaviorResult.getSimpleClassName(); + if (simpleClassName == null) { + return; + } + if (simpleClassName.contains("Behavior") + && simpleClassName.endsWith("$SLFunction")) { + final String behaviorClassName = findBehaviorClassNameFromDBMeta(behaviorCommand + .getTableDbName()); + behaviorResult.setSimpleClassName(behaviorClassName); + behaviorResult.setMethodName("scalarSelect()." + + behaviorResult.getMethodName()); + } + } + + protected <RESULT> void logPath(BehaviorCommand<RESULT> behaviorCommand, + StackTraceElement[] stackTrace, InvokeNameResult behaviorResult) { + final int bhvNextIndex = behaviorResult.getNextStartIndex(); + final InvokeNameResult clientResult = extractClientInvokeName( + stackTrace, bhvNextIndex); + final int clientFirstIndex = clientResult.getFoundFirstIndex(); + final InvokeNameResult byPassResult = extractByPassInvokeName( + stackTrace, bhvNextIndex, clientFirstIndex - bhvNextIndex); + + final String clientInvokeName = clientResult.getInvokeName(); + final String byPassInvokeName = byPassResult.getInvokeName(); + final String behaviorInvokeName = behaviorResult.getInvokeName(); + if (clientInvokeName.trim().length() == 0 + && byPassInvokeName.trim().length() == 0) { + return; + } + + // Save client invoke name for error message. + if (!clientResult.isEmptyResult()) { + putObjectToMapContext("df:ClientInvokeName", clientInvokeName); + } + // Save by-pass invoke name for error message. + if (!byPassResult.isEmptyResult()) { + putObjectToMapContext("df:ByPassInvokeName", byPassInvokeName); + } + + log(clientInvokeName + byPassInvokeName + behaviorInvokeName + "..."); + } + + protected <RESULT> String buildInvocationExpressionWithoutKakko( + BehaviorCommand<RESULT> behaviorCommand, String invokeClassName, + String invokeMethodName) { + if (invokeClassName.contains("OutsideSql") + && invokeClassName.endsWith("Executor")) { // OutsideSql + // Executor Handling + try { + final String originalName = invokeClassName; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final String tableDbName = outsideSqlContext + .getTableDbName(); + final String behaviorClassName = findBehaviorClassNameFromDBMeta(tableDbName); + invokeClassName = behaviorClassName + ".outsideSql()"; + if (originalName.endsWith("OutsideSqlEntityExecutor")) { + invokeClassName = invokeClassName + ".entityHandling()"; + } else if (originalName + .endsWith("OutsideSqlPagingExecutor")) { + if (outsideSqlContext.isAutoPagingLogging()) { + invokeClassName = invokeClassName + ".autoPaging()"; + } else { + invokeClassName = invokeClassName + + ".manualPaging()"; + } + } else if (originalName + .endsWith("OutsideSqlCursorExecutor")) { + invokeClassName = invokeClassName + ".cursorHandling()"; + } + } else { + invokeClassName = "OutsideSql"; + } + } catch (RuntimeException ignored) { + log("Ignored exception occurred: msg=" + ignored.getMessage()); + } + } + String callerExpressionWithoutKakko = invokeClassName + "." + + invokeMethodName; + if ("selectPage".equals(invokeMethodName)) { // Special Handling! + boolean resultTypeInteger = false; + if (behaviorCommand.isOutsideSql()) { + final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); + final Object resultTypeSpecification = outsideSqlContext + .getResultTypeSpecification(); + if (resultTypeSpecification != null + && resultTypeSpecification instanceof Class<?>) { + final Class<?> resultType = (Class<?>) resultTypeSpecification; + if (Integer.class.isAssignableFrom(resultType)) { + resultTypeInteger = true; + } + } + } + if (resultTypeInteger || behaviorCommand.isSelectCount()) { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():count"; + } else { + callerExpressionWithoutKakko = callerExpressionWithoutKakko + + "():paging"; + } + } + return callerExpressionWithoutKakko; + } + + protected String buildFitBorder(String prefix, String element, + String lengthTargetString, boolean space) { + final int length = space ? lengthTargetString.length() / 2 + : lengthTargetString.length(); + final StringBuffer sb = new StringBuffer(); + sb.append(prefix); + for (int i = 0; i < length; i++) { + sb.append(element); + if (space) { + sb.append(" "); + } + } + if (space) { + sb.append(element); + } + return sb.toString(); + } + + protected InvokeNameResult extractClientInvokeName( + StackTraceElement[] stackTrace, final int startIndex) { + final List<String> suffixList = Arrays.asList(new String[] { "Page", + "Action" }); + final InvokeNameExtractingResource resource = new InvokeNameExtractingResource() { + public boolean isTargetElement(String className, String methodName) { + return isClassNameEndsWith(className, suffixList); + } + + public String filterSimpleClassName(String simpleClassName) { + return simpleClassName; + } + + public boolean isUseAdditionalInfo() { + return true; + } + + public int getStartIndex() { + return startIndex; + } + + public int getLoopSize() { + return 25; + } + }; + return extractInvokeName(resource, stackTrace); + } + + protected InvokeNameResult extractByPassInvokeName( + StackTraceElement[] stackTrace, final int startIndex, + final int loopSize) { + final List<String> suffixList = Arrays.asList(new String[] { "Service", + "ServiceImpl", "Facade", "FacadeImpl" }); + final InvokeNameExtractingResource resource = new InvokeNameExtractingResource() { + public boolean isTargetElement(String className, String methodName) { + return isClassNameEndsWith(className, suffixList); + } + + public String filterSimpleClassName(String simpleClassName) { + return simpleClassName; + } + + public boolean isUseAdditionalInfo() { + return true; + } + + public int getStartIndex() { + return startIndex; + } + + public int getLoopSize() { + return loopSize >= 0 ? loopSize : 25; + } + }; + return extractInvokeName(resource, stackTrace); + } + + protected InvokeNameResult extractBehaviorInvokeName( + StackTraceElement[] stackTrace) { + final List<String> suffixList = Arrays.asList(new String[] { "Bhv", + "BehaviorReadable", "BehaviorWritable", "PagingInvoker" }); + final List<String> keywordList = Arrays.asList(new String[] { "Bhv$", + "BehaviorReadable$", "BehaviorWritable$" }); + final List<String> ousideSql1List = Arrays + .asList(new String[] { "OutsideSql" }); + final List<String> ousideSql2List = Arrays + .asList(new String[] { "Executor" }); + final List<String> ousideSql3List = Arrays + .asList(new String[] { "Executor$" }); + final InvokeNameExtractingResource resource = new InvokeNameExtractingResource() { + public boolean isTargetElement(String className, String methodName) { + if (isClassNameEndsWith(className, suffixList)) { + return true; + } + if (isClassNameContains(className, keywordList)) { + return true; + } + if (isClassNameContains(className, ousideSql1List) + && (isClassNameEndsWith(className, ousideSql2List) || isClassNameContains( + className, ousideSql3List))) { + return true; + } + return false; + } + + public String filterSimpleClassName(String simpleClassName) { + return removeBasePrefixFromSimpleClassName(simpleClassName); + } + + public boolean isUseAdditionalInfo() { + return false; + } + + public int getStartIndex() { + return 0; + } + + public int getLoopSize() { + return 25; + } + }; + return extractInvokeName(resource, stackTrace); + } + + protected boolean isClassNameEndsWith(String className, + List<String> suffixList) { + for (String suffix : suffixList) { + if (className.endsWith(suffix)) { + return true; + } + } + return false; + } + + protected boolean isClassNameContains(String className, + List<String> keywordList) { + for (String keyword : keywordList) { + if (className.contains(keyword)) { + return true; + } + } + return false; + } + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @param stackTrace Stack log. (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + protected InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource, + StackTraceElement[] stackTrace) { + final InvokeNameExtractorImpl extractor = new InvokeNameExtractorImpl(); + extractor.setStackTrace(stackTrace); + return extractor.extractInvokeName(resource); + } + + /** + * @param simpleClassName The simple class name. (NotNull) + * @return The simple class name removed the base prefix. (NotNull) + */ + protected String removeBasePrefixFromSimpleClassName(String simpleClassName) { + if (!simpleClassName.startsWith("Bs")) { + return simpleClassName; + } + final int prefixLength = "Bs".length(); + if (!Character.isUpperCase(simpleClassName.substring(prefixLength) + .charAt(0))) { + return simpleClassName; + } + if (simpleClassName.length() <= prefixLength) { + return simpleClassName; + } + return "" + simpleClassName.substring(prefixLength); + } + + protected String findBehaviorClassNameFromDBMeta(String tableDbName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + return removeBasePrefixFromSimpleClassName(behaviorClassName); + } + + //========================================================================== + // ========= + // Log Return + // ========== + protected <RESULT> void logReturn(BehaviorCommand<RESULT> behaviorCommand, + Class<?> retType, Object ret, long before, long after) { + try { + final String daoResultPrefix = "===========/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + " - "; + if (List.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected list: null]"); + } else { + final List<?> ls = (java.util.List<?>) ret; + if (ls.isEmpty()) { + log(daoResultPrefix + "Selected list: 0]"); + } else if (ls.size() == 1 && ls.get(0) instanceof Number) { + log(daoResultPrefix + "Selected count: " + ls.get(0) + + "]"); + } else { + log(daoResultPrefix + "Selected list: " + ls.size() + + " first=" + ls.get(0) + "]"); + } + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final Entity entity = (Entity) ret; + log(daoResultPrefix + "Selected entity: " + entity + "]"); + } + } else if (int[].class.isAssignableFrom(retType)) { + if (ret == null) { + log(daoResultPrefix + "Selected entity: null" + "]"); + } else { + final int[] resultArray = (int[]) ret; + if (resultArray.length == 0) { + log(daoResultPrefix + "All updated count: 0]"); + } else { + final StringBuilder sb = new StringBuilder(); + boolean resultExpressionScope = true; + int resultCount = 0; + int loopCount = 0; + for (int element : resultArray) { + resultCount = resultCount + element; + if (resultExpressionScope) { + if (loopCount <= 10) { + if (sb.length() == 0) { + sb.append(element); + } else { + sb.append(",").append(element); + } + } else { + sb.append(",").append("..."); + resultExpressionScope = false; + } + } + ++loopCount; + } + sb.insert(0, "{").append("}"); + log(daoResultPrefix + "All updated count: " + + resultCount + " result=" + sb + "]"); + } + } + } else { + if (behaviorCommand.isSelectCount()) { + log(daoResultPrefix + "Selected count: " + ret + "]"); + } else { + log(daoResultPrefix + "Result: " + ret + "]"); + } + } + log(" "); + } catch (RuntimeException e) { + String msg = "Result object debug threw the exception: behaviorCommand="; + msg = msg + behaviorCommand + " retType=" + retType; + msg = msg + " ret=" + ret; + throw e; + } + } + + //========================================================================== + // ========= + // Context Helper + // ============== + protected OutsideSqlContext getOutsideSqlContext() { + if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + return null; + } + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected void putObjectToMapContext(String key, Object value) { + InternalMapContext.setObject(key, value); + } + + protected void clearContext() { + if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + OutsideSqlContext.clearOutsideSqlContextOnThread(); + } + if (FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + // Because there is possible that fetch narrowing has been ignored + // for manualPaging of outsideSql. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - + FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread() + .restoreIgnoredFetchNarrowing(); + + FetchNarrowingBeanContext.clearFetchNarrowingBeanOnThread(); + } + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + ConditionBeanContext.clearConditionBeanOnThread(); + } + if (InternalMapContext.isExistInternalMapContextOnThread()) { + InternalMapContext.clearInternalMapContextOnThread(); + } + } + + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + protected StatementFactory createStatememtFactory() { + final StatementConfig defaultStatementConfig = DBFluteConfig + .getInstance().getDefaultStatementConfig(); + final boolean internalDebug = DBFluteConfig.getInstance() + .isInternalDebug(); + InternalStatementFactory factory = new InternalStatementFactory(); + factory.setDefaultStatementConfig(defaultStatementConfig); + factory.setInternalDebug(internalDebug); + return factory; + } + + //========================================================================== + // ========= + // Dispose + // ======= + public void toBeDisposable() { + DisposableUtil.add(this); + disposable = true; + } + + public void dispose() { + _executionMap.clear(); + disposable = false; + } + + public boolean isDisposable() { + return disposable; + } + + public boolean isExecutionCacheEmpty() { + return _executionMap.isEmpty(); + } + + //========================================================================== + // ========= + // Convert Helper + // ============== + protected Object convertPrimitiveWrapper(Class<?> retType, Object ret) { + return SimpleTypeUtil.toWrapper(retType, ret); + } + + protected Object convertNumber(Class<?> retType, Object ret) { + return SimpleTypeUtil.toNumber(retType, ret); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertRetType(Class<?> retType, Object ret) { + if (List.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof List)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } else if (Entity.class.isAssignableFrom(retType)) { + if (ret != null && !(ret instanceof Entity)) { + String msg = "The retType is difference from actual return: "; + msg = msg + "retType=" + retType + " ret.getClass()=" + + ret.getClass() + " ref=" + ret; + throw new IllegalStateException(msg); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,184 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import javax.sql.XADataSource; + +import jp.sf.pal.timecard.db.allcommon.DBDef; +import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.extension.dbcp.impl.XADataSourceImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BehaviorInitializer { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(BehaviorInitializer.class); + + // ----------------------------------------------------- + // For DBMeta + // ---------- + /** + * The map of table DB name and class name for the handler of DB meta + * instance. + */ + protected static final Map<String, String> _tableDbNameClassNameMap; + static { + final Map<String, String> tmpMap = newConcurrentHashMap(); + tmpMap.put("DAILY_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.DailyReportDbm"); + tmpMap.put("EMPLOYEE", + "jp.sf.pal.timecard.db.bsentity.dbmeta.EmployeeDbm"); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("MONTHLY_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyReportDbm"); + tmpMap + .put("MONTHLY_WORKING_REPORT", + "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.timecard.db.bsentity.dbmeta.UserInfoDbm"); + tmpMap.put("WORKING_TYPE", + "jp.sf.pal.timecard.db.bsentity.dbmeta.WorkingTypeDbm"); + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + protected static <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap() { + return new ConcurrentHashMap<KEY, VALUE>(); + } + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. And initialize various components related behavior. + * + * @param xaDataSource The data source of XA. (Nullable) + */ + public BehaviorInitializer(XADataSource xaDataSource) { + _log + .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); + initializeDBMetaResource(); + handleSqlLogRegistry(); + loadCoolClasses(); + if (xaDataSource != null) { + showInformation(xaDataSource); + setupDBDefByDriverClassName(xaDataSource); + } + DBFluteConfig.getInstance().lock(); + _log.info("* * * * */"); + } + + //========================================================================== + // ========= + // DBMeta + // ====== + protected void initializeDBMetaResource() { + DBMetaInstanceHandler.setupDBMetaResource(_tableDbNameClassNameMap); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ + protected void loadCoolClasses() { // for S2Container basically + ConditionBeanContext.loadCoolClasses(); // Against the ClassLoader + // Headache! + } + + //========================================================================== + // ========= + // Information + // =========== + protected void showInformation(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final StringBuilder sb = new StringBuilder(); + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final String url = xaDataSourceImpl.getURL(); + final String user = xaDataSourceImpl.getUser(); + sb.append(" [XADataSource]:").append(getLineSeparator()); + sb.append(" driver = " + driverClassName).append( + getLineSeparator()); + sb.append(" url = " + url).append(getLineSeparator()); + sb.append(" user = " + user); + _log.info("{Injection Information}" + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // Database Product Name + // ===================== + protected void setupDBDefByDriverClassName(XADataSource xaDataSource) { + if (xaDataSource != null && xaDataSource instanceof XADataSourceImpl) { + final XADataSourceImpl xaDataSourceImpl = (XADataSourceImpl) xaDataSource; + final String driverClassName = xaDataSourceImpl + .getDriverClassName(); + final DBDef dbdef = DBDef.byDriverClassName(driverClassName); + if (dbdef != null) { + DBDef.setCurrentDef(dbdef); + return; + } + } + } + + //========================================================================== + // ========= + // SQL Log Registry + // ================ + protected void handleSqlLogRegistry() { + if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { + final StringBuilder sb = new StringBuilder(); + sb.append("{SqlLog Information}").append(getLineSeparator()); + sb.append(" [SqlLogRegistry]").append(getLineSeparator()); + if (InternalSqlLogRegistry.setupSqlLogRegistry()) { + sb + .append( + " ...Setting up SqlLogRegistry(org.seasar.extension.jdbc)!") + .append(getLineSeparator()); + sb + .append(" Because the property 'useSqlLogRegistry' of the config of DBFlute is true."); + } else { + sb + .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not supported at the version!"); + } + _log.info(sb); + } else { + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + if (sqlLogRegistry != null) { + InternalSqlLogRegistry.closeRegistration(); + } + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,9 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,9 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,261 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.DBDef; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalRowCreator; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.BeanMetaDataFactory; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public abstract class AbstractBehaviorCommand<RESULT> implements + BehaviorCommand<RESULT>, BehaviorCommandComponentSetup { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The table DB name. (Required) */ + protected String _tableDbName; + + /** Is it initialize only? (Choice) */ + protected boolean _initializeOnly; + + // ----------------------------------------------------- + // Injection Component + // ------------------- + protected DataSource _dataSource; + + protected StatementFactory _statementFactory; + + protected BeanMetaDataFactory _beanMetaDataFactory; + + protected ValueTypeFactory _valueTypeFactory; + + protected String _sqlFileEncoding; + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // UpdateDynamicCommnd + // ------------------- + protected InternalUpdateDynamicCommand createUpdateDynamicCommand( + String[] argNames, Class<?>[] argTypes, String sql) { + final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( + _dataSource, _statementFactory); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + if (sql != null) { + cmd.setSql(sql); + } + return cmd; + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createBeanListMetaDataResultSetHandler( + BeanMetaData bmd) { + final InternalRowCreator rowCreator = createInternalRowCreator(bmd); + final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); + return new InternalBeanListMetaDataResultSetHandler(bmd, rowCreator, + relationRowCreator); + } + + protected ResultSetHandler createObjectResultSetHandler(Class<?> objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return new InternalObjectResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + Class<?> objectType) { + final ValueType valueType = ValueTypes.getValueType(objectType); + return createObjectListResultSetHandler(valueType); + } + + protected ResultSetHandler createObjectListResultSetHandler( + ValueType valueType) { + return new InternalObjectListResultSetHandler(valueType); + } + + protected static class InternalObjectResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + while (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + protected static class InternalObjectListResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalObjectListResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + final List<Object> ret = new ArrayList<Object>(); + while (rs.next()) { + ret.add(valueType.getValue(rs, 1)); + } + return ret; + } + } + + protected static class InternalNullResultSetHandler implements + ResultSetHandler { + public Object handle(ResultSet rs) throws SQLException { + return null; + } + } + + protected InternalRowCreator createInternalRowCreator(BeanMetaData bmd) { + final Class<?> clazz = bmd != null ? bmd.getBeanClass() : null; + return InternalRowCreator.createInternalRowCreator(clazz); + } + + protected InternalRelationRowCreator createInternalRelationRowCreator( + BeanMetaData bmd) { + return new InternalRelationRowCreator(); // Not yet implemented about + // performance tuning! + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected String buildDbmsSuffix() { + final String productName = DBDef.getCurrentDef().code(); + return (productName != null ? "_" + productName.toLowerCase() : ""); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertBasicProperty(String methodName) { + if (_tableDbName == null) { + throw new IllegalStateException(buildAssertMessage("_tableDbName", + methodName)); + } + } + + protected void assertComponentProperty(String methodName) { + if (_dataSource == null) { + throw new IllegalStateException(buildAssertMessage("_dataSource", + methodName)); + } + if (_statementFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_statementFactory", methodName)); + } + if (_beanMetaDataFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_beanMetaDataFactory", methodName)); + } + if (_valueTypeFactory == null) { + throw new IllegalStateException(buildAssertMessage( + "_valueTypeFactory", methodName)); + } + if (_sqlFileEncoding == null) { + throw new IllegalStateException(buildAssertMessage( + "_sqlFileEncoding", methodName)); + } + } + + protected String buildAssertMessage(String propertyName, String methodName) { + propertyName = propertyName.startsWith("_") ? propertyName + .substring("_".length()) : propertyName; + String msg = "The property '" + propertyName + "' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{" + buildSqlExecutionKey() + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Basic Information + // ----------------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + public void setInitializeOnly(boolean initializeOnly) { + _initializeOnly = initializeOnly; + } + + public boolean isInitializeOnly() { + return _initializeOnly; + } + + // ----------------------------------------------------- + // Injection Component + // ------------------- + public void setDataSource(DataSource dataSource) { + _dataSource = dataSource; + } + + public void setStatementFactory(StatementFactory statementFactory) { + _statementFactory = statementFactory; + } + + public void setBeanMetaDataFactory(BeanMetaDataFactory beanMetaDataFactory) { + _beanMetaDataFactory = beanMetaDataFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + _valueTypeFactory = valueTypeFactory; + } + + public void setSqlFileEncoding(String sqlFileEncoding) { + _sqlFileEncoding = sqlFileEncoding; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,182 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractEntityCommand extends + AbstractBehaviorCommand<Integer> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class<? extends Entity> _entityType; + + /** The instance of condition-bean. (Required) */ + protected Entity _entity; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class<?> getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ")"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class<?> beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List<String> nameList = new ArrayList<String>(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class<? extends Entity> entityType) { + _entityType = entityType; + } + + public void setEntity(Entity entity) { + _entity = entity; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,182 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractListEntityCommand extends + AbstractBehaviorCommand<int[]> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class<? extends Entity> _entityType; + + /** The instance of condition-bean. (Required) */ + protected List<? extends Entity> _entityList; + + //========================================================================== + // ========= + // Basic Information + // ================= + public Class<?> getCommandReturnType() { + return int[].class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(List<" + + _entityType.getSimpleName() + ">)"; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _entityList }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Cannot use the handler of DBMeta instance + // because the customize-entity is contained to find here. + // - - - - - - - - - -/ + // DBMetaInstanceHandler.findDBMeta(_tableDbName); + + final Class<?> beanType = _entityType; + if (beanType == null) { + return null; + } + if (!Entity.class.isAssignableFrom(beanType)) { + return null; + } + final Entity entity; + try { + entity = (Entity) beanType.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return entity.getDBMeta(); + } + + protected String[] getPersistentPropertyNames(BeanMetaData bmd) { + final List<String> nameList = new ArrayList<String>(); + for (int i = 0; i < bmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = bmd.getPropertyType(i); + if (pt.isPersistent()) { + nameList.add(pt.getPropertyName()); + } + } + return nameList.toArray(new String[nameList.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entityList == null) { + throw new IllegalStateException(buildAssertMessage("_entityList", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class<? extends Entity> entityType) { + _entityType = entityType; + } + + public void setEntityList(List<? extends Entity> entityList) { + _entityList = entityList; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,93 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public abstract class AbstractOutsideSqlCommand<RESULT> extends + AbstractBehaviorCommand<RESULT> { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic Information + // ----------------- + /** The path of outside-SQL. (Required) */ + protected String _outsideSqlPath; + + /** The parameter-bean. (Required to set, but Nullable) */ + protected Object _parameterBean; + + /** The option of outside-SQL. (Required) */ + protected OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + public boolean isOutsideSql() { + return true; + } + + public boolean isSelectCount() { + return false; // When the command is for outside-SQL, it always be + // false. + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public OutsideSqlOption getOutsideSqlOption() { + return _outsideSqlOption; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertOutsideSqlBasic(String methodName) { + if (_outsideSqlPath == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlPath", methodName)); + } + if (_outsideSqlOption == null) { + throw new IllegalStateException(buildAssertMessage( + "_outsideSqlOption", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setOutsideSqlPath(String outsideSqlPath) { + _outsideSqlPath = outsideSqlPath; + } + + public void setParameterBean(Object parameterBean) { + _parameterBean = parameterBean; + } + + public void setOutsideSqlOption(OutsideSqlOption outsideSqlOption) { + _outsideSqlOption = outsideSqlOption; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,175 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The abstract command for OutsideSql.selectSomething(). + * + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public abstract class AbstractOutsideSqlSelectCommand<RESULT> extends + AbstractOutsideSqlCommand<RESULT> { + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + final boolean autoPagingLogging = (option.isAutoPaging() || option + .isSourcePagingRequestTypeAuto()); + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setAutoPagingLogging(autoPagingLogging); // for + // logging + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + + // Set up fetchNarrowingBean. + setupOutsideSqlFetchNarrowingBean(pmb, option); + } + + protected void setupOutsideSqlFetchNarrowingBean(Object pmb, + OutsideSqlOption option) { + if (pmb == null + || !FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(pmb + .getClass())) { + return; + } + final FetchNarrowingBean fetchNarrowingBean = (FetchNarrowingBean) pmb; + if (option.isManualPaging()) { + fetchNarrowingBean.ignoreFetchNarrowing(); + } + FetchNarrowingBeanContext + .setFetchNarrowingBeanOnThread(fetchNarrowingBean); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final Object resultTypeSpecification = getResultTypeSpecification(); + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, resultTypeSpecification); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlSelectExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlSelectExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class<?>[] argTypes = (pmb != null ? new Class<?>[] { pmb + .getClass() } : new Class<?>[] {}); + + // - - - - - - - - - - - - - + // Create ResultSetHandler. + // - - - - - - - - - - - - - + final ResultSetHandler handler = createOutsideSqlSelectResultSetHandler(); + + // - - - - - - - - - - - + // Create SqlExecution. + // - - - - - - - - - - - + return createOutsideSqlSelectExecution(handler, argNames, argTypes, sql); + } + + protected OutsideSqlSelectExecution createOutsideSqlSelectExecution( + ResultSetHandler handler, String[] argNames, Class<?>[] argTypes, + String sql) { + final OutsideSqlSelectExecution cmd = new OutsideSqlSelectExecution( + _dataSource, _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + protected abstract ResultSetHandler createOutsideSqlSelectResultSetHandler(); + + protected abstract Object getResultTypeSpecification(); + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,122 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public abstract class AbstractSelectCBCommand<RESULT> extends + AbstractBehaviorCommand<RESULT> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class<? extends ConditionBean> _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + protected SqlExecution createSelectCBExecution( + Class<? extends ConditionBean> cbType, ResultSetHandler handler) { + return createSelectCBExecution(handler, new String[] { "dto" }, + new Class<?>[] { cbType }); + } + + protected SelectCBExecution createSelectCBExecution( + ResultSetHandler handler, String[] argNames, Class<?>[] argTypes) { + final SelectCBExecution cmd = new SelectCBExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + return cmd; + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class<? extends ConditionBean> conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,51 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchDelete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteBatchAutoStaticCommand createDeleteBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalDeleteBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchDeleteNonstrictEntityCommand extends BatchDeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchDeleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,46 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchInsertEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchInsert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchInsertEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalInsertBatchAutoStaticCommand createInsertBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalInsertBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,51 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateEntityCommand extends AbstractListEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "batchUpdate"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createBatchUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createBatchUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateBatchAutoStaticCommand(bmd, propertyNames); + } + + protected InternalUpdateBatchAutoStaticCommand createUpdateBatchAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + boolean opt = isOptimisticLockHandling(); + return new InternalUpdateBatchAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, opt, opt); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BatchUpdateNonstrictEntityCommand extends BatchUpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "batchUpdateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,51 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "delete"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createDeleteEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createDeleteEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createDeleteAutoStaticCommand(bmd, propertyNames); + } + + protected InternalDeleteAutoStaticCommand createDeleteAutoStaticCommand( + BeanMetaData bmd, String[] propertyNames) { + return new InternalDeleteAutoStaticCommand(_dataSource, + _statementFactory, bmd, propertyNames, + isOptimisticLockHandling()); + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DeleteNonstrictEntityCommand extends DeleteEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "deleteNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,86 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InsertEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "insert"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createInsertEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createInsertEntitySqlExecution(BeanMetaData bmd) { + final SqlExecution nonPrimaryKeySqlExecution = createNonPrimaryInsertSqlExecution(bmd); + if (nonPrimaryKeySqlExecution != null) { + return nonPrimaryKeySqlExecution; + } + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createInsertAutoDynamicCommand(bmd, propertyNames); + } + + protected InternalInsertAutoDynamicCommand createInsertAutoDynamicCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); + cmd.setBeanMetaData(bmd); + cmd.setDataSource(_dataSource); + cmd.setPropertyNames(propertyNames); + cmd.setStatementFactory(_statementFactory); + return cmd; + } + + /** + * @param bmd The meta data of bean. (NotNull) + * @return Whether the method is target. (For example if it has primary key, + * returns false.) + */ + protected SqlExecution createNonPrimaryInsertSqlExecution(BeanMetaData bmd) { + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasPrimaryKey()) { + return null; + } + final List<ColumnInfo> columnInfoList = dbmeta.getColumnInfoList(); + final StringBuilder columnDefSb = new StringBuilder(); + for (jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnDefSb.append(", ").append(columnInfo.getColumnDbName()); + } + columnDefSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final StringBuilder columnValuesSb = new StringBuilder(); + for (jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo columnInfo : columnInfoList) { + columnValuesSb.append(", /*dto.").append( + columnInfo.getPropertyName()).append("*/null"); + } + columnValuesSb.delete(0, ", ".length()).insert(0, "(").append(")"); + final String sql = "insert into " + dbmeta.getTableSqlName() + + columnDefSb + " values" + columnValuesSb; + return createUpdateDynamicCommand(new String[] { "dto" }, + new Class<?>[] { _entityType }, sql); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,152 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCallCommand extends AbstractOutsideSqlCommand<Void> { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "call"; + } + + public Class<?> getCommandReturnType() { + return void.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return true; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlCallCommand(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlCallCommand( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final Object pmb = outsideSqlContext.getParameterBean(); + final String procedureName = outsideSqlContext.getOutsideSqlPath(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final InternalProcedureMetaDataFactory factory = createProcedureMetaDataFactory(); + factory.setValueTypeFactory(_valueTypeFactory); + final Class<?> pmbType = (pmb != null ? pmb.getClass() : null); + final InternalProcedureMetaData metaData = factory + .createProcedureMetaData(procedureName, pmbType); + return createProcedureCommand(metaData); + } + + protected InternalProcedureMetaDataFactory createProcedureMetaDataFactory() { + return new InternalProcedureMetaDataFactory(); + } + + protected InternalProcedureCommand createProcedureCommand( + InternalProcedureMetaData metaData) { + // Because a procedure command does not use result set handler. + final ResultSetHandler resultSetHandler = new InternalNullResultSetHandler(); + return new InternalProcedureCommand(_dataSource, resultSetHandler, + _statementFactory, metaData); + } + + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - + // InternalProcedureCommand switches argument so this is unnecessary + // actually! + // - - - - - - - - - -/ + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_parameterBean == null) { + String msg = "The property 'parameterBean' should not be null"; + msg = msg + " when you call " + methodName + "()."; + throw new IllegalStateException(msg); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,128 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; + +/** + * The behavior command for OutsideSql.execute(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlExecuteCommand extends + AbstractOutsideSqlCommand<Integer> { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "execute"; + } + + public Class<?> getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); + outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); + outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); + outsideSqlContext.setOutsideSqlPath(path); + outsideSqlContext.setParameterBean(pmb); + outsideSqlContext.setMethodName(getCommandName()); + outsideSqlContext.setStatementConfig(option.getStatementConfig()); + outsideSqlContext.setTableDbName(option.getTableDbName()); + outsideSqlContext.setupBehaviorQueryPathIfNeeds(); + OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return generateSpecifiedOutsideSqlUniqueKey(); + } + + protected String generateSpecifiedOutsideSqlUniqueKey() { + final String methodName = getCommandName(); + final String path = _outsideSqlPath; + final Object pmb = _parameterBean; + final OutsideSqlOption option = _outsideSqlOption; + return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( + methodName, path, pmb, option, null); + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return createOutsideSqlExecuteExecution(outsideSqlContext); + } + }; + } + + protected SqlExecution createOutsideSqlExecuteExecution( + OutsideSqlContext outsideSqlContext) { + // - - - - - - - - - - - - - - - - - - - - - - - + // The attribute of Specified-OutsideSqlContext. + // - - - - - - - - - - - - - - - - - - - - - - - + final String suffix = buildDbmsSuffix(); + final String sql = outsideSqlContext.readFilteredOutsideSql( + _sqlFileEncoding, suffix); + final Object pmb = outsideSqlContext.getParameterBean(); + + // - - - - - - - - - - - - - - - + // The attribute of SqlCommand. + // - - - - - - - - - - - - - - - + final String[] argNames = (pmb != null ? new String[] { "pmb" } + : new String[] {}); + final Class<?>[] argTypes = (pmb != null ? new Class<?>[] { pmb + .getClass() } : new Class<?>[] {}); + + return createUpdateDynamicCommand(argNames, argTypes, sql); + } + + public Object[] getSqlExecutionArgument() { + return new Object[] { _parameterBean }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,77 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectCursorCommand extends + AbstractOutsideSqlSelectCommand<Object> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of cursor. (Required) */ + protected CursorHandler _cursorHandler; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCursor"; + } + + public Class<?> getCommandReturnType() { + return Object.class; + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + return new ResultSetHandler() { + public Object handle(ResultSet rs) throws SQLException { + return _cursorHandler.handle(rs); + } + }; + } + + @Override + protected Object getResultTypeSpecification() { + return _cursorHandler; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + assertOutsideSqlBasic(methodName); + if (_cursorHandler == null) { + throw new IllegalStateException(buildAssertMessage( + "_cursorHandler", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCursorHandler(CursorHandler cursorHandler) { + _cursorHandler = cursorHandler; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,96 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; + +/** + * The behavior command for OutsideSql.selectList(). + * + * @author DBFlute(AutoGenerator) + * @param <ENTITY> The type of entity. + */ +public class OutsideSqlSelectListCommand<ENTITY> extends + AbstractOutsideSqlSelectCommand<List<ENTITY>> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class<ENTITY> _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class<?> getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Factory + // ======= + // ----------------------------------------------------- + // BeanMetaData + // ------------ + protected BeanMetaData createBeanMetaData() { + assertEntityType("createBeanMetaData"); + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + // ----------------------------------------------------- + // ResultSetHandler + // ---------------- + protected ResultSetHandler createOutsideSqlBeanListResultSetHandler( + BeanMetaData bmd) { + final ValueType valueType = ValueTypes.getValueType(_entityType); + if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { + return createObjectListResultSetHandler(valueType); + } + return createBeanListMetaDataResultSetHandler(bmd); + } + + //========================================================================== + // ========= + // Extension Point + // =============== + @Override + protected ResultSetHandler createOutsideSqlSelectResultSetHandler() { + final BeanMetaData bmd = createBeanMetaData(); + final ResultSetHandler handler = createOutsideSqlBeanListResultSetHandler(bmd); + return handler; + } + + @Override + protected Object getResultTypeSpecification() { + return _entityType; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertEntityType(String methodName) { + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class<ENTITY> entityType) { + _entityType = entityType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,151 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryDeleteCBCommand extends AbstractBehaviorCommand<Integer> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class<? extends ConditionBean> _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryDelete"; + } + + public Class<?> getCommandReturnType() { + return int.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return true; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return false; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryDeleteCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryDeleteCBExecution( + Class<? extends ConditionBean> cbType) { + return new InternalDeleteQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class<? extends ConditionBean> conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,140 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QueryUpdateEntityCBCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of condition-bean. (Derived from conditionBean) */ + protected Class<? extends ConditionBean> _conditionBeanType; + + /** The instance of condition-bean. (Required) */ + protected ConditionBean _conditionBean; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "queryUpdate"; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + @Override + public boolean isConditionBean() { + return true; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + @Override + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "(" + + _entityType.getSimpleName() + ", " + + _conditionBeanType.getSimpleName() + ")"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + return createQueryUpdateEntityCBExecution(_conditionBeanType); + } + }; + } + + protected SqlExecution createQueryUpdateEntityCBExecution( + Class<? extends ConditionBean> cbType) { + return new InternalUpdateQueryAutoDynamicCommand(_dataSource, + _statementFactory); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] { _conditionBean, _entity }; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return _conditionBean; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + if (_entity == null) { + throw new IllegalStateException(buildAssertMessage("_entity", + methodName)); + } + if (_conditionBeanType == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBeanType", methodName)); + } + if (_conditionBean == null) { + throw new IllegalStateException(buildAssertMessage( + "_conditionBean", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setConditionBeanType( + Class<? extends ConditionBean> conditionBeanType) { + _conditionBeanType = conditionBeanType; + } + + public void setConditionBean(ConditionBean conditionBean) { + _conditionBean = conditionBean; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,65 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCountCBCommand extends AbstractSelectCBCommand<Integer> { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectCount"; + } + + public Class<?> getCommandReturnType() { + return Integer.class; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + cb.xsetupSelectCountIgnoreFetchScope(); // *Point! + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.xafterCareSelectCountIgnoreFetchScope(); + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return true; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,103 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBeanContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param <ENTITY> The type of entity. + */ +public class SelectListCBCommand<ENTITY extends Entity> extends + AbstractSelectCBCommand<List<ENTITY>> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of entity. (Required) */ + protected Class<ENTITY> _entityType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectList"; + } + + public Class<?> getCommandReturnType() { + return List.class; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); + ConditionBeanContext.setConditionBeanOnThread(cb); + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + BeanMetaData bmd = createBeanMetaData(); + ResultSetHandler handler = createBeanListMetaDataResultSetHandler(bmd); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + protected BeanMetaData createBeanMetaData() { + return _beanMetaDataFactory.createBeanMetaData(_entityType); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_entityType == null) { + throw new IllegalStateException(buildAssertMessage("_entityType", + methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setEntityType(Class<ENTITY> entityType) { + _entityType = entityType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,162 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public class SelectNextValCommand<RESULT> extends + AbstractBehaviorCommand<RESULT> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class<RESULT> _resultType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "selectNextVal"; + } + + public Class<?> getCommandReturnType() { + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isConditionBean() { + return false; + } + + public boolean isOutsideSql() { + return false; + } + + public boolean isProcedure() { + return false; + } + + public boolean isSelect() { + return true; + } + + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + } + + public void afterExecuting() { + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public String buildSqlExecutionKey() { + assertStatus("buildSqlExecutionKey"); + return _tableDbName + ":" + getCommandName() + "()"; + } + + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(_resultType); + return createSelectNextValExecution(handler); + } + }; + } + + protected SqlExecution createSelectNextValExecution(ResultSetHandler handler) { + final DBMeta dbmeta = findDBMeta(); + if (!dbmeta.hasSequence()) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.hasSequence() should return true:"; + msg = msg + " dbmeta.hasSequence()=" + dbmeta.hasSequence(); + throw new IllegalStateException(msg); + } + final String nextValSql = dbmeta.getSequenceNextValSql(); + if (nextValSql == null) { + String msg = "If the method 'selectNextVal()' exists, DBMeta.getSequenceNextValSql() should not return null:"; + msg = msg + " dbmeta.getSequenceNextValSql()=" + + dbmeta.getSequenceNextValSql(); + throw new IllegalStateException(msg); + } + return createBasicSelectExecution(handler, new String[] {}, + new Class<?>[] {}, nextValSql); + } + + protected BasicSelectExecution createBasicSelectExecution( + ResultSetHandler handler, String[] argNames, Class<?>[] argTypes, + String sql) { + final BasicSelectExecution cmd = new BasicSelectExecution(_dataSource, + _statementFactory, handler); + cmd.setArgNames(argNames); + cmd.setArgTypes(argTypes); + cmd.setSql(sql); + return cmd; + } + + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableDbName); + } + + public Object[] getSqlExecutionArgument() { + assertStatus("getSqlExecutionArgument"); + return new Object[] {}; + } + + //========================================================================== + // ========= + // Argument Information + // ==================== + public ConditionBean getConditionBean() { + return null; + } + + public String getOutsideSqlPath() { + return null; + } + + public OutsideSqlOption getOutsideSqlOption() { + return null; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertStatus(String methodName) { + assertBasicProperty(methodName); + assertComponentProperty(methodName); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class<RESULT> resultType) { + _resultType = resultType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,112 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; + +import org.seasar.extension.jdbc.ResultSetHandler; + +/** + * @author DBFlute(AutoGenerator) + * @param <RESULT> The type of result. + */ +public class SelectScalarCBCommand<RESULT> extends + AbstractSelectCBCommand<RESULT> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The type of result. (NotNull) */ + protected Class<RESULT> _resultType; + + /** The type of select clause. (NotNull) */ + protected SqlClause.SelectClauseType _selectClauseType; + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + assertStatus("getCommandName"); + final String resultTypeName = _resultType.getSimpleName(); + final String scalarMethodName = _selectClauseType.toString() + .toLowerCase(); + return "scalarSelect(" + resultTypeName + ")." + scalarMethodName; + } + + public Class<?> getCommandReturnType() { + assertStatus("getCommandReturnType"); + return _resultType; + } + + //========================================================================== + // ========= + // Detail Information + // ================== + public boolean isSelectCount() { + return false; + } + + //========================================================================== + // ========= + // Process Callback + // ================ + public void beforeGettingSqlExecution() { + assertStatus("beforeGettingSqlExecution"); + final ConditionBean cb = _conditionBean; + ConditionBeanContext.setConditionBeanOnThread(cb); + cb.getSqlClause().classifySelectClauseType(_selectClauseType); //*Point! + } + + public void afterExecuting() { + assertStatus("afterExecuting"); + final ConditionBean cb = _conditionBean; + cb.getSqlClause().rollbackSelectClauseType(); + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + ResultSetHandler handler = createObjectResultSetHandler(getCommandReturnType()); + return createSelectCBExecution(_conditionBeanType, handler); + } + }; + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + @Override + protected void assertStatus(String methodName) { + super.assertStatus(methodName); + if (_resultType == null) { + throw new IllegalStateException(buildAssertMessage("_resultType", + methodName)); + } + if (_selectClauseType == null) { + throw new IllegalStateException(buildAssertMessage( + "_selectClauseType", methodName)); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setResultType(Class<RESULT> resultType) { + _resultType = resultType; + } + + public void setSelectClauseType(SqlClause.SelectClauseType selectClauseType) { + _selectClauseType = selectClauseType; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,55 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; + +import org.seasar.dao.BeanMetaData; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateEntityCommand extends AbstractEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + public String getCommandName() { + return "update"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + public SqlExecutionCreator createSqlExecutionCreator() { + assertStatus("createSqlExecutionCreator"); + return new SqlExecutionCreator() { + public SqlExecution createSqlExecution() { + final BeanMetaData bmd = createBeanMetaData(); + return createUpdateEntitySqlExecution(bmd); + } + }; + } + + protected SqlExecution createUpdateEntitySqlExecution(BeanMetaData bmd) { + final String[] propertyNames = getPersistentPropertyNames(bmd); + return createUpdateModifiedOnlyCommand(bmd, propertyNames); + } + + protected InternalUpdateModifiedOnlyCommand createUpdateModifiedOnlyCommand( + BeanMetaData bmd, String[] propertyNames) { + final InternalUpdateModifiedOnlyCommand cmd = new InternalUpdateModifiedOnlyCommand( + _dataSource, _statementFactory); + cmd.setBeanMetaData(bmd);// Extension Point! + cmd.setPropertyNames(propertyNames); + cmd.setOptimisticLockHandling(isOptimisticLockHandling()); + cmd.setVersionNoAutoIncrementOnMemory(isOptimisticLockHandling()); + return cmd; + } + + protected boolean isOptimisticLockHandling() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,25 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.command; + +/** + * @author DBFlute(AutoGenerator) + */ +public class UpdateNonstrictEntityCommand extends UpdateEntityCommand { + + //========================================================================== + // ========= + // Basic Information + // ================= + @Override + public String getCommandName() { + return "updateNonstrict"; + } + + //========================================================================== + // ========= + // SqlExecution Handling + // ===================== + @Override + protected boolean isOptimisticLockHandling() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,77 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class BasicSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public BasicSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (Nullable) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,225 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlSelectExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public OutsideSqlSelectExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + if (outsideSqlContext.isDynamicBinding()) { + return executeOutsideSqlAsDynamic(args, outsideSqlContext); + } else { + return executeOutsideSqlAsStatic(args, outsideSqlContext); + } + } + + // ----------------------------------------------------- + // OutsideSql Execute + // ------------------ + /** + * Execute outside-SQL as Dynamic. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsDynamic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final Object firstArg = args[0]; + String staticSql = getSql(); + if (firstArg != null) { + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(firstArg + .getClass()); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Resolve embedded comment for parsing bind variable comment in + // embedded comment. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { + final PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); + final Class<?> propertyType = propertyDesc.getPropertyType(); + if (!propertyType.equals(String.class)) { + continue; + } + final String outsideSqlPiece = (String) propertyDesc + .getValue(firstArg); + if (outsideSqlPiece == null) { + continue; + } + final String embeddedComment = "/*$pmb." + + propertyDesc.getPropertyName() + "*/"; + staticSql = replaceString(staticSql, embeddedComment, + outsideSqlPiece); + } + } + + final OutsideSqlSelectExecution outsideSqlCommand = createDynamicSqlFactory(); + outsideSqlCommand.setArgNames(getArgNames()); + outsideSqlCommand.setArgTypes(getArgTypes()); + outsideSqlCommand.setSql(staticSql); + + final CommandContext ctx = outsideSqlCommand.apply(args); + final List<Object> bindVariableList = new ArrayList<Object>(); + final List<Class<?>> bindVariableTypeList = new ArrayList<Class<?>>(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + /** + * Execute outside-SQL as static. + * + * @param args The array of argument. (NotNull, The first element should be + * the instance of Pmb) + * @param outsideSqlContext The context of outside-SQL. (NotNull) + * @return Result. (Nullable) + */ + protected Object executeOutsideSqlAsStatic(Object[] args, + OutsideSqlContext outsideSqlContext) { + final CommandContext ctx = apply(args); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + ctx.getSql(), this.resultSetHandler); + final Object[] bindVariableArray = ctx.getBindVariables(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, ctx + .getBindVariableTypes()); + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected OutsideSqlSelectExecution createDynamicSqlFactory() { + return new OutsideSqlSelectExecution(getDataSource(), + getStatementFactory(), resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class<?>[] toClassArray(List<Class<?>> bindVariableTypeList) { + final Class<?>[] bindVariableTypesArray = new Class<?>[bindVariableTypeList + .size()]; + for (int i = 0; i < bindVariableTypeList.size(); i++) { + final Class<?> bindVariableType = (Class<?>) bindVariableTypeList + .get(i); + bindVariableTypesArray[i] = bindVariableType; + } + return bindVariableTypesArray; + } + + protected void addBindVariableInfo(CommandContext ctx, + List<Object> bindVariableList, List<Class<?>> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class<?>[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List<Object> bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List<Class<?>> bindVariableTypeList, + Class<?>[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,168 @@ +package jp.sf.pal.timecard.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SelectCBExecution extends InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The handler of resultSet. */ + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param dataSource Data source. + * @param statementFactory The factory of statement. + * @param resultSetHandler The handler of resultSet. + */ + public SelectCBExecution(DataSource dataSource, + StatementFactory statementFactory, ResultSetHandler resultSetHandler) { + super(dataSource, statementFactory); + this.resultSetHandler = resultSetHandler; + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * @param args The array of argument. (NotNull, The first element should be + * the instance of CB) + * @return The object of execution result. (Nullable) + */ + public Object execute(Object[] args) { + final List<Object> bindVariableList = new ArrayList<Object>(); + final List<Class<?>> bindVariableTypeList = new ArrayList<Class<?>>(); + + final String finalClause = setupRealClause(args, bindVariableList, + bindVariableTypeList); + final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( + finalClause, this.resultSetHandler); + final Object[] bindVariableArray = bindVariableList.toArray(); + selectHandler.setLoggingMessageSqlArgs(bindVariableArray); + return selectHandler.execute(bindVariableArray, + toClassArray(bindVariableTypeList)); + } + + // ----------------------------------------------------- + // Setup Clause + // ------------ + protected String setupRealClause(Object[] args, + List<Object> bindVariableList, List<Class<?>> bindVariableTypeList) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + final String realClause; + { + final SelectCBExecution dynamicSqlFactory = createDynamicSqlFactory(); + dynamicSqlFactory.setArgNames(getArgNames()); + dynamicSqlFactory.setArgTypes(getArgTypes()); + dynamicSqlFactory.setSql(cb.getSqlClause().getClause()); + final CommandContext ctx = dynamicSqlFactory.apply(args); + realClause = ctx.getSql(); + addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); + } + return realClause; + } + + //========================================================================== + // ========= + // Dynamic SQL Factory + // =================== + protected SelectCBExecution createDynamicSqlFactory() { + return new SelectCBExecution(getDataSource(), getStatementFactory(), + resultSetHandler); + } + + //========================================================================== + // ========= + // Select Handler + // ============== + protected InternalBasicSelectHandler createBasicSelectHandler( + String realSql, ResultSetHandler rsh) { + return new InternalBasicSelectHandler(getDataSource(), realSql, rsh, + getStatementFactory()); + } + + //========================================================================== + // ========= + // Parser Option + // ============= + @Override + protected boolean isBlockNullParameter() { + return true; // Because the SQL is select. + } + + //========================================================================== + // ========= + // Setup Helper + // ============ + protected Class<?>[] toClassArray(List<Class<?>> bindVariableTypeList) { + final Class<?>[] bindVariableTypesArray = new Class<?>[bindVariableTypeList + .size()]; + for (int i = 0; i < bindVariableTypeList.size(); i++) { + final Class<?> bindVariableType = (Class<?>) bindVariableTypeList + .get(i); + bindVariableTypesArray[i] = bindVariableType; + } + return bindVariableTypesArray; + } + + protected void addBindVariableInfo(CommandContext ctx, + List<Object> bindVariableList, List<Class<?>> bindVariableTypeList) { + final Object[] bindVariables = ctx.getBindVariables(); + addBindVariableList(bindVariableList, bindVariables); + final Class<?>[] bindVariableTypes = ctx.getBindVariableTypes(); + addBindVariableTypeList(bindVariableTypeList, bindVariableTypes); + } + + protected void addBindVariableList(List<Object> bindVariableList, + Object[] bindVariables) { + for (int i = 0; i < bindVariables.length; i++) { + bindVariableList.add(bindVariables[i]); + } + } + + protected void addBindVariableTypeList(List<Class<?>> bindVariableTypeList, + Class<?>[] bindVariableTypes) { + for (int i = 0; i < bindVariableTypes.length; i++) { + bindVariableTypeList.add(bindVariableTypes[i]); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -24,6 +24,28 @@ public abstract class AbstractConditionBean implements ConditionBean { //========================================================================== + // =========== + // Definition + // ========== + /** Map-string map-mark. */ + private static final String MAP_STRING_MAP_MARK = "map:"; + + /** Map-string list-mark. */ + private static final String MAP_STRING_LIST_MARK = "list:"; + + /** Map-string start-brace. */ + private static final String MAP_STRING_START_BRACE = "@{"; + + /** Map-string end-brace. */ + private static final String MAP_STRING_END_BRACE = "@}"; + + /** Map-string delimiter. */ + private static final String MAP_STRING_DELIMITER = "@;"; + + /** Map-string equal. */ + private static final String MAP_STRING_EQUAL = "@="; + + //========================================================================== // ========= // Attribute // ========= @@ -41,8 +63,12 @@ // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check // logics by these purpose types. - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; + protected boolean _forScalarSelect; + + protected boolean _forScalarSubQuery; + protected boolean _forUnion; protected boolean _forExistsSubQuery; @@ -73,27 +99,6 @@ //========================================================================== // ========= - // ConditionQuery - // ============== - /** - * Get condition query as interface. At the future, change public to - * protected. - * - * @return Instance of query as interface. (NotNull) - */ - abstract public ConditionQuery getConditionQueryAsInterface(); - - /** - * The implementation. - * - * @return The conditionQuery of the local table as interface. (NotNull) - */ - public ConditionQuery localCQ() { - return getConditionQueryAsInterface(); - } - - //========================================================================== - // ========= // Accept PrimaryKey // ================= /** @@ -498,42 +503,6 @@ //========================================================================== // ========= - // Limit Select - // ============ - /** Is limit-select PK only? */ - protected boolean _isLimitSelectPKOnly; - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly() { - return _isLimitSelectPKOnly; - } - - /** - * Limit select PK only. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly() { - _isLimitSelectPKOnly = true; - return this; - } - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off() { - _isLimitSelectPKOnly = false; - return this; - } - - //========================================================================== - // ========= // Lock Setting // ============ /** @@ -559,11 +528,8 @@ public ConditionBean xsetupSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = true; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().ignoreIncludedSelectColumn(); - } - + getSqlClause().classifySelectClauseType( + SqlClause.SelectClauseType.COUNT); getSqlClause().ignoreOrderBy(); getSqlClause().ignoreFetchScope(); return this; @@ -578,11 +544,7 @@ public ConditionBean xafterCareSelectCountIgnoreFetchScope() { _isSelectCountIgnoreFetchScope = false; - // If the query uses union query, it needs included-select-column. - if (!hasUnionQueryOrUnionAllQuery()) { - getSqlClause().makeIncludedSelectColumnEffective(); - } - + getSqlClause().rollbackSelectClauseType(); getSqlClause().makeOrderByEffective(); getSqlClause().makeFetchScopeEffective(); return this; @@ -613,20 +575,29 @@ protected CQ _query; - protected boolean _forDeriveReferrer; + protected boolean _forDerivedReferrer; - protected boolean alreadySpecifyRequiredColumn; + protected boolean _forScalarSelect; + protected boolean _forScalarSubQuery; + + protected boolean _alreadySpecifyRequiredColumn; + /** * @param baseCB The condition-bean of base level. (NotNull) - * @param qyCall The callback for condition-query. (NotNull) - * @param forDeriveReferrer Is this for derive referrer? + * @param qyCall The call-back for condition-query. (NotNull) + * @param forDerivedReferrer Is this for derive referrer? + * @param forScalarSelect Is this for scalar select? + * @param forScalarSubQuery Is this for scalar sub-query? */ protected AbstractSpecification(ConditionBean baseCB, - SpQyCall<CQ> qyCall, boolean forDeriveReferrer) { + SpQyCall<CQ> qyCall, boolean forDerivedReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { _baseCB = baseCB; _qyCall = qyCall; - _forDeriveReferrer = forDeriveReferrer; + _forDerivedReferrer = forDerivedReferrer; + _forScalarSelect = forScalarSelect; + _forScalarSubQuery = forScalarSubQuery; } protected void doColumn(String columnName) { @@ -634,8 +605,8 @@ if (_query == null) { _query = _qyCall.qy(); } - if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { - alreadySpecifyRequiredColumn = true; + if (isRequiredColumnSpecificationEnabled()) { + _alreadySpecifyRequiredColumn = true; doSpecifyRequiredColumn(); } String relationPath = _query.getRelationPath() != null ? _query @@ -652,6 +623,11 @@ columnName); } + protected boolean isRequiredColumnSpecificationEnabled() { + return !_forDerivedReferrer && !_forScalarSelect + && !_forScalarSubQuery && !_alreadySpecifyRequiredColumn; + } + protected void assertColumn(String columnName) { if (_query == null && !_qyCall.has()) { throwSpecifyColumnNotSetupSelectColumnException(columnName); @@ -659,9 +635,15 @@ } protected void assertForeign(String foreignPropertyName) { - if (_forDeriveReferrer) { - throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + if (_forDerivedReferrer) { + throwDerivedReferrerInvalidForeignSpecificationException(foreignPropertyName); } + if (_forScalarSelect) { + throwScalarSelectInvalidForeignSpecificationException(foreignPropertyName); + } + if (_forScalarSubQuery) { + throwScalarSubQueryInvalidForeignSpecificationException(foreignPropertyName); + } } protected abstract void doSpecifyRequiredColumn(); @@ -714,19 +696,19 @@ throw new SpecifyColumnNotSetupSelectColumnException(msg); } - protected void throwDeriveReferrerInvalidForeignSpecificationException( + protected void throwDerivedReferrerInvalidForeignSpecificationException( String foreignPropertyName) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "You specified a foreign table column in spite of derive-sub-query!" + + "You specified a foreign table column in spite of derived-referrer!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); msg = msg - + "You should specified a local table column at condition-bean for derive-sub-query." + + "You should specified a local table column at condition-bean for derived-referrer." + getLineSeparator(); msg = msg + " For example:" + getLineSeparator(); msg = msg + " " + getLineSeparator(); @@ -736,7 +718,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery<PurchaseCB>() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -754,7 +736,7 @@ msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); msg = msg - + " cb.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + " cb.specify().derivedPurchaseList().max(new SubQuery<PurchaseCB>() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -769,9 +751,117 @@ msg = msg + "[Specified Foreign Property]" + getLineSeparator() + foreignPropertyName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidForeignSpecificationException(msg); + throw new DerivedReferrerInvalidForeignSpecificationException(msg); } + protected void throwScalarSelectInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of scalar select!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for scalar select." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Integer.class).max(new ScalarSelect<MemberCB>() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + + " memberBhv.scalarSelect(Date.class).max(new ScalarSelect() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB cb) {" + + getLineSeparator(); + msg = msg + + " cb.specify().columnMemberBirthday(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSelectInvalidForeignSpecificationException(msg); + } + + protected void throwScalarSubQueryInvalidForeignSpecificationException( + String foreignPropertyName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "You specified a foreign table column in spite of derived-query!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derived-query." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery<MemberCB>() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyMemberStatusName().columnDisplayOrder(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.query().scalar_Equal().max(new SubQuery<MemberCB>() {" + + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberBirthday();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidForeignSpecificationException(msg); + } + protected String getLineSeparator() { return SimpleSystemUtil.getLineSeparator(); } @@ -792,15 +882,33 @@ } } - public static class DeriveReferrerInvalidForeignSpecificationException + public static class DerivedReferrerInvalidForeignSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidForeignSpecificationException(String msg) { + public DerivedReferrerInvalidForeignSpecificationException(String msg) { super(msg); } } + public static class ScalarSubQueryInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class ScalarSelectInvalidForeignSpecificationException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSelectInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + public static class RAFunction<REFERRER_CB extends ConditionBean, LOCAL_CQ extends ConditionQuery> { protected ConditionBean _baseCB; @@ -815,6 +923,18 @@ _querySetupper = querySetupper; } + public void count(SubQuery<REFERRER_CB> subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); + } + + public void countDistinct(SubQuery<REFERRER_CB> subQuery, + String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("count(distinct", subQuery, _localCQ, + aliasName.trim()); + } + public void max(SubQuery<REFERRER_CB> subQuery, String aliasName) { assertAliasName(aliasName); _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); @@ -835,14 +955,9 @@ _querySetupper.setup("avg", subQuery, _localCQ, aliasName.trim()); } - public void count(SubQuery<REFERRER_CB> subQuery, String aliasName) { - assertAliasName(aliasName); - _querySetupper.setup("count", subQuery, _localCQ, aliasName.trim()); - } - protected void assertAliasName(String aliasName) { if (aliasName == null || aliasName.trim().length() == 0) { - throwDeriveReferrerInvalidAliasNameException(); + throwDerivedReferrerInvalidAliasNameException(); } DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB .getTableDbName()); @@ -860,17 +975,17 @@ } } if (!existsSetterMethod) { - throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + throwDerivedReferrerEntityPropertyNotFoundException(aliasName, dbmeta.getEntityType()); } } - protected void throwDeriveReferrerInvalidAliasNameException() { + protected void throwDerivedReferrerInvalidAliasNameException() { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The alias name for derive-referrer was Invalid!" + msg = msg + "The alias name for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -915,17 +1030,17 @@ msg = msg + "[Local Table]" + getLineSeparator() + _localCQ.getTableDbName() + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidAliasNameException(msg); + throw new DerivedReferrerInvalidAliasNameException(msg); } - protected void throwDeriveReferrerEntityPropertyNotFoundException( + protected void throwDerivedReferrerEntityPropertyNotFoundException( String aliasName, Class<?> entityType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); msg = msg - + "A property for derive-referrer was Not Found in the entity!" + + "A property for derived-referrer was Not Found in the entity!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -981,7 +1096,7 @@ msg = msg + "[Target Entity]" + getLineSeparator() + entityType + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerEntityPropertyNotFoundException(msg); + throw new DerivedReferrerEntityPropertyNotFoundException(msg); } protected String replaceString(String text, String fromText, @@ -999,20 +1114,20 @@ LOCAL_CQ cq, String aliasName); } - public static class DeriveReferrerInvalidAliasNameException extends + public static class DerivedReferrerInvalidAliasNameException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidAliasNameException(String msg) { + public DerivedReferrerInvalidAliasNameException(String msg) { super(msg); } } - public static class DeriveReferrerEntityPropertyNotFoundException extends + public static class DerivedReferrerEntityPropertyNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerEntityPropertyNotFoundException(String msg) { + public DerivedReferrerEntityPropertyNotFoundException(String msg) { super(msg); } } @@ -1042,7 +1157,6 @@ protected void doSetupSelect(SsCall callback) { String foreignPropertyName = callback.qf().getForeignPropertyName(); assertSetupSelectBeforeUnion(foreignPropertyName); - limitSelect_Off(); String foreignTableAliasName = callback.qf().getRealAliasName(); String localRelationPath = localCQ().getRelationPath(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1164,19 +1278,27 @@ // ========= // Purpose Type // ============ - public void xsetupForDeriveReferrer() { - _forDeriveReferrer = true; + public void xsetupForDerivedReferrer() { // Very Internal + _forDerivedReferrer = true; } - public void xsetupForUnion() { + public void xsetupForScalarSelect() { // Very Internal + _forScalarSelect = true; + } + + public void xsetupForScalarSubQuery() { // Very Internal + _forScalarSubQuery = true; + } + + public void xsetupForUnion() { // Very Internal _forUnion = true; } - public void xsetupForExistsSubQuery() { + public void xsetupForExistsSubQuery() { // Very Internal _forExistsSubQuery = true; } - public void xsetupForInScopeSubQuery() { + public void xsetupForInScopeSubQuery() { // Very Internal _forInScopeSubQuery = true; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -48,12 +48,14 @@ protected static final ConditionKey CK_PS = ConditionKey.CK_PREFIX_SEARCH; - protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; - protected static final ConditionKey CK_INS = ConditionKey.CK_IN_SCOPE; protected static final ConditionKey CK_NINS = ConditionKey.CK_NOT_IN_SCOPE; + protected static final ConditionKey CK_LS = ConditionKey.CK_LIKE_SEARCH; + + protected static final ConditionKey CK_NLS = ConditionKey.CK_NOT_LIKE_SEARCH; + protected static final ConditionKey CK_ISN = ConditionKey.CK_IS_NULL; protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; @@ -351,15 +353,7 @@ String msg = "The argument[unionQuery] should not be null."; throw new IllegalArgumentException(msg); } - reflectRelationOnUnionQuery(this, unionQuery);// Reflect Relation! - getSqlClause().copyIncludedSelectColumn(unionQuery.getSqlClause());// Reflect - // IncludedSelectColumn - // ! - if (getSqlClause().isFormatClauseEffective()) { - unionQuery.getSqlClause().makeFormatClauseEffective();// Reflect - // FormatClause - // ! - } + reflectRelationOnUnionQuery(this, unionQuery); // Reflect Relation! String key = (unionAll ? "unionAllQuery" : "unionQuery") + unionQueryMap.size(); unionQueryMap.put(key, unionQuery); @@ -416,22 +410,6 @@ // Register // ======== // ----------------------------------------------------- - // Include-As-Mine - // --------------- - /** - * Register included-select-column. - * - * @param aliasName Alias name. This should not contain comma. (NotNull) - * @param realColumnName Real column name. This should not contain comma. - * (NotNull) - * @deprecated Unsupported! - */ - protected void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - throw new UnsupportedOperationException(); - } - - // ----------------------------------------------------- // Query // ----- protected void registerQuery(ConditionKey key, Object value, @@ -488,6 +466,13 @@ // ----------------------------------------------------- // LikeSearch Query // ---------------- + protected void regLSQ(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + registerLikeSearchQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + @SuppressWarnings("deprecation") protected void registerLikeSearchQuery(ConditionKey key, String value, ConditionValue cvalue, String colName, String capPropName, @@ -700,25 +685,20 @@ assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; String realColumnName = getInScopeSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getInScopeSubQuerySql(subQuery, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = realColumnName + " " + inScopeOption + "in (" + beginMark - + subQueryClause + ln + endIndent + ")" + endMark; - } else { - clause = realColumnName + " " + inScopeOption + "in (" - + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = realColumnName + " " + inScopeOption + "in (" + + beginMark + subQueryClause + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -728,22 +708,11 @@ protected String getInScopeSubQuerySql(ConditionQuery subQuery, String relatedColumnName, String propertyName) { - String selectClause = "select " - + getSqlClause().getLocalTableAliasName() + "." + String tableAliasName = getSqlClause().getLocalTableAliasName(); + String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - + String fromWhereClause = buildPlainSubQueryFromWhereClause(subQuery, + relatedColumnName, propertyName, selectClause, tableAliasName); return selectClause + " " + fromWhereClause; } @@ -769,24 +738,20 @@ assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); existsOption = existsOption != null ? existsOption + " " : ""; String realColumnName = getExistsSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); String subQueryClause = getExistsSubQuerySql(subQuery, realColumnName, relatedColumnName, propertyName); - String clause = null; - if (getSqlClause().isFormatClauseEffective()) { - String ln = getLineSeparator(); - int subQueryLevel = subQuery.getSubQueryLevel(); - String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; - String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - String endIndent = " "; - clause = existsOption + "exists (" + beginMark + subQueryClause - + ln + endIndent + ")" + endMark; - } else { - clause = existsOption + "exists (" + subQueryClause + ")"; - } + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = existsOption + "exists (" + beginMark + subQueryClause + + ln + endIndent + ")" + endMark; registerWhereClause(clause); } @@ -801,134 +766,116 @@ protected String getExistsSubQuerySql(ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName) { int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } String tableAliasName = "dfsublocal_" + subQueryLevel; String selectClause = "select " + tableAliasName + "." + relatedColumnName; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - String joinCondition = tableAliasName + "." + relatedColumnName + " = " - + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; - } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); return selectClause + " " + fromWhereClause; } // [DBFlute-0.7.4] // ----------------------------------------------------- - // DeriveSubQuery - // -------------- - protected void registerDeriveSubQuery(String function, + // DerivedReferrerSubQuery + // ----------------------- + protected void registerDerivedReferrerSubQuery(String function, ConditionQuery subQuery, String columnName, String relatedColumnName, String propertyName, String aliasName) { - assertObjectNotNull("DeriveSubQuery(" + columnName + ")", subQuery); - final String realColumnName = getDeriveSubQueryRealColumnName(columnName); - final String subQueryClause = getDeriveSubQuerySql(function, subQuery, - realColumnName, relatedColumnName, propertyName, aliasName); - final String clause; - if (getSqlClause().isFormatClauseEffective()) { - final String ln = getLineSeparator(); - final int subQueryLevel = subQuery.getSubQueryLevel(); - final String subQueryIdentity = propertyName + "[" + subQueryLevel - + "]"; - final String beginMark = getSqlClause().resolveSubQueryBeginMark( - subQueryIdentity) - + ln; - final String endMark = getSqlClause().resolveSubQueryEndMark( - subQueryIdentity); - final String endIndent = " "; - clause = "(" + beginMark + subQueryClause + ln + endIndent - + ") as " + aliasName + endMark; - } else { - clause = "(" + subQueryClause + ") as " + aliasName; - } + assertObjectNotNull("DerivedReferrerSubQuery(function)", function); + assertObjectNotNull("DerivedReferrerSubQuery(" + columnName + ")", + subQuery); + String realColumnName = getDerivedReferrerSubQueryRealColumnName(columnName); + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getDerivedReferrerSubQuerySql(function, + subQuery, realColumnName, relatedColumnName, propertyName, + aliasName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = "(" + beginMark + subQueryClause + ln + endIndent + + ") " + aliasName + endMark; getSqlClause().specifyDeriveSubQuery(aliasName, clause); } - protected String getDeriveSubQueryRealColumnName(String columnName) { + protected String getDerivedReferrerSubQueryRealColumnName(String columnName) { return getRealColumnName(columnName); } - protected String getDeriveSubQuerySql(String function, + protected String getDerivedReferrerSubQuerySql(String function, ConditionQuery subQuery, String realColumnName, String relatedColumnName, String propertyName, String aliasName) { - final int subQueryLevel = subQuery.getSubQueryLevel(); - if (_subQueryLevel <= subQueryLevel) { - _subQueryLevel = subQueryLevel + 1; - } - final String tableAliasName = "dfsublocal_" + subQueryLevel; - final String deriveColumnName = subQuery.getSqlClause() + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() .getSpecifiedColumnNameAsOne(); if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { - throwDeriveReferrerInvalidColumnSpecificationException(function, + throwDerivedReferrerInvalidColumnSpecificationException(function, aliasName); } - assertDeriveReferrerColumnType(function, subQuery, deriveColumnName); - subQuery.getSqlClause().clearSpecifiedSelectColumn(); - final String selectClause = "select " + function + "(" + tableAliasName - + "." + deriveColumnName + ")"; - String fromWhereClause = subQuery.getSqlClause() - .getClauseFromWhereWithWhereUnionTemplate(); - fromWhereClause = replaceString(fromWhereClause, "dflocal", - tableAliasName);// Very Important! - fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", - "." + getLocationBase(propertyName) + ".");// Very Important! - - final String joinCondition = tableAliasName + "." + relatedColumnName - + " = " + realColumnName; - String firstConditionAfter = " and "; - if (getSqlClause().isFormatClauseEffective()) { - firstConditionAfter = getLineSeparator() + " and "; + assertDerivedReferrerColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + String connect = xbuildFunctionConnector(function); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The derived-referrer is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + relatedColumnName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + String joinCondition = "dfsubquerymain." + relatedColumnName + + " = " + realColumnName; + return "select " + function + connect + "dfsubquerymain." + + deriveColumnName + ")" + ln + " from (" + beginMark + + mainSql + ln + " ) dfsubquerymain" + endMark + ln + + " where " + joinCondition; + } else { + String selectClause = "select " + function + connect + + tableAliasName + "." + deriveColumnName + ")"; + String fromWhereClause = buildCorrelationSubQueryFromWhereClause( + subQuery, relatedColumnName, propertyName, selectClause, + tableAliasName, realColumnName); + return selectClause + " " + fromWhereClause; } - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereClauseMark(), "where " + joinCondition); - fromWhereClause = replaceString(fromWhereClause, getSqlClause() - .getUnionWhereFirstConditionMark(), joinCondition - + firstConditionAfter); - - return selectClause + " " + fromWhereClause; } - protected void throwDeriveReferrerInvalidColumnSpecificationException( + protected void throwDerivedReferrerInvalidColumnSpecificationException( String function, String aliasName) { + String method = xconvertFunctionToMethod(function); String msg = "Look! Read the message below." + getLineSeparator(); msg = msg + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + getLineSeparator(); - msg = msg + "The specified the column for derive-referrer was Invalid!" + msg = msg + + "The specified the column for derived-referrer was Invalid!" + getLineSeparator(); msg = msg + getLineSeparator(); msg = msg + "[Advice]" + getLineSeparator(); @@ -941,7 +888,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery<PurchaseCB>() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -955,7 +902,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery<PurchaseCB>() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -973,7 +920,7 @@ msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + getLineSeparator(); msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); - msg = msg + " cb.specify().derivePurchaseList()." + function + msg = msg + " cb.specify().derivePurchaseList()." + method + "(new SubQuery<PurchaseCB>() {" + getLineSeparator(); msg = msg + " public void query(PurchaseCB subCB) {" + getLineSeparator(); @@ -988,19 +935,19 @@ msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerInvalidColumnSpecificationException(msg); + throw new DerivedReferrerInvalidColumnSpecificationException(msg); } - public static class DeriveReferrerInvalidColumnSpecificationException + public static class DerivedReferrerInvalidColumnSpecificationException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerInvalidColumnSpecificationException(String msg) { + public DerivedReferrerInvalidColumnSpecificationException(String msg) { super(msg); } } - protected void assertDeriveReferrerColumnType(String function, + protected void assertDerivedReferrerColumnType(String function, ConditionQuery subQuery, String deriveColumnName) { final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery .getTableDbName()); @@ -1009,13 +956,13 @@ if ("sum".equalsIgnoreCase(function) || "avg".equalsIgnoreCase(function)) { if (!Number.class.isAssignableFrom(deriveColumnType)) { - throwDeriveReferrerUnmatchedColumnTypeException(function, + throwDerivedReferrerUnmatchedColumnTypeException(function, deriveColumnName, deriveColumnType); } } } - protected void throwDeriveReferrerUnmatchedColumnTypeException( + protected void throwDerivedReferrerUnmatchedColumnTypeException( String function, String deriveColumnName, Class<?> deriveColumnType) { String msg = "Look! Read the message below." + getLineSeparator(); msg = msg @@ -1040,19 +987,366 @@ msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); msg = msg + "* * * * * * * * * */"; - throw new DeriveReferrerUnmatchedColumnTypeException(msg); + throw new DerivedReferrerUnmatchedColumnTypeException(msg); } - public static class DeriveReferrerUnmatchedColumnTypeException extends + public static class DerivedReferrerUnmatchedColumnTypeException extends RuntimeException { private static final long serialVersionUID = 1L; - public DeriveReferrerUnmatchedColumnTypeException(String msg) { + public DerivedReferrerUnmatchedColumnTypeException(String msg) { super(msg); } } + // [DBFlute-0.8.8] // ----------------------------------------------------- + // ScalarSubQuery + // -------------- + protected void registerScalarSubQuery(String function, + ConditionQuery subQuery, String propertyName, String operand) { + assertObjectNotNull("ScalarSubQuery(" + propertyName + ")", subQuery); + + // Get the specified column before it disappears at sub-query making. + String deriveRealColumnName; + { + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null + || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + deriveRealColumnName = getScalarSubQueryRealColumnName(deriveColumnName); + } + + xincrementLocalSubQueryLevelIfNeeds(subQuery); + String subQueryClause = getScalarSubQuerySql(function, subQuery, + propertyName); + String ln = getLineSeparator(); + int subQueryLevel = subQuery.getSubQueryLevel(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + "]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause() + .resolveSubQueryEndMark(subQueryIdentity); + String endIndent = " "; + String clause = deriveRealColumnName + " " + operand + " (" + beginMark + + subQueryClause + ln + endIndent + ") " + endMark; + registerWhereClause(clause); + } + + protected String getScalarSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getScalarSubQuerySql(String function, + ConditionQuery subQuery, String propertyName) { + int subQueryLevel = subQuery.getSubQueryLevel(); + String tableAliasName = "dfsublocal_" + subQueryLevel; + String deriveColumnName = subQuery.getSqlClause() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwScalarSubQueryInvalidColumnSpecificationException(function); + } + assertScalarSubQueryColumnType(function, subQuery, deriveColumnName); + subQuery.getSqlClause().clearSpecifiedSelectColumn(); // specified + // columns + // disappear at + // this timing + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + if (!dbmeta.hasPrimaryKey() || dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The scalar-sub-query is unsupported when no primary key or two-or-more primary keys:"; + msg = msg + " table=" + subQuery.getTableDbName(); + throw new UnsupportedOperationException(msg); + } + String primaryKeyName = dbmeta.getPrimaryUniqueInfo().getFirstColumn() + .getColumnDbName(); + if (subQuery.getSqlClause().hasUnionQuery()) { + String ln = getLineSeparator(); + String subQueryIdentity = propertyName + "[" + subQueryLevel + + ":subquerymain]"; + String beginMark = getSqlClause().resolveSubQueryBeginMark( + subQueryIdentity) + + ln; + String endMark = getSqlClause().resolveSubQueryEndMark( + subQueryIdentity); + String selectClause = "select " + tableAliasName + "." + + primaryKeyName + ", " + tableAliasName + "." + + deriveColumnName; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + String mainSql = selectClause + " " + fromWhereClause; + return "select " + function + "(dfsubquerymain." + deriveColumnName + + ")" + ln + " from (" + beginMark + mainSql + ln + + " ) dfsubquerymain" + endMark; + } else { + String selectClause = "select " + function + "(" + tableAliasName + + "." + deriveColumnName + ")"; + String fromWhereClause = buildPlainSubQueryFromWhereClause( + subQuery, primaryKeyName, propertyName, selectClause, + tableAliasName); + return selectClause + " " + fromWhereClause; + } + } + + protected void throwScalarSubQueryInvalidColumnSpecificationException( + String function) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The specified the column for derived-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + " You should call specify().column[TargetColumn]() only once." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery<MemberCB>() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery<MemberCB>() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnMemberBirthday();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnMemberName(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.query().scalar_Equal()." + function + + "(new SubQuery<MemberCB>() {" + getLineSeparator(); + msg = msg + " public void query(MemberCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryInvalidColumnSpecificationException(msg); + } + + public static class ScalarSubQueryInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertScalarSubQueryColumnType(String function, + ConditionQuery subQuery, String deriveColumnName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(subQuery + .getTableDbName()); + final Class<?> deriveColumnType = dbmeta.findColumnInfo( + deriveColumnName).getPropertyType(); + if ("sum".equalsIgnoreCase(function) + || "avg".equalsIgnoreCase(function)) { + if (!Number.class.isAssignableFrom(deriveColumnType)) { + throwScalarSubQueryUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwScalarSubQueryUnmatchedColumnTypeException( + String function, String deriveColumnName, Class<?> deriveColumnType) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The type of the specified the column unmatched with the function!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should confirm the list as follow:" + + getLineSeparator(); + msg = msg + " max() : String, Number, Date" + getLineSeparator(); + msg = msg + " min() : String, Number, Date" + getLineSeparator(); + msg = msg + " sum() : Number" + getLineSeparator(); + msg = msg + " avg() : Number" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Function]" + getLineSeparator() + function + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Derive Column]" + getLineSeparator() + deriveColumnName + + "(" + deriveColumnType.getName() + ")" + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new ScalarSubQueryUnmatchedColumnTypeException(msg); + } + + public static class ScalarSubQueryUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public ScalarSubQueryUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + public static class SSQFunction<CB extends ConditionBean> { + protected SSQSetupper<CB> _setupper; + + public SSQFunction(SSQSetupper<CB> setupper) { + _setupper = setupper; + } + + public void max(SubQuery<CB> subQuery) { + _setupper.setup("max", subQuery); + } + + public void min(SubQuery<CB> subQuery) { + _setupper.setup("min", subQuery); + } + + public void sum(SubQuery<CB> subQuery) { + _setupper.setup("sum", subQuery); + } + + public void avg(SubQuery<CB> subQuery) { + _setupper.setup("avg", subQuery); + } + } + + protected static interface SSQSetupper<CB extends ConditionBean> { + public void setup(String function, SubQuery<CB> subQuery); + } + + // ----------------------------------------------------- + // SubQuery Common + // --------------- + protected String buildPlainSubQueryFromWhereClause(ConditionQuery subQuery, + String relatedColumnName, String propertyName, String selectClause, + String tableAliasName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + // However when it's inScope this replacement is unnecessary so comment + // out here. + // (Override base alias name at sub-query on SQL) + // So if the argument 'tableAliasName' is not null, replace it. + if (tableAliasName != null) { + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + } + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), ""); + return fromWhereClause; + } + + protected String buildCorrelationSubQueryFromWhereClause( + ConditionQuery subQuery, String relatedColumnName, + String propertyName, String selectClause, String tableAliasName, + String realColumnName) { + String fromWhereClause = subQuery.getSqlClause() + .getClauseFromWhereWithWhereUnionTemplate(); + + // Replace the alias names for local table with alias name of sub-query + // unique. + fromWhereClause = replaceString(fromWhereClause, "dflocal", + tableAliasName); + + // Resolve the location path for the condition-query of sub-query. + fromWhereClause = replaceString(fromWhereClause, ".conditionQuery.", + "." + getLocationBase(propertyName) + "."); + + String joinCondition = tableAliasName + "." + relatedColumnName + " = " + + realColumnName; + String firstConditionAfter = getLineSeparator() + " and "; + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereClauseMark(), "where " + joinCondition); + fromWhereClause = replaceString(fromWhereClause, getSqlClause() + .getUnionWhereFirstConditionMark(), joinCondition + + firstConditionAfter); + return fromWhereClause; + } + + protected void xincrementLocalSubQueryLevelIfNeeds(ConditionQuery subQuery) { // Very + // Internal + int subQueryLevel = subQuery.getSubQueryLevel(); + if (_subQueryLevel <= subQueryLevel) { + _subQueryLevel = subQueryLevel + 1; + } + } + + protected String xbuildFunctionConnector(String function) { + if (function != null && function.endsWith("(distinct")) { // For example + // 'count(distinct' + return " "; + } else { + return "("; + } + } + + protected String xconvertFunctionToMethod(String function) { + if (function != null && function.contains("(")) { // For example + // 'count(distinct' + int index = function.indexOf("("); + String front = function.substring(0, index); + if (function.length() > front.length() + "(".length()) { + String rear = function.substring(index + "(".length()); + function = front + initCap(rear); + } else { + function = front; + } + } + return function; + } + + // ----------------------------------------------------- // Where Clause // ------------ protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, @@ -1276,14 +1570,16 @@ // ========= // Fixed Condition // =============== - protected String prepareFixedCondition(String fixedCondition, - String localAliasName, String foreignAliasName) { + protected String ppFxCd(String fixedCondition, String localAliasName, + String foreignAliasName) { // prepareFixedCondition fixedCondition = replaceString(fixedCondition, "$$alias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", foreignAliasName); fixedCondition = replaceString(fixedCondition, "$$localAlias$$", localAliasName); + fixedCondition = replaceString(fixedCondition, "$$locationBase$$.", + "dto." + getLocationBase()); return fixedCondition; } @@ -1515,7 +1811,7 @@ return newList; } - public void doNss(NssCall callback) {// Very Internal + public void doNss(NssCall callback) { // Very Internal String foreignPropertyName = callback.qf().getForeignPropertyName(); String foreignTableAliasName = callback.qf().getRealAliasName(); getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, @@ -1524,7 +1820,7 @@ callback.qf().getRelationPath(), foreignPropertyName); } - public static interface NssCall {// Very Internal + public static interface NssCall { // Very Internal public ConditionQuery qf(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,5 +1,7 @@ package jp.sf.pal.timecard.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; @@ -11,28 +13,6 @@ public interface ConditionBean extends PagingBean { //========================================================================== - // =========== - // Definition - // ========== - /** Map-string map-mark. */ - public static final String MAP_STRING_MAP_MARK = "map:"; - - /** Map-string list-mark. */ - public static final String MAP_STRING_LIST_MARK = "list:"; - - /** Map-string start-brace. */ - public static final String MAP_STRING_START_BRACE = "@{"; - - /** Map-string end-brace. */ - public static final String MAP_STRING_END_BRACE = "@}"; - - /** Map-string delimiter. */ - public static final String MAP_STRING_DELIMITER = "@;"; - - /** Map-string equal. */ - public static final String MAP_STRING_EQUAL = "@="; - - //========================================================================== // ========= // Table Name // ========== @@ -70,8 +50,7 @@ * * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) */ - public void acceptPrimaryKeyMap( - java.util.Map<String, ? extends Object> primaryKeyMap); + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap); /** * Accept primary-key map-string. Delimiter is at-mark and semicolon. @@ -105,14 +84,6 @@ // Query // ===== /** - * Get condition-query as interface. - * - * @return Instance of query as interface. (NotNull) - * @deprecated - */ - public ConditionQuery getConditionQueryAsInterface(); - - /** * Get the conditionQuery of the local table as interface. * * @return The conditionQuery of the local table as interface. (NotNull) @@ -131,32 +102,6 @@ public boolean hasUnionQueryOrUnionAllQuery(); //========================================================================== - // ========= - // Limit Select - // ============ - /** - * Limit select PK only. This is OLD style. You can do the same thing by - * specify(). - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_PKOnly(); - - /** - * Limit select off. - * - * @return this. (NotNull) - */ - public ConditionBean limitSelect_Off(); - - /** - * Is limit-select PK only? - * - * @return Determination. - */ - public boolean isLimitSelect_PKOnly(); - - //========================================================================== // =========== // Lock Setting // ============ Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,10 +1,6 @@ package jp.sf.pal.timecard.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClauseDerby; @@ -78,11 +74,35 @@ //========================================================================== // ========= - // Initialize against the ClassLoader Headache - // =========================================== + // Type Determination + // ================== + /** + * Is the argument condition-bean? + * + * @param dtoInstance DTO instance. + * @return Determination. + */ + public static boolean isTheArgumentConditionBean(final Object dtoInstance) { + return dtoInstance instanceof ConditionBean; + } + + /** + * Is the type condition-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeConditionBean(final Class<?> dtoClass) { + return ConditionBean.class.isAssignableFrom(dtoClass); + } + + //========================================================================== + // ========= + // Cool Classes + // ============ @SuppressWarnings("unused") - public static void initialize() { - boolean debugEnabled = _log.isDebugEnabled(); + public static void loadCoolClasses() { + boolean debugEnabled = false; // If you watch the log, set this true. // Against the ClassLoader Headache! final StringBuilder sb = new StringBuilder(); { @@ -119,120 +139,6 @@ //========================================================================== // ========= - // Type Determination - // ================== - /** - * Is the argument condition-bean? - * - * @param dtoInstance DTO instance. - * @return Determination. - */ - public static boolean isTheArgumentConditionBean(final Object dtoInstance) { - if (dtoInstance instanceof ConditionBean) { - return true; - } else { - return false; - } - } - - /** - * Is the type condition-bean? - * - * @param dtoClass DtoClass. - * @return Determination. - */ - public static boolean isTheTypeConditionBean(final Class<?> dtoClass) { - if (ConditionBean.class.isAssignableFrom(dtoClass)) { - return true; - } else { - return false; - } - } - - //========================================================================== - // ========= - // Product Name - // ============ - public static final String DB_NAME_DERBY = "derby"; - - public static final String DB_NAME_H2 = "h2"; - - public static final String DB_NAME_ORACLE = "oracle"; - - public static final String DB_NAME_MYSQL = "mysql"; - - public static final String DB_NAME_POSTGRESQL = "postgresql"; - - public static final String DB_NAME_FIREBIRD = "firebird"; - - public static final String DB_NAME_MSSQL = "mssql"; - - public static final String DB_NAME_SYBASE = "sybase"; - - public static final String DB_NAME_DB2 = "db2"; - - protected static final Map<String, String> _driverHintDatabaseProductNameMap; - static { - final Map<String, String> tmpMap = Collections - .synchronizedMap(new LinkedHashMap<String, String>()); - tmpMap.put("org.apache.derby", DB_NAME_DERBY); - tmpMap.put("org.h2", DB_NAME_H2); - tmpMap.put("oracle", DB_NAME_ORACLE); - tmpMap.put("mysql", DB_NAME_MYSQL); - tmpMap.put("postgresql", DB_NAME_POSTGRESQL); - tmpMap.put("firebird", DB_NAME_FIREBIRD); - tmpMap.put("sqlserver", DB_NAME_MSSQL); - tmpMap.put("sybase", DB_NAME_SYBASE); - tmpMap.put("db2", DB_NAME_DB2); - _driverHintDatabaseProductNameMap = java.util.Collections - .unmodifiableMap(tmpMap); - } - - public static boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - final java.util.Set<String> keySet = _driverHintDatabaseProductNameMap - .keySet(); - for (final java.util.Iterator<String> ite = keySet.iterator(); ite - .hasNext();) { - final String driverHint = (String) ite.next(); - if (driverClassName.indexOf(driverHint) >= 0) { - final String databaseProductName = (String) _driverHintDatabaseProductNameMap - .get(driverHint); - setDatabaseProductName(databaseProductName); - return true; - } - } - return false; - } - - /** The database product name. */ - private static String _databaseProductName; - - /** - * Get database product name. - * - * @return Database product name. - */ - public static String getDatabaseProductName() { - return _databaseProductName; - } - - /** - * Set database product name. - * - * @param name Database product name. (NotNull) - */ - public static void setDatabaseProductName(String name) { - if (_databaseProductName != null) { - String msg = "Already set up: current=" + _databaseProductName - + " your=" + name; - throw new IllegalStateException(msg); - } - _databaseProductName = name; - } - - //========================================================================== - // ========= // SqlClause Creator // ================= /** @@ -244,9 +150,6 @@ public static SqlClause createSqlClause(ConditionBean cb) { final String tableSqlName = cb.getTableSqlName(); final SqlClause sqlClause = createSqlClause(tableSqlName); - if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { - sqlClause.makeFormatClauseEffective(); - } return sqlClause; } @@ -257,27 +160,22 @@ * @return SQL-clause. (NotNull) */ public static SqlClause createSqlClause(String tableDbName) { - final String databaseProductName = getDatabaseProductName(); - if (databaseProductName == null) { - return new SqlClauseH2(tableDbName); - } - final String name = databaseProductName.toLowerCase(); - if (name.equalsIgnoreCase(DB_NAME_DERBY)) { - return new SqlClauseDerby(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_H2)) { - return new SqlClauseH2(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_ORACLE)) { - return new SqlClauseOracle(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_FIREBIRD)) { - return new SqlClauseFirebird(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MYSQL)) { + if (DBDef.isCurrentDef(DBDef.MySQL)) { return new SqlClauseMySql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return new SqlClausePostgreSql(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { - return new SqlClauseSqlServer(tableDbName); - } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + } else if (DBDef.isCurrentDef(DBDef.Oracle)) { + return new SqlClauseOracle(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.DB2)) { return new SqlClauseDb2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.SQLServer)) { + return new SqlClauseSqlServer(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.FireBird)) { + return new SqlClauseFirebird(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.H2)) { + return new SqlClauseH2(tableDbName); + } else if (DBDef.isCurrentDef(DBDef.Derby)) { + return new SqlClauseDerby(tableDbName); } else { return new SqlClauseH2(tableDbName); } @@ -362,12 +260,7 @@ // Display SQL // =========== public static String convertConditionBean2DisplaySql(ConditionBean cb) { - final String twoWaySql; - if (cb.isLimitSelect_PKOnly()) { - twoWaySql = cb.getSqlClause().getClausePKOnly(); - } else { - twoWaySql = cb.getSqlClause().getClause(); - } + final String twoWaySql = cb.getSqlClause().getClause(); return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); } @@ -390,31 +283,8 @@ errorCode); } - // [DBFlute-0.7.8] //========================================================================== // ========= - // Database Type - // ============= - /** - * Is the database Oracle? - * - * @return Is the database Oracle? - */ - public static boolean isOracle() { - return createSqlClause("dummy") instanceof SqlClauseOracle; - } - - /** - * Is the database PostgreSQL? - * - * @return Is the database PostgreSQL? - */ - public static boolean isPostgreSql() { - return createSqlClause("dummy") instanceof SqlClausePostgreSql; - } - - //========================================================================== - // ========= // Helper // ====== /** Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,5 @@ +package jp.sf.pal.timecard.db.allcommon.cbean; + +public interface ScalarQuery<CB extends ConditionBean> { + public void query(CB cb); +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -12,6 +12,10 @@ */ public abstract class ConditionKey { + //========================================================================== + // ========= + // Definition + // ========== /** Mark of replaced value. */ public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; @@ -36,15 +40,18 @@ /** The condition key of prefixSearch. */ public static final ConditionKey CK_PREFIX_SEARCH = new ConditionKeyPrefixSearch(); - /** The condition key of likeSearch. */ - public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); - /** The condition key of inScope. */ public static final ConditionKey CK_IN_SCOPE = new ConditionKeyInScope(); /** The condition key of notInScope. */ public static final ConditionKey CK_NOT_IN_SCOPE = new ConditionKeyNotInScope(); + /** The condition key of likeSearch. */ + public static final ConditionKey CK_LIKE_SEARCH = new ConditionKeyLikeSearch(); + + /** The condition key of notLikeSearch. */ + public static final ConditionKey CK_NOT_LIKE_SEARCH = new ConditionKeyNotLikeSearch(); + /** The condition key of isNull. */ public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); @@ -54,31 +61,21 @@ /** Dummy-object for IsNull and IsNotNull and so on... */ protected static final Object DUMMY_OBJECT = new Object(); + //========================================================================== + // ========= + // Attribute + // ========= /** Condition-key. */ protected String _conditionKey; /** Operand. */ protected String _operand; + //========================================================================== + // ========= + // Validation + // ========== /** - * Get condition-key. - * - * @return Condition-key. - */ - public String getConditionKey() { - return _conditionKey; - } - - /** - * Get operand. - * - * @return Operand. - */ - public String getOperand() { - return _operand; - } - - /** * Is valid registration? * * @param conditionValue Condition value. (NotNull) @@ -89,6 +86,10 @@ abstract public boolean isValidRegistration(ConditionValue conditionValue, Object value, String callerName); + //========================================================================== + // ========= + // Where Clause + // ============ /** * Add where clause. * @@ -149,6 +150,10 @@ abstract protected void doAddWhereClause(List<String> conditionList, String columnName, ConditionValue value, ConditionOption option); + //========================================================================== + // ========= + // Condition Value + // =============== /** * Setup condition value. * @@ -210,6 +215,10 @@ ConditionValue conditionValue, Object value, String location, ConditionOption option); + //========================================================================== + // ========= + // Bind Clause + // =========== /** * Build bind clause. (for s2dao) * @@ -269,6 +278,10 @@ return "%"; } + //========================================================================== + // ========= + // Basic Override + // ============== /** * The override. Returns hash-code of this condition-key string. * @@ -304,4 +317,26 @@ return "ConditionKey: " + getConditionKey() + " " + getOperand() + " wild-card=[" + getWildCard() + "]"; } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get condition-key. + * + * @return Condition-key. + */ + public String getConditionKey() { + return _conditionKey; + } + + /** + * Get operand. + * + * @return Operand. + */ + public String getOperand() { + return _operand; + } } Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,104 @@ +package jp.sf.pal.timecard.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of notLikeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyNotLikeSearch() { + _conditionKey = "notLikeSearch"; + _operand = "not like"; + } + + /** + * Is valid registration? + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName) { + if (value == null) { + return false; + } + return true; + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + protected void doAddWhereClause(List<String> conditionList, + String columnName, ConditionValue value) { + throw new UnsupportedOperationException( + "doAddWhereClause without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doAddWhereClause(). + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doAddWhereClause(List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (option == null) { + String msg = "The argument[option] should not be null: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (!(option instanceof LikeSearchOption)) { + String msg = "The argument[option] should be LikeSearchOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + final LikeSearchOption myOption = (LikeSearchOption) option; + conditionList.add(buildBindClauseWithRearOption(columnName, value + .getNotLikeSearchLocation(), myOption.getRearOption())); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location) { + throw new UnsupportedOperationException( + "doSetupConditionValue without condition-option is unsupported!!!"); + } + + /** + * This method implements super#doSetupConditionValue(). + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + protected void doSetupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + conditionValue.setNotLikeSearch((String) value, + (LikeSearchOption) option).setNotLikeSearchLocation(location); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,5 +1,10 @@ package jp.sf.pal.timecard.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey; + /** * The option of from-to. * @@ -85,60 +90,84 @@ // ========= // Internal Main // ============= - public java.util.Date filterFromDate(java.util.Date fromDate) { + /** + * Filter the date as From. It requires this method is called before + * getFromDateConditionKey(). + * + * @param fromDate The date as From. (Nullable: If the value is null, it + * returns null) + * @return The filtered date as From. (Nullable) + */ + public Date filterFromDate(Date fromDate) { if (fromDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(fromDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); - final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + final Date cloneDate = (Date) fromDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return fromDate; } - public java.util.Date filterToDate(java.util.Date toDate) { + /** + * Filter the date as To. It requires this method is called before + * getToDateConditionKey(). + * + * @param toDate The date as To. (Nullable: If the value is null, it returns + * null) + * @return The filtered date as To. (Nullable) + */ + public Date filterToDate(Date toDate) { if (toDate == null) { return null; } if (_compareAsDate) { - final java.util.Calendar cal = java.util.Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(toDate.getTime()); clearCalendarHourMinuteSecondMilli(cal); addCalendarNextDay(cal);// Key Point! - final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + final Date cloneDate = (Date) toDate.clone(); cloneDate.setTime(cal.getTimeInMillis()); return cloneDate; } return toDate; } - public jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + /** + * Get the condition-key of the from-date. It requires this method is called + * after filterFromDate(). + * + * @return The condition-key of the from-date. (NotNull) + */ + public ConditionKey getFromDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + /** + * Get the condition-key of the to-date. It requires this method is called + * after filterToDate(). + * + * @return The condition-key of the to-date. (NotNull) + */ + public ConditionKey getToDateConditionKey() { if (_compareAsDate) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.timecard.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default - // ! + return ConditionKey.CK_LESS_EQUAL;// Default! } } @@ -146,15 +175,15 @@ // ========= // Calendar Helper // =============== - protected void addCalendarNextDay(java.util.Calendar cal) { - cal.add(java.util.Calendar.DAY_OF_MONTH, 1); + protected void addCalendarNextDay(Calendar cal) { + cal.add(Calendar.DAY_OF_MONTH, 1); } - protected void clearCalendarHourMinuteSecondMilli(java.util.Calendar cal) { - cal.clear(java.util.Calendar.MILLISECOND); - cal.clear(java.util.Calendar.SECOND); - cal.clear(java.util.Calendar.MINUTE); - cal.set(java.util.Calendar.HOUR_OF_DAY, cal - .getActualMinimum(java.util.Calendar.HOUR_OF_DAY)); + protected void clearCalendarHourMinuteSecondMilli(Calendar cal) { + cal.clear(Calendar.MILLISECOND); + cal.clear(Calendar.SECOND); + cal.clear(Calendar.MINUTE); + cal.set(Calendar.HOUR_OF_DAY, cal + .getActualMinimum(Calendar.HOUR_OF_DAY)); } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; /** @@ -230,6 +231,10 @@ String tmp = replace(value, _escape, _escape + _escape); tmp = replace(tmp, "%", _escape + "%"); tmp = replace(tmp, "_", _escape + "_"); + if (DBDef.isCurrentDef(DBDef.Oracle)) { + tmp = replace(tmp, "\uff05", _escape + "\uff05"); + tmp = replace(tmp, "\uff3f", _escape + "\uff3f"); + } value = tmp; } final String wildCard = "%"; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -6,9 +6,10 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; /** - * Condition value. + * Condition-value. * * @author DBFlute(AutoGenerator) */ @@ -578,110 +579,9 @@ //========================================================================== // ========= - // Like Search - // =========== - /** Value of likeSearch. */ - protected List<LikeSearchValue> _likeSearch; - - /** Value of likeSearch for spare. */ - protected List<LikeSearchValue> _likeSearch4Spare; - - /** - * Get the value of likeSearch. - * - * @return The value of likeSearch. (Nullable) - */ - public String getLikeSearch() { - if (_likeSearch == null) { - return null; - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - final LikeSearchValue likeSearchValue = (LikeSearchValue) _likeSearch - .remove(0); - return (String) filterValue(likeSearchValue.generateRealValue()); - } - - /** - * Set the value of likeSearch. - * - * @param value The value of likeSearch. (Nullable) - * @param option The option of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearch(String value, LikeSearchOption option) { - if (_likeSearch == null) { - _likeSearch = new ArrayList<LikeSearchValue>(); - _likeSearch4Spare = new ArrayList<LikeSearchValue>(); - } - if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { - for (int index = 0; index < _likeSearch4Spare.size(); index++) { - _likeSearch.add(_likeSearch4Spare.get(index)); - } - } - LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); - _likeSearch.add(likeSearchValue); - _likeSearch4Spare.add(likeSearchValue); - return this; - } - - /** Location of likeSearch. */ - protected String _likeSearchLocation; - - /** - * Get the location of likeSearch. - * - * @return The location of likeSearch. (Nullable) - */ - public String getLikeSearchLocation() { - return _likeSearchLocation; - } - - /** - * Set the location of likeSearch. - * - * @param location The location of likeSearch. (Nullable) - * @return this. (NotNull) - */ - public ConditionValue setLikeSearchLocation(String location) { - _likeSearchLocation = location; - return this; - } - - protected static class LikeSearchValue { - protected String _value; - - protected LikeSearchOption _option; - - public LikeSearchValue(String value, LikeSearchOption option) { - _value = value; - _option = option; - } - - public String getValue() { - return _value; - } - - public LikeSearchOption getOption() { - return _option; - } - - public String generateRealValue() { - if (_option == null) { - return _value; - } - return _option.generateRealValue(_value); - } - } - - //========================================================================== - // ========= // In Scope // ======== - /** Value of inScope. */ + /** The value of inScope. */ protected List<?> _inScope; protected InScopeOption _inScopeOption; @@ -774,7 +674,7 @@ // ========= // Not In Scope // ============ - /** Value of notInScope. */ + /** The value of notInScope. */ protected List<?> _notInScope; /** @@ -852,6 +752,207 @@ //========================================================================== // ========= + // Like Search + // =========== + /** The value of likeSearch. */ + protected List<LikeSearchValue> _likeSearch; + + /** The value of likeSearch for spare. */ + protected List<LikeSearchValue> _likeSearch4Spare; + + /** + * Get the value of likeSearch. + * + * @return The value of likeSearch. (Nullable) + */ + public String getLikeSearch() { + if (_likeSearch == null) { + return null; + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + final LikeSearchValue likeSearchValue = _likeSearch.remove(0); + return (String) filterValue(likeSearchValue.generateRealValue()); + } + + /** + * Set the value of likeSearch. + * + * @param value The value of likeSearch. (Nullable) + * @param option The option of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearch(String value, LikeSearchOption option) { + if (_likeSearch == null) { + _likeSearch = new ArrayList<LikeSearchValue>(); + _likeSearch4Spare = new ArrayList<LikeSearchValue>(); + } + if (_likeSearch.isEmpty() && !_likeSearch4Spare.isEmpty()) { + for (int index = 0; index < _likeSearch4Spare.size(); index++) { + _likeSearch.add(_likeSearch4Spare.get(index)); + } + } + LikeSearchValue likeSearchValue = new LikeSearchValue(value, option); + _likeSearch.add(likeSearchValue); + _likeSearch4Spare.add(likeSearchValue); + return this; + } + + /** Location of likeSearch. */ + protected String _likeSearchLocation; + + /** + * Get the location of likeSearch. + * + * @return The location of likeSearch. (Nullable) + */ + public String getLikeSearchLocation() { + return _likeSearchLocation; + } + + /** + * Set the location of likeSearch. + * + * @param location The location of likeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLikeSearchLocation(String location) { + _likeSearchLocation = location; + return this; + } + + protected static class LikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public LikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= + // Not Like Search + // =============== + /** The value of notLikeSearch. */ + protected List<NotLikeSearchValue> _notLikeSearch; + + /** The value of notLikeSearch for spare. */ + protected List<NotLikeSearchValue> _notLikeSearch4Spare; + + /** + * Get the value of notLikeSearch. + * + * @return The value of notLikeSearch. (Nullable) + */ + public String getNotLikeSearch() { + if (_notLikeSearch == null) { + return null; + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + final NotLikeSearchValue notLikeSearchValue = _notLikeSearch.remove(0); + return (String) filterValue(notLikeSearchValue.generateRealValue()); + } + + /** + * Set the value of notLikeSearch. + * + * @param value The value of notLikeSearch. (Nullable) + * @param option The option of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearch(String value, LikeSearchOption option) { + if (_notLikeSearch == null) { + _notLikeSearch = new ArrayList<NotLikeSearchValue>(); + _notLikeSearch4Spare = new ArrayList<NotLikeSearchValue>(); + } + if (_notLikeSearch.isEmpty() && !_notLikeSearch4Spare.isEmpty()) { + for (int index = 0; index < _notLikeSearch4Spare.size(); index++) { + _notLikeSearch.add(_notLikeSearch4Spare.get(index)); + } + } + NotLikeSearchValue notLikeSearchValue = new NotLikeSearchValue(value, + option); + _notLikeSearch.add(notLikeSearchValue); + _notLikeSearch4Spare.add(notLikeSearchValue); + return this; + } + + /** Location of notLikeSearch. */ + protected String _notLikeSearchLocation; + + /** + * Get the location of notLikeSearch. + * + * @return The location of notLikeSearch. (Nullable) + */ + public String getNotLikeSearchLocation() { + return _notLikeSearchLocation; + } + + /** + * Set the location of notLikeSearch. + * + * @param location The location of notLikeSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotLikeSearchLocation(String location) { + _notLikeSearchLocation = location; + return this; + } + + protected static class NotLikeSearchValue { + protected String _value; + + protected LikeSearchOption _option; + + public NotLikeSearchValue(String value, LikeSearchOption option) { + _value = value; + _option = option; + } + + public String getValue() { + return _value; + } + + public LikeSearchOption getOption() { + return _option; + } + + public String generateRealValue() { + if (_option == null) { + return _value; + } + return _option.generateRealValue(_value); + } + } + + //========================================================================== + // ========= // Is Null // ======= /** Value of isNull. */ @@ -976,8 +1077,8 @@ * Filter value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param value Value. (Nullable) - * @return Filtered value. (Nullable) + * @param value The value. (Nullable) + * @return The filtered value. (Nullable) */ protected Object filterValue(Object value) { if (value == null) { @@ -991,18 +1092,18 @@ } if (value instanceof java.util.Date || value instanceof java.util.Calendar) { - return SqlDateConversionUtil.toDate(value); + return SimpleTypeUtil.toSqlDate(value); } else { return value; } } /** - * Filter value. If the value is instance of java.util.Date or + * Filter the list of value. If the value is instance of java.util.Date or * java.util.Calendar, returns value as java.sql.Date. * - * @param valueList Value-list. (Nullable) - * @return Filtered value-list. (Nullable) + * @param valueList The list of value. (Nullable) + * @return The filtered list of value. (Nullable) */ protected List<?> filterValue(List<?> valueList) { if (valueList == null || valueList.isEmpty()) { @@ -1015,204 +1116,4 @@ } return resultList; } - - protected static class SqlDateConversionUtil { - - private SqlDateConversionUtil() { - } - - public static java.sql.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.sql.Date toDate(Object o, String pattern) { - if (o instanceof java.sql.Date) { - return (java.sql.Date) o; - } - java.util.Date date = DateConversionUtil.toDate(o, pattern); - if (date != null) { - return new java.sql.Date(date.getTime()); - } - return null; - } - } - - protected static class DateConversionUtil { - - private DateConversionUtil() { - } - - public static java.util.Date toDate(Object o) { - return toDate(o, null); - } - - public static java.util.Date toDate(Object o, String pattern) { - if (o == null) { - return null; - } else if (o instanceof String) { - return toDate((String) o, pattern); - } else if (o instanceof java.util.Date) { - return (java.util.Date) o; - } else if (o instanceof java.util.Calendar) { - return ((java.util.Calendar) o).getTime(); - } else { - return toDate(o.toString(), pattern); - } - } - - public static java.util.Date toDate(String s, String pattern) { - return toDate(s, pattern, java.util.Locale.getDefault()); - } - - public static java.util.Date toDate(String s, String pattern, - java.util.Locale locale) { - java.text.SimpleDateFormat sdf = getDateFormat(s, pattern, locale); - try { - return sdf.parse(s); - } catch (java.text.ParseException ex) { - throw new RuntimeException(ex); - } - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - String pattern, java.util.Locale locale) { - if (pattern != null) { - return new java.text.SimpleDateFormat(pattern); - } - return getDateFormat(s, locale); - } - - public static java.text.SimpleDateFormat getDateFormat(String s, - java.util.Locale locale) { - String pattern = getPattern(locale); - String shortPattern = removeDelimiter(pattern); - String delimitor = findDelimiter(s); - if (delimitor == null) { - if (s.length() == shortPattern.length()) { - return new java.text.SimpleDateFormat(shortPattern); - } - if (s.length() == shortPattern.length() + 2) { - return new java.text.SimpleDateFormat(InternalStringUtil - .replace(shortPattern, "yy", "yyyy")); - } - } else { - String[] array = InternalStringUtil.split(s, delimitor); - for (int i = 0; i < array.length; ++i) { - if (array[i].length() == 4) { - pattern = InternalStringUtil.replace(pattern, "yy", - "yyyy"); - break; - } - } - return new java.text.SimpleDateFormat(pattern); - } - return new java.text.SimpleDateFormat(); - } - - public static java.text.SimpleDateFormat getDateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getPattern(locale)); - } - - public static java.text.SimpleDateFormat getY4DateFormat( - java.util.Locale locale) { - return new java.text.SimpleDateFormat(getY4Pattern(locale)); - } - - public static String getY4Pattern(java.util.Locale locale) { - String pattern = getPattern(locale); - if (pattern.indexOf("yyyy") < 0) { - pattern = InternalStringUtil.replace(pattern, "yy", "yyyy"); - } - return pattern; - } - - public static String getPattern(java.util.Locale locale) { - java.text.SimpleDateFormat df = (java.text.SimpleDateFormat) java.text.DateFormat - .getDateInstance(java.text.DateFormat.SHORT, locale); - String pattern = df.toPattern(); - int index = pattern.indexOf(' '); - if (index > 0) { - pattern = pattern.substring(0, index); - } - if (pattern.indexOf("MM") < 0) { - pattern = InternalStringUtil.replace(pattern, "M", "MM"); - } - if (pattern.indexOf("dd") < 0) { - pattern = InternalStringUtil.replace(pattern, "d", "dd"); - } - return pattern; - } - - public static String findDelimiter(String value) { - for (int i = 0; i < value.length(); ++i) { - char c = value.charAt(i); - if (Character.isDigit(c)) { - continue; - } - return Character.toString(c); - } - return null; - } - - public static String removeDelimiter(String pattern) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (c == 'y' || c == 'M' || c == 'd') { - buf.append(c); - } - } - return buf.toString(); - } - } - - protected static class InternalStringUtil { - public static final String[] EMPTY_STRINGS = new String[0]; - - private InternalStringUtil() { - } - - public static final boolean isEmpty(String text) { - return text == null || text.length() == 0; - } - - public static final String replace(String text, String fromText, - String toText) { - if (text == null || fromText == null || toText == null) { - return null; - } - StringBuffer buf = new StringBuffer(100); - int pos = 0; - int pos2 = 0; - while (true) { - pos = text.indexOf(fromText, pos2); - if (pos == 0) { - buf.append(toText); - pos2 = fromText.length(); - } else if (pos > 0) { - buf.append(text.substring(pos2, pos)); - buf.append(toText); - pos2 = pos + fromText.length(); - } else { - buf.append(text.substring(pos2)); - break; - } - } - return buf.toString(); - } - - public static String[] split(String str, String delim) { - if (str == null) { - return EMPTY_STRINGS; - } - List<String> list = new java.util.ArrayList<String>(); - java.util.StringTokenizer st = new java.util.StringTokenizer(str, - delim); - while (st.hasMoreElements()) { - list.add(st.nextToken()); - } - return (String[]) list.toArray(new String[list.size()]); - } - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,17 +1,21 @@ package jp.sf.pal.timecard.db.allcommon.cbean.outsidesql; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; + import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.timecard.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.seasar.framework.util.InputStreamReaderUtil; -import org.seasar.framework.util.ReaderUtil; -import org.seasar.framework.util.ResourceUtil; /** * The context of outside-SQL. @@ -33,7 +37,7 @@ /** * Get outside-SQL context on thread. * - * @return Outside-SQL context. (Nullable) + * @return The context of outside-SQL. (Nullable) */ public static OutsideSqlContext getOutsideSqlContextOnThread() { return (OutsideSqlContext) _threadLocal.get(); @@ -42,7 +46,7 @@ /** * Set outside-SQL context on thread. * - * @param outsideSqlContext Outside-SQL context. (NotNull) + * @param outsideSqlContext The context of outside-SQL. (NotNull) */ public static void setOutsideSqlContextOnThread( OutsideSqlContext outsideSqlContext) { @@ -54,7 +58,7 @@ } /** - * Is existing outside-SQL context on thread? + * Is existing the context of outside-SQL on thread? * * @return Determination. */ @@ -63,7 +67,7 @@ } /** - * Clear outside-SQL context on thread. + * Clear the context of outside-SQL on thread. */ public static void clearOutsideSqlContextOnThread() { _threadLocal.set(null); @@ -77,12 +81,20 @@ String methodName, String path, Object pmb, OutsideSqlOption option, Object resultTypeSpecification) { final String pmbKey = (pmb != null ? pmb.getClass().getName() : "null"); - final String resultKey = (resultTypeSpecification != null ? ":" - + resultTypeSpecification : "null"); + final String resultKey; + if (resultTypeSpecification != null) { + if (resultTypeSpecification instanceof Class<?>) { + resultKey = ((Class<?>) resultTypeSpecification).getName(); + } else { + resultKey = resultTypeSpecification.toString(); + } + } else { + resultKey = "null"; + } final String tableDbName = option.getTableDbName(); final String generatedUniqueKey = option.generateUniqueKey(); - return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey - + ":" + generatedUniqueKey + resultKey; + return tableDbName + ":" + methodName + "():" + path + ":" + pmbKey + + ":" + generatedUniqueKey + ":" + resultKey; } //========================================================================== @@ -116,18 +128,9 @@ // Attribute // ========= // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected boolean _dynamicBinding; - - protected boolean _offsetByCursorForcedly; - - protected boolean _limitByCursorForcedly; - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - /** The path of outside-sql. (The mark of Specified-OutsideSql) */ + // Basic + // ----- + /** The path of outside-SQL. (The mark of specified outside-SQL) */ protected String _outsideSqlPath; protected Object _parameterBean; @@ -136,12 +139,23 @@ protected String _methodName; - /** The config of statement. (Nullable) */ + /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; /** The DB name of table for using behavior-SQL-path. (Nullable) */ protected String _tableDbName; + // ----------------------------------------------------- + // Option + // ------ + protected boolean _dynamicBinding; + + protected boolean _offsetByCursorForcedly; + + protected boolean _limitByCursorForcedly; + + protected boolean _autoPagingLogging; // for logging + //========================================================================== // ========= // Read SQL @@ -200,7 +214,7 @@ } /** - * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * Read outside-SQL path. Required attribute is 'outsideSqlPath'. * * @param sqlFileEncoding The encoding of SQL file. (NotNull) * @param dbmsSuffix The suffix of DBMS. (NotNull) @@ -214,6 +228,13 @@ String sql; if (isExistResource(dbmsPath)) { sql = readText(dbmsPath, sqlFileEncoding); + } else if ("_postgresql".equals(dbmsSuffix) + && isExistResource("_postgre")) { + sql = readText("_postgre", sqlFileEncoding); // Patch for name + // difference + } else if ("_sqlserver".equals(dbmsSuffix) && isExistResource("_mssql")) { + sql = readText("_mssql", sqlFileEncoding); // Patch for name + // difference } else if (isExistResource(standardPath)) { sql = readText(standardPath, sqlFileEncoding); } else { @@ -324,16 +345,46 @@ // General Helper // ============== protected boolean isExistResource(String path) { - return ResourceUtil.isExist(path); + return SimpleResourceUtil.isExist(path); } protected String readText(final String path, String sqlFileEncoding) { - final java.io.InputStream is = ResourceUtil.getResourceAsStream(path); - final java.io.Reader reader = InputStreamReaderUtil.create(is, - sqlFileEncoding); - return ReaderUtil.readText(reader); + final InputStream ins = SimpleResourceUtil.getResourceStream(path); + final Reader reader = createInputStreamReader(ins, sqlFileEncoding); + return readText(reader); } + protected Reader createInputStreamReader(InputStream ins, String encoding) { + try { + return new InputStreamReader(ins, encoding); + } catch (IOException e) { + String msg = "Failed to create the reader of the input stream:"; + msg = msg + " ins=" + ins + " encoding=" + encoding; + throw new IllegalStateException(msg, e); + } + } + + public String readText(Reader reader) { + final BufferedReader bfreader = new BufferedReader(reader); + final StringBuilder out = new StringBuilder(100); + try { + try { + final char[] buf = new char[8192]; + int n; + while ((n = bfreader.read(buf)) >= 0) { + out.append(buf, 0, n); + } + } finally { + bfreader.close(); + } + } catch (IOException e) { + String msg = "Failed to read the input stream:"; + msg = msg + " bfreader=" + bfreader + " reader=" + reader; + throw new IllegalStateException(msg, e); + } + return out.toString(); + } + protected static String replaceString(String text, String fromText, String toText) { return SimpleStringUtil.replace(text, fromText, toText); @@ -348,35 +399,8 @@ // Accessor // ======== // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - public boolean isDynamicBinding() { - return _dynamicBinding; - } - - public void setDynamicBinding(boolean dynamicBinding) { - this._dynamicBinding = dynamicBinding; - } - - public boolean isOffsetByCursorForcedly() { - return _offsetByCursorForcedly; - } - - public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { - this._offsetByCursorForcedly = offsetByCursorForcedly; - } - - public boolean isLimitByCursorForcedly() { - return _limitByCursorForcedly; - } - - public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { - this._limitByCursorForcedly = limitByCursorForcedly; - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- + // Basic + // ----- public String getOutsideSqlPath() { return _outsideSqlPath; } @@ -424,4 +448,39 @@ public void setTableDbName(String tableDbName) { this._tableDbName = tableDbName; } + + // ----------------------------------------------------- + // Option + // ------ + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public void setDynamicBinding(boolean dynamicBinding) { + this._dynamicBinding = dynamicBinding; + } + + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public void setOffsetByCursorForcedly(boolean offsetByCursorForcedly) { + this._offsetByCursorForcedly = offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public void setLimitByCursorForcedly(boolean limitByCursorForcedly) { + this._limitByCursorForcedly = limitByCursorForcedly; + } + + public boolean isAutoPagingLogging() { // for logging + return _autoPagingLogging; + } + + public void setAutoPagingLogging(boolean autoPagingLogging) { // for logging + this._autoPagingLogging = autoPagingLogging; + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -16,6 +16,7 @@ // ----------------------------------------------------- // Option // ------ + /** The request type of paging. */ protected String _pagingRequestType = "non"; protected boolean _dynamicBinding; @@ -23,6 +24,8 @@ /** The configuration of statement. (Nullable) */ protected StatementConfig _statementConfig; + protected String _sourcePagingRequestType = "non"; + // ----------------------------------------------------- // Information // ----------- @@ -59,6 +62,7 @@ // ==== public OutsideSqlOption copyOptionWithoutPaging() { final OutsideSqlOption copyOption = new OutsideSqlOption(); + copyOption.setPagingSourceRequestType(_pagingRequestType); if (isDynamicBinding()) { copyOption.dynamicBinding(); } @@ -103,6 +107,15 @@ _statementConfig = statementConfig; } + protected void setPagingSourceRequestType(String sourcePagingRequestType) { // Very + // Internal + _sourcePagingRequestType = sourcePagingRequestType; + } + + public boolean isSourcePagingRequestTypeAuto() { // Very Internal + return "auto".equals(_sourcePagingRequestType); + } + // ----------------------------------------------------- // Information // ----------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; import jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; /** - * The executor of outside-sql. <br /> + * The executor of outside-SQL. <br /> * * <pre> * {Basic} @@ -33,7 +38,6 @@ * * {Option -- Dynamic} * o dynamicBinding().selectList() - * * </pre> * * @author DBFlute(AutoGenerator) @@ -44,8 +48,8 @@ // ========= // Attribute // ========= - /** The DAO of outside-sql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; /** Table DB name. (NotNull) */ protected final String _tableDbName; @@ -60,9 +64,9 @@ // ========= // Constructor // =========== - public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, - String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlBasicExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._tableDbName = tableDbName; } @@ -80,12 +84,12 @@ * @param entityType The element type of entity. (NotNull) * @return The result bean of selected list. (NotNull) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public <ENTITY> ListResultBean<ENTITY> selectList(String path, Object pmb, Class<ENTITY> entityType) { - List<ENTITY> resultList = _outsideSqlDao.selectList(path, pmb, - createOutsideSqlOption(), entityType); + List<ENTITY> resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder<ENTITY>(_tableDbName) .buildListResultBean(resultList); } @@ -102,10 +106,10 @@ * object. (Nullable) * @return The count of execution. * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public int execute(String path, Object pmb) { - return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + return invoke(createExecuteCommand(path, pmb)); } // [DBFlute-0.7.5] @@ -123,12 +127,53 @@ throw new IllegalArgumentException( "The argument of call() 'pmb' should not be null!"); } - _outsideSqlDao.call(pmb.getProcedureName(), pmb, - createOutsideSqlOption()); + invoke(createCallCommand(pmb.getProcedureName(), pmb)); } //========================================================================== // ========= + // Behavior Command + // ================ + protected <ENTITY> BehaviorCommand<List<ENTITY>> createSelectListCommand( + String path, Object pmb, Class<ENTITY> entityType) { + final OutsideSqlSelectListCommand<ENTITY> cmd = xsetupCommand( + new OutsideSqlSelectListCommand<ENTITY>(), path, pmb); + cmd.setEntityType(entityType); + return cmd; + } + + protected BehaviorCommand<Integer> createExecuteCommand(String path, + Object pmb) { + return xsetupCommand(new OutsideSqlExecuteCommand(), path, pmb); + } + + protected BehaviorCommand<Void> createCallCommand(String path, Object pmb) { + return xsetupCommand(new OutsideSqlCallCommand(), path, pmb); + } + + private <COMMAND extends AbstractOutsideSqlCommand<?>> COMMAND xsetupCommand( + COMMAND command, String path, Object pmb) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(createOutsideSqlOption()); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected <RESULT> RESULT invoke(BehaviorCommand<RESULT> behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== // ----------------------------------------------------- @@ -144,11 +189,11 @@ * # * </pre> * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlCursorExecutor<Object> cursorHandling() { - return new OutsideSqlCursorExecutor<Object>(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlCursorExecutor<Object>(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } /** @@ -161,11 +206,11 @@ * # * </pre> * - * @return The cursor executor of outside-sql. (NotNull) + * @return The cursor executor of outside-SQL. (NotNull) */ public OutsideSqlEntityExecutor<Object> entityHandling() { - return new OutsideSqlEntityExecutor<Object>(_outsideSqlDao, - createOutsideSqlOption()); + return new OutsideSqlEntityExecutor<Object>(_behaviorCommandInvoker, + createOutsideSqlOption(), _tableDbName); } // ----------------------------------------------------- @@ -191,7 +236,7 @@ public OutsideSqlPagingExecutor autoPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.autoPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } @@ -215,7 +260,7 @@ public OutsideSqlPagingExecutor manualPaging() { final OutsideSqlOption option = createOutsideSqlOption(); option.manualPaging(); - return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + return new OutsideSqlPagingExecutor(_behaviorCommandInvoker, option, _tableDbName); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,12 +1,14 @@ package jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param <PARAMETER_BEAN> The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -17,18 +19,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlCursorExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -44,14 +53,46 @@ * @param handler The handler of cursor. (NotNull) * @return The result object that the cursor handler returns. (Nullable) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public Object selectCursor(String path, PARAMETER_BEAN pmb, CursorHandler handler) { - return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + return invoke(createSelectCursorCommand(path, pmb, handler)); + } + + //========================================================================== + // ========= + // Behavior Command + // ================ + protected BehaviorCommand<Object> createSelectCursorCommand(String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + return xsetupCommand(new OutsideSqlSelectCursorCommand(), path, pmb, handler); } + private OutsideSqlSelectCursorCommand xsetupCommand( + OutsideSqlSelectCursorCommand command, String path, + PARAMETER_BEAN pmb, CursorHandler handler) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setCursorHandler(handler); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected <RESULT> RESULT invoke(BehaviorCommand<RESULT> behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + //========================================================================== // ========= // Option Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; /** - * The cursor executor of outside-sql. + * The cursor executor of outside-SQL. * * @param <PARAMETER_BEAN> The type of parameter-bean. * @author DBFlute(AutoGenerator) @@ -20,18 +22,25 @@ // ========= // Attribute // ========= - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + //========================================================================== // ========= // Constructor // =========== - public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, - OutsideSqlOption outsideSqlOption) { - this._outsideSqlDao = outsideSqlDao; + public OutsideSqlEntityExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; } //========================================================================== @@ -48,14 +57,14 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException * When the entity is duplicated. */ public <ENTITY> ENTITY selectEntity(String path, PARAMETER_BEAN pmb, Class<ENTITY> entityType) { - final List<ENTITY> ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List<ENTITY> ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls.isEmpty()) { return null; } @@ -76,7 +85,7 @@ * @param entityType The type of entity. (NotNull) * @return The selected entity. (Nullable) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException @@ -84,8 +93,8 @@ */ public <ENTITY> ENTITY selectEntityWithDeletedCheck(String path, PARAMETER_BEAN pmb, Class<ENTITY> entityType) { - final List<ENTITY> ls = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + final List<ENTITY> ls = invoke(createSelectListCommand(path, pmb, + entityType)); if (ls == null || ls.isEmpty()) { throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, entityType)); @@ -127,6 +136,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected <ENTITY> BehaviorCommand<List<ENTITY>> createSelectListCommand( + String path, PARAMETER_BEAN pmb, Class<ENTITY> entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand<ENTITY>(), path, + pmb, entityType); + } + + private <ENTITY> OutsideSqlSelectListCommand<ENTITY> xsetupCommand( + OutsideSqlSelectListCommand<ENTITY> command, String path, + PARAMETER_BEAN pmb, Class<ENTITY> entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected <RESULT> RESULT invoke(BehaviorCommand<RESULT> behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlEntityExecutor<PARAMETER_BEAN> configure( Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.timecard.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.timecard.db.allcommon.cbean.ListResultBean; import jp.sf.pal.timecard.db.allcommon.cbean.PagingBean; import jp.sf.pal.timecard.db.allcommon.cbean.PagingHandler; import jp.sf.pal.timecard.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.timecard.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.timecard.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; /** - * The paging executor of outsideSql. + * The paging executor of outside-SQL. * * @author DBFlute(AutoGenerator) */ @@ -24,10 +26,10 @@ // ========= // Attribute // ========= - /** The DAO of outsideSql. (NotNull) */ - protected final OutsideSqlDao _outsideSqlDao; + /** The invoker of behavior command. (NotNull) */ + protected final BehaviorCommandInvoker _behaviorCommandInvoker; - /** The option of outsideSql. (NotNull) */ + /** The option of outside-SQL. (NotNull) */ protected final OutsideSqlOption _outsideSqlOption; /** The DB name of table. (NotNull) */ @@ -37,9 +39,10 @@ // ========= // Constructor // =========== - public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + public OutsideSqlPagingExecutor( + BehaviorCommandInvoker behaviorCommandInvoker, OutsideSqlOption outsideSqlOption, String tableDbName) { - this._outsideSqlDao = outsideSqlDao; + this._behaviorCommandInvoker = behaviorCommandInvoker; this._outsideSqlOption = outsideSqlOption; this._tableDbName = tableDbName; } @@ -81,13 +84,13 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paged list. (NotNull) * @exception com.example.dbflute.basic.dbflute.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public <ENTITY> ListResultBean<ENTITY> selectList(String path, PagingBean pmb, Class<ENTITY> entityType) { setupScrollableCursorIfNeeds(); - List<ENTITY> resultList = _outsideSqlDao.selectList(path, pmb, - _outsideSqlOption, entityType); + List<ENTITY> resultList = invoke(createSelectListCommand(path, pmb, + entityType)); return new ResultBeanBuilder<ENTITY>(_tableDbName) .buildListResultBean(resultList); } @@ -141,7 +144,7 @@ * # -- ELSE select count(*) * # /[*]END[*]/ * # ... - * o It's S2Dao's restriction...Sorry + * o It's restriction...Sorry * </pre> * * @param <ENTITY> The type of entity. @@ -150,14 +153,11 @@ * @param entityType The type of result entity. (NotNull) * @return The result bean of paging. (NotNull) * @exception jp.sf.pal.timecard.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. */ public <ENTITY> PagingResultBean<ENTITY> selectPage(final String path, final PagingBean pmb, final Class<ENTITY> entityType) { - final OutsideSqlOption countOption = _outsideSqlOption - .copyOptionWithoutPaging(); - final OutsideSqlEntityExecutor<PagingBean> countExecutor = new OutsideSqlEntityExecutor<PagingBean>( - _outsideSqlDao, countOption); + final OutsideSqlEntityExecutor<PagingBean> countExecutor = createCountExecutor(); final PagingHandler<ENTITY> handler = new PagingHandler<ENTITY>() { public PagingBean getPagingBean() { return pmb; @@ -182,6 +182,13 @@ return invoker.invokePaging(handler); } + protected OutsideSqlEntityExecutor<PagingBean> createCountExecutor() { + final OutsideSqlOption countOption = _outsideSqlOption + .copyOptionWithoutPaging(); + return new OutsideSqlEntityExecutor<PagingBean>( + _behaviorCommandInvoker, countOption, _tableDbName); + } + protected void setupScrollableCursorIfNeeds() { if (!_outsideSqlOption.isAutoPaging()) { return; @@ -207,6 +214,39 @@ //========================================================================== // ========= + // Behavior Command + // ================ + protected <ENTITY> BehaviorCommand<List<ENTITY>> createSelectListCommand( + String path, Object pmb, Class<ENTITY> entityType) { + return xsetupCommand(new OutsideSqlSelectListCommand<ENTITY>(), path, + pmb, entityType); + } + + private <ENTITY> OutsideSqlSelectListCommand<ENTITY> xsetupCommand( + OutsideSqlSelectListCommand<ENTITY> command, String path, + Object pmb, Class<ENTITY> entityType) { + command.setTableDbName(_tableDbName); + _behaviorCommandInvoker.injectComponentProperty(command); + command.setOutsideSqlPath(path); + command.setParameterBean(pmb); + command.setOutsideSqlOption(_outsideSqlOption); + command.setEntityType(entityType); + return command; + } + + /** + * Invoke the command of behavior. + * + * @param <RESULT> The type of result. + * @param behaviorCommand The command of behavior. (NotNull) + * @return The instance of result. (Nullable) + */ + protected <RESULT> RESULT invoke(BehaviorCommand<RESULT> behaviorCommand) { + return _behaviorCommandInvoker.invoke(behaviorCommand); + } + + //========================================================================== + // ========= // Option // ====== public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,23 +17,23 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.timecard.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; /** - * The abstract class of SqlClause. + * The abstract class of SQL clause. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractSqlClause implements SqlClause { //========================================================================== // ========= // Definition // ========== + protected static final SelectClauseType DEFAULT_SELECT_CLAUSE_TYPE = SelectClauseType.COLUMNS; + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; //========================================================================== @@ -43,12 +43,16 @@ // ----------------------------------------------------- // Basic // ----- - /** Target table name. */ + /** The name of table. */ protected final String _tableName; // ----------------------------------------------------- // Clause Resource // --------------- + // /- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // The resources that are not often used to are lazy-loaded for performance. + // - - - - - - - - - -/ /** * Selected select column map. map:{tableAliasName : map:{columnName : * selectColumnInfo}} @@ -57,48 +61,48 @@ /** * Specified select column map. map:{ tableAliasName = map:{ columnName : - * null } } + * null } } (Nullable: This is lazy-loaded) */ - protected Map<String, Map<String, String>> _specifiedSelectColumnMap;// [ + protected Map<String, Map<String, String>> _specifiedSelectColumnMap; // [ // DBFlute // - - // 0.7.4 - // ] + // 0.7 + // .4] - /** Specified derive sub-query map. */ - protected Map<String, String> _specifiedDeriveSubQueryMap;// [DBFlute-0.7.4] + /** Specified derive sub-query map. (Nullable: This is lazy-loaded) */ + protected Map<String, String> _specifiedDeriveSubQueryMap; //[DBFlute-0.7.4] - /** Included select column map. */ - protected Map<String, String> _includedSelectColumnMap = new LinkedHashMap<String, String>(); - /** * The map of real column and alias of select clause. map:{realColumnName : * aliasName} */ - protected Map<String, String> _selectClauseRealColumnAliasMap = new HashMap<String, String>();// Without + protected Map<String, String> _selectClauseRealColumnAliasMap = new HashMap<String, String>(); // Without // linked // ! + /** The type of select clause. (NotNull) */ + protected SelectClauseType _selectClauseType = DEFAULT_SELECT_CLAUSE_TYPE; + + /** The previous type of select clause. (Nullable: The default is null) */ + protected SelectClauseType _previousSelectClauseType; + /** Outer join map. */ protected Map<String, LeftOuterJoinInfo> _outerJoinMap = new LinkedHashMap<String, LeftOuterJoinInfo>(); - /** Where list. */ + /** The list of where clause. */ protected List<String> _whereList = new ArrayList<String>(); /** Inline where list for BaseTable. */ protected List<String> _baseTableInlineWhereList = new ArrayList<String>(); - /** Order-by clause. */ + /** The clause of order-by. (NotNull) */ protected final OrderByClause _orderByClause = new OrderByClause(); - /** Union clause list. */ - protected List<UnionQueryInfo> _unionQueryInfoList = new ArrayList<UnionQueryInfo>(); + /** The list of union clause. (Nullable: This is lazy-loaded) */ + protected List<UnionQueryInfo> _unionQueryInfoList; - /** Is included-select-column effective? Default value is false. */ - protected boolean _isIncludedSelectColumnEffective = false; - /** Is order-by effective? Default value is false. */ protected boolean _isOrderByEffective = false; @@ -138,7 +142,7 @@ // ----------------------------------------------------- // Optional Info // ------------- - protected boolean _formatClause; + protected boolean _formatClause = true; //========================================================================== // ========= @@ -163,28 +167,20 @@ StringBuilder sb = new StringBuilder(512); sb.append(getSelectClause()); sb.append(" "); - sb.append(buildClauseWithoutMainSelect(false)); + sb.append(buildClauseWithoutMainSelect()); String sql = sb.toString(); - return filterSubQueryIndent(sql); + sql = filterUnionCountOrScalar(sql); + sql = filterSubQueryIndent(sql); + return sql; } - public String getClausePKOnly() { + protected String buildClauseWithoutMainSelect() { StringBuilder sb = new StringBuilder(512); - sb.append(getSelectClausePKOnly()); - sb.append(" "); - sb.append(buildClauseWithoutMainSelect(true)); - String sql = sb.toString(); - return filterSubQueryIndent(sql); - } - - protected String buildClauseWithoutMainSelect(boolean pkonly) { - StringBuilder sb = new StringBuilder(512); sb.append(getFromClause()); sb.append(getFromHint()); sb.append(" "); sb.append(getWhereClause()); - String unionClause = buildUnionClause(pkonly ? getSelectClausePKOnly() - : getSelectClause()); + String unionClause = buildUnionClause(getSelectClause()); // Delete template mark! (At the future this will be unnecessary.) unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required @@ -225,29 +221,45 @@ protected String buildUnionClause(String selectClause) { StringBuilder sb = new StringBuilder(); - for (final Iterator<UnionQueryInfo> ite = _unionQueryInfoList - .iterator(); ite.hasNext();) { - final UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); - final String unionQueryClause = unionQueryInfo - .getUnionQueryClause(); - final boolean unionAll = unionQueryInfo.isUnionAll(); - if (isFormatClauseEffective()) { + if (hasUnionQuery()) { + for (Iterator<UnionQueryInfo> ite = _unionQueryInfoList.iterator(); ite + .hasNext();) { + UnionQueryInfo unionQueryInfo = (UnionQueryInfo) ite.next(); + String unionQueryClause = unionQueryInfo.getUnionQueryClause(); + boolean unionAll = unionQueryInfo.isUnionAll(); sb.append(getLineSeparator()); - } - sb.append(unionAll ? " union all " : " union "); - if (isFormatClauseEffective()) { + sb.append(unionAll ? " union all " : " union "); sb.append(getLineSeparator()); + sb.append(selectClause).append(" ").append(unionQueryClause); } - sb.append(selectClause).append(" ").append(unionQueryClause); } return sb.toString(); } + protected String filterUnionCountOrScalar(String sql) { + if (!isSelectClauseTypeCountOrScalar() || !hasUnionQuery()) { + return sql; + } + String selectClause = buildSelectClauseCountOrScalar("dfmain"); + String ln = getLineSeparator(); + String beginMark = resolveSubQueryBeginMark("dfmain") + ln; + String endMark = resolveSubQueryEndMark("dfmain"); + return selectClause + ln + " from (" + beginMark + sql + ln + + " ) dfmain" + endMark; + } + //========================================================================== // ========= // Clause Parts // ============ public String getSelectClause() { + // [DBFlute-0.8.6] + if (isSelectClauseTypeCountOrScalar() && !hasUnionQuery()) { + return buildSelectClauseCountOrScalar("dflocal"); + } + // /- - - - - - - - - - - - - - - - - - - - - - - - + // The type of select clause is COLUMNS since here. + // - - - - - - - - - -/ StringBuilder sb = new StringBuilder(); DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); List<ColumnInfo> columnInfoList = dbmeta.getColumnInfoList(); @@ -265,7 +277,19 @@ // [DBFlute-0.7.4] if (existsSpecifiedLocal && !localSpecifiedMap.containsKey(columnName)) { - continue; + if (isSelectClauseTypeCountOrScalar() && hasUnionQuery()) { + // Here it must be with union query. + // So the primary Key is target for saving unique. + // But if it does not have primary keys, all column is + // target. + if (dbmeta.hasPrimaryKey()) { + if (!columnInfo.isPrimary()) { + continue; + } + } + } else { + continue; + } } if (sb.length() > 0) { @@ -307,10 +331,6 @@ selectColumnInfo.getColumnAliasName()); } } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } // [DBFlute-0.7.4] if (_specifiedDeriveSubQueryMap != null @@ -318,9 +338,7 @@ Collection<String> deriveSubQuerySet = _specifiedDeriveSubQueryMap .values(); for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(", ").append(deriveSubQuery); } } @@ -328,67 +346,83 @@ return sb.toString(); } - public String getSelectClausePKOnly() { - StringBuilder sb = new StringBuilder(); - DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); - UniqueInfo uniqueInfo = dbmeta.getPrimaryUniqueInfo(); - List<ColumnInfo> columnInfoList = uniqueInfo.getUniqueColumnList(); - for (ColumnInfo columnInfo : columnInfoList) { - String columnName = columnInfo.getColumnDbName(); - if (sb.length() > 0) { - sb.append(", "); - } else { - sb.append("select").append(SELECT_HINT).append(" "); - } - String realColumnName = getLocalTableAliasName() + "." + columnName; - sb.append(realColumnName).append(" as ").append(columnName); - _selectClauseRealColumnAliasMap.put(realColumnName, columnName); + protected boolean isSelectClauseTypeCountOrScalar() { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return true; + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return true; } - if (_isIncludedSelectColumnEffective - && !_includedSelectColumnMap.isEmpty()) { - sb.append(getIncludedSelectColumnClause()); - } + return false; + } - // [DBFlute-0.7.4] - if (_specifiedDeriveSubQueryMap != null - && !_specifiedDeriveSubQueryMap.isEmpty()) { - Collection<String> deriveSubQuerySet = _specifiedDeriveSubQueryMap - .values(); - for (String deriveSubQuery : deriveSubQuerySet) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } - sb.append(", ").append(deriveSubQuery); - } + protected String buildSelectClauseCountOrScalar(String aliasName) { + if (_selectClauseType.equals(SelectClauseType.COUNT)) { + return buildSelectClauseCount(); + } else if (_selectClauseType.equals(SelectClauseType.MAX)) { + return buildSelectClauseMax(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.MIN)) { + return buildSelectClauseMin(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.SUM)) { + return buildSelectClauseSum(aliasName); + } else if (_selectClauseType.equals(SelectClauseType.AVG)) { + return buildSelectClauseAvg(aliasName); } + String msg = "The type of select clause is not for scalar:"; + msg = msg + " type=" + _selectClauseType; + throw new IllegalStateException(msg); + } - return sb.toString(); + protected String buildSelectClauseCount() { + return "select count(*)"; } - public String getSelectHint() { - return createSelectHint(); + protected String buildSelectClauseMax(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select max(" + aliasName + "." + columnName + ")"; } - public String getIncludedSelectColumnClause() { - StringBuilder sb = new StringBuilder(); - int count = 0; - for (Iterator<String> ite = _includedSelectColumnMap.keySet() - .iterator(); ite.hasNext(); count++) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sb.append(", ").append(realColumnName).append(" as ").append( - aliasName); - _selectClauseRealColumnAliasMap.put(realColumnName, aliasName); + protected String buildSelectClauseMin(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select min(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseSum(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select sum(" + aliasName + "." + columnName + ")"; + } + + protected String buildSelectClauseAvg(String aliasName) { + String columnName = getSpecifiedColumnNameAsOne(); + assertScalarSelectSpecifiedColumnOnlyOne(columnName); + return "select avg(" + aliasName + "." + columnName + ")"; + } + + protected void assertScalarSelectSpecifiedColumnOnlyOne(String columnName) { + if (columnName != null) { + return; } - return sb.toString(); + String msg = "The specified column exists one"; + msg = msg + " when the type of select clause is for scalar:"; + msg = msg + " specifiedSelectColumnMap=" + _specifiedSelectColumnMap; + throw new IllegalStateException(msg); } + public String getSelectHint() { + return createSelectHint(); + } + public String getFromClause() { StringBuilder sb = new StringBuilder(); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("from "); if (_baseTableInlineWhereList.isEmpty()) { sb.append(_tableName).append(" dflocal"); @@ -417,9 +451,7 @@ Map<String, String> joinOnMap = joinInfo.getJoinOnMap(); assertJoinOnMapNotEmpty(joinOnMap, aliasName); - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" left outer join "); if (inlineWhereClauseList.isEmpty()) { sb.append(joinTableName); @@ -489,16 +521,12 @@ String clauseElement = (String) ite.next(); clauseElement = filterWhereClauseSimply(clauseElement); if (count == 0) { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append("where ").append( template ? getWhereFirstConditionMark() : "").append( clauseElement); } else { - if (isFormatClauseEffective()) { - sb.append(getLineSeparator()).append(" "); - } + sb.append(getLineSeparator()).append(" "); sb.append(" and ").append(clauseElement); } } @@ -510,7 +538,7 @@ public String getOrderByClause() { String orderByClause = null; - if (!_unionQueryInfoList.isEmpty()) { + if (hasUnionQuery()) { if (_selectClauseRealColumnAliasMap == null || _selectClauseRealColumnAliasMap.isEmpty()) { String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " @@ -522,8 +550,7 @@ } else { orderByClause = _orderByClause.getOrderByClause(); } - if (isFormatClauseEffective() && orderByClause != null - && orderByClause.trim().length() > 0) { + if (orderByClause != null && orderByClause.trim().length() > 0) { return getLineSeparator() + " " + orderByClause; } else { return orderByClause; @@ -532,8 +559,7 @@ public String getSqlSuffix() { String sqlSuffix = createSqlSuffix(); - if (isFormatClauseEffective() && sqlSuffix != null - && sqlSuffix.trim().length() > 0) { + if (sqlSuffix != null && sqlSuffix.trim().length() > 0) { return getLineSeparator() + sqlSuffix; } else { return sqlSuffix; @@ -542,20 +568,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - public void copyIncludedSelectColumn(SqlClause sqlClause) { - Set<String> keySet = _includedSelectColumnMap.keySet(); - for (Iterator<String> ite = keySet.iterator(); ite.hasNext();) { - String aliasName = ite.next(); - String realColumnName = (String) _includedSelectColumnMap - .get(aliasName); - sqlClause.registerIncludedSelectColumn(aliasName, realColumnName); - } - } - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -644,26 +656,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - public void ignoreIncludedSelectColumn() { - _isIncludedSelectColumnEffective = false; - } - - public void makeIncludedSelectColumnEffective() { - if (!_includedSelectColumnMap.isEmpty()) { - _isIncludedSelectColumnEffective = true; - } - } - - public void registerIncludedSelectColumn(String aliasName, - String realColumnName) { - _isIncludedSelectColumnEffective = true; - _includedSelectColumnMap.put(aliasName, realColumnName); - } - - //========================================================================== - // ========= // OuterJoin // ========= public void registerOuterJoin(String joinTableName, String aliasName, @@ -1079,12 +1071,23 @@ public void registerUnionQuery(String unionQueryClause, boolean unionAll) { assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", unionQueryClause); - final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); unionQueryInfo.setUnionQueryClause(unionQueryClause); unionQueryInfo.setUnionAll(unionAll); + addUnionQueryInfo(unionQueryInfo); + } + + protected void addUnionQueryInfo(UnionQueryInfo unionQueryInfo) { + if (_unionQueryInfoList == null) { + _unionQueryInfoList = new ArrayList<UnionQueryInfo>(); + } _unionQueryInfoList.add(unionQueryInfo); } + public boolean hasUnionQuery() { + return _unionQueryInfoList != null && !_unionQueryInfoList.isEmpty(); + } + protected static class UnionQueryInfo { protected String _unionQueryClause; @@ -1425,18 +1428,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective() { - return _formatClause; - } - - public void makeFormatClauseEffective() { - _formatClause = true; - } - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity) { @@ -1462,13 +1453,11 @@ } public String filterSubQueryIndent(String sql) { - return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + return filterSubQueryIndent(sql, "", sql); } - protected String filterSubQueryIndent(String sql, String preIndent) { - if (!isFormatClauseEffective()) { - return sql; - } + protected String filterSubQueryIndent(String sql, String preIndent, + String originalSql) { final String lineSeparator = getLineSeparator(); if (!sql.contains(getSubQueryBeginMarkPrefix())) { return sql; @@ -1509,7 +1498,8 @@ // - - - - - - - - // In begin to end // - - - - - - - - - if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + if (line.contains(endMarkPrefix + subQueryIdentity)) { // The + // end final int markIndex = line.indexOf(endMarkPrefix); final int terminalIndex = line.indexOf(identityTerminal); if (terminalIndex < 0) { @@ -1521,7 +1511,7 @@ + line.substring(terminalIndex + terminalLength); subSb.append(clause).append(getLineSeparator()); final String currentSql = filterSubQueryIndent(subSb - .toString(), preIndent + indent); + .toString(), preIndent + indent, originalSql); mainSb.append(currentSql); throughBegin = false; throughBeginFirst = false; @@ -1544,10 +1534,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } if (filteredSql.contains(beginMarkPrefix)) { @@ -1556,10 +1547,11 @@ + getLineSeparator(); msg = msg + subQueryIdentity + getLineSeparator(); msg = msg + getLineSeparator() + "[Before Filter]" - + getLineSeparator(); - msg = msg + sql + getLineSeparator(); + + getLineSeparator() + sql; msg = msg + getLineSeparator() + "[After Filter]" + getLineSeparator() + filteredSql; + msg = msg + getLineSeparator() + "[Original SQL]" + + getLineSeparator() + originalSql; throw new SubQueryIndentFailureException(msg); } return filteredSql; @@ -1592,7 +1584,7 @@ } if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { _specifiedSelectColumnMap.put(tableAliasName, - new HashMap<String, String>()); + new LinkedHashMap<String, String>()); } Map<String, String> elementMap = _specifiedSelectColumnMap .get(tableAliasName); @@ -1666,10 +1658,7 @@ getUnionWhereFirstConditionMark(), ""); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("update ").append(_tableName).append(ln); int index = 0; // It is guaranteed that the map has one or more elements. @@ -1728,10 +1717,7 @@ final String subQuery = filterSubQueryIndent(selectClause + " " + fromWhereClause); final StringBuilder sb = new StringBuilder(); - String ln = ""; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } + String ln = getLineSeparator(); sb.append("delete from ").append(_tableName).append(ln); sb.append(" where ").append(primaryKeyName); sb.append(" in (").append(ln).append(subQuery).append(ln).append( @@ -1760,6 +1746,29 @@ return false; } + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + public void classifySelectClauseType(SelectClauseType selectClauseType) { + changeSelectClauseType(selectClauseType); + } + + protected void changeSelectClauseType(SelectClauseType selectClauseType) { + savePreviousSelectClauseType(); + _selectClauseType = selectClauseType; + } + + protected void savePreviousSelectClauseType() { + _previousSelectClauseType = _selectClauseType; + } + + public void rollbackSelectClauseType() { + _selectClauseType = _previousSelectClauseType != null ? _previousSelectClauseType + : DEFAULT_SELECT_CLAUSE_TYPE; + } + // [DBFlute-0.7.5] //========================================================================== // ========= Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; /** - * The interface of SQL-clause. + * The interface of SQL clause. * * @author DBFlute(AutoGenerator) */ @@ -35,21 +35,6 @@ */ public String getClause(); - /** - * Get clause of all parts as PK-only. - * - * <pre> - * # select [base-table-columns], [join-table-columns] - * # from [base-table] left outer join [join-table] [join-alias] on [join-condition] - * # where [base-table].[column] = [value] and [join-alias].[column] is null - * # order by [base-table].[column] asc, [join-alias].[column] desc - * # for update - * </pre> - * - * @return The clause of all parts as PK-Only. (NotNull) - */ - public String getClausePKOnly(); - // ----------------------------------------------------- // Fragment Clause // --------------- @@ -92,14 +77,6 @@ public String getSelectClause(); /** - * Get The clause of 'select' as PK-only. This is an internal method. - * - * @return The clause of select PK-only. {[select ...] from table...} - * (NotNull) - */ - public String getSelectClausePKOnly(); - - /** * Get the hint of 'select'. This is an internal method. * * @return The hint of 'select'. {select [select-hint] * from table...} @@ -108,14 +85,6 @@ public String getSelectHint(); /** - * Get the clause of included-select-column. This is an internal method. - * - * @return The clause of included-select-column. {select ... , - * [included-select-column clause] from table...} (NotNull) - */ - public String getIncludedSelectColumnClause(); - - /** * Get the clause of 'from'. This is an internal method. * * @return The clause of 'from'. (NotNull) @@ -162,17 +131,6 @@ //========================================================================== // ========= - // Copy Parts - // ========== - /** - * Copy included-select-column. - * - * @param sqlClause SQL-clause. (NotNull) - */ - public void copyIncludedSelectColumn(SqlClause sqlClause); - - //========================================================================== - // ========= // SelectedSelectColumn // ==================== /** @@ -189,30 +147,6 @@ //========================================================================== // ========= - // IncludedSelectColumn - // ==================== - /** - * Ignore included-select-column. - */ - public void ignoreIncludedSelectColumn(); - - /** - * Make included-select-column effective. - */ - public void makeIncludedSelectColumnEffective(); - - /** - * Register included-select-column. - * - * @param aliasName The alias name of the included-select-column. (NotNull) - * @param realColumnName The real column name of the included-select-column. - * (NotNull) - */ - public void registerIncludedSelectColumn(String aliasName, - String realColumnName); - - //========================================================================== - // ========= // OuterJoin // ========= /** @@ -340,6 +274,8 @@ // ===== public void registerUnionQuery(String unionClause, boolean unionAll); + public boolean hasUnionQuery(); + //========================================================================== // ========= // FetchScope @@ -561,14 +497,6 @@ //========================================================================== // ========= - // Format Clause - // ============= - public boolean isFormatClauseEffective(); - - public void makeFormatClauseEffective(); - - //========================================================================== - // ========= // Sub Query Indent // ================ public String resolveSubQueryBeginMark(String subQueryIdentity); @@ -588,8 +516,17 @@ public boolean hasSpecifiedDeriveSubQuery(String aliasName); + /** + * Get the name of only one specified column. + * + * @return The name of only one specified column. (Nullable: If it's not + * found or duplicated, it returns null) + */ public String getSpecifiedColumnNameAsOne(); + /** + * Clear specified select columns. + */ public void clearSpecifiedSelectColumn(); // [DBFlute-0.7.5] @@ -621,4 +558,29 @@ */ public boolean isUniqueConstraintException(String sqlState, Integer errorCode); + + // [DBFlute-0.8.6] + //========================================================================== + // ========= + // Select Clause Type + // ================== + /** + * Classify the type of select clause into specified type. + * + * @param selectClauseType The type of select clause. (NotNull) + */ + public void classifySelectClauseType(SelectClauseType selectClauseType); + + /** + * Roll-back the type of select clause into previous one. If it has no + * change, classify its type into default type. + */ + public void rollbackSelectClauseType(); + + /** + * The type of select clause. + */ + public static enum SelectClauseType { + COLUMNS, COUNT, MAX, MIN, SUM, AVG + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -71,12 +71,7 @@ if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { return; } - String ln = null; - if (isFormatClauseEffective()) { - ln = getLineSeparator(); - } else { - ln = ""; - } + String ln = getLineSeparator(); _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + ln + "select"; _fetchScopeSqlSuffix = ""; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,12 +5,11 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.timecard.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.timecard.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.timecard.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.timecard.db.allcommon.util.SimpleSystemUtil; @@ -31,68 +31,113 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractDBMeta implements DBMeta { //========================================================================== // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= // Attribute // ========= - protected List<ColumnInfo> _columnInfoList; + // ----------------------------------------------------- + // Information Resource + // -------------------- + // Initialized at its getter. + private StringKeyMap<String> _tableDbNameFlexibleMap; + private StringKeyMap<String> _tablePropertyNameFlexibleMap; + + private List<ColumnInfo> _columnInfoList; + + private StringKeyMap<ColumnInfo> _columnInfoFlexibleMap; + + // Initialized at hasMethod(). + private Map<String, Object> _methodNameMap = newConcurrentHashMap(); + //========================================================================== // ========= + // Table Info + // ========== + /** + * Get the flexible map of table DB name. + * + * @return The flexible map of table DB name. (NotNull, NotEmpty) + */ + protected Map<String, String> getTableDbNameFlexibleMap() { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + synchronized (this) { + if (_tableDbNameFlexibleMap != null) { + return _tableDbNameFlexibleMap; + } + _tableDbNameFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + _tableDbNameFlexibleMap.put(getTableDbName(), getTableDbName()); + return _tableDbNameFlexibleMap; + } + } + + /** + * Get the flexible map of table property name. + * + * @return The flexible map of table property name. (NotNull, NotEmpty) + */ + protected Map<String, String> getTablePropertyNameFlexibleMap() { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + synchronized (this) { + if (_tablePropertyNameFlexibleMap != null) { + return _tablePropertyNameFlexibleMap; + } + _tablePropertyNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); + _tablePropertyNameFlexibleMap.put(getTableDbName(), + getTablePropertyName()); + return _tableDbNameFlexibleMap; + } + } + + //========================================================================== + // ========= // Column Info // =========== /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return Determination. */ public boolean hasColumn(String columnFlexibleName) { - if (!hasFlexibleName(columnFlexibleName)) { - return false; - } - final String propertyName = findPropertyName(columnFlexibleName); - return hasMethod("column" + initCap(propertyName)); + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + return getColumnInfoFlexibleMap().containsKey(columnFlexibleName); } /** * The implementation. * - * @param columnFlexibleName The flexible name of the column. (NotNull and - * NotEmpty) + * @param columnFlexibleName The flexible name(IgnoreCase, IgnoreUnderscore) + * of the column. (NotNull, NotEmpty) * @return The information of the column. (NotNull) */ public ColumnInfo findColumnInfo(String columnFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", columnFlexibleName); - if (!hasColumn(columnFlexibleName)) { + final ColumnInfo columnInfo = getColumnInfoFlexibleMap().get( + columnFlexibleName); + if (columnInfo == null) { String msg = "Not found column by columnFlexibleName: " + columnFlexibleName; msg = msg + " tableName=" + getTableDbName(); throw new IllegalArgumentException(msg); } - String methodName = "column" - + initCap(findPropertyName(columnFlexibleName)); - Method method = null; - try { - method = this.getClass().getMethod(methodName, new Class[] {}); - } catch (NoSuchMethodException e) { - String msg = "Not found column by columnFlexibleName: " - + columnFlexibleName; - msg = msg + " tableName=" + getTableDbName() + " methodName=" - + methodName; - throw new RuntimeException(msg, e); - } - try { - return (ColumnInfo) method.invoke(this, new Object[] {}); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (java.lang.reflect.InvocationTargetException e) { - throw new RuntimeException(e.getCause()); - } + return columnInfo; } protected ColumnInfo cci(String columnDbName, String propertyName, @@ -114,7 +159,7 @@ /** * The implementation. * - * @return The list of columns. (NotNull and NotEmpty) + * @return The list of columns. (NotNull, NotEmpty) */ public List<ColumnInfo> getColumnInfoList() { if (_columnInfoList != null) { @@ -144,79 +189,118 @@ } } - protected void initializeColumnInfoList() { - getColumnInfoList();// Ignore return value because of initialization - // only! + /** + * Get the flexible map of column information. + * + * @return The flexible map of column information. (NotNull, NotEmpty) + */ + protected Map<String, ColumnInfo> getColumnInfoFlexibleMap() { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + final List<ColumnInfo> columnInfoList = getColumnInfoList(); + synchronized (this) { + if (_columnInfoFlexibleMap != null) { + return _columnInfoFlexibleMap; + } + _columnInfoFlexibleMap = StringKeyMap.createAsFlexibleConcurrent(); + for (ColumnInfo columnInfo : columnInfoList) { + _columnInfoFlexibleMap.put(columnInfo.getColumnDbName(), + columnInfo); + } + return _columnInfoFlexibleMap; + } } //========================================================================== - // =========== + // ========= + // Resource Initialization + // ======================= + protected void initializeInformationResource() { // for instance initializer + // of subclass. + // Initialize the flexible map of table DB name. + getTableDbNameFlexibleMap(); + + // Initialize the flexible map of table property name. + getTablePropertyNameFlexibleMap(); + + // Initialize the list of column information. + getColumnInfoList(); + + // Initialize the flexible map of column information. + getColumnInfoFlexibleMap(); + + // Initialize the map of (public)method name. + hasMethod("dummy"); + } + + //========================================================================== + // ========= // Name Handling // ============= /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) * @return Determination. */ public boolean hasFlexibleName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return true; - } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return true; - } - return false; + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + + // It uses column before table because column is used much more than + // table. + // This is the same consideration at other methods. + return getColumnInfoFlexibleMap().containsKey(flexibleName) + || getTableDbNameFlexibleMap().containsKey(flexibleName); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findDbName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getColumnDbName(); } - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getPropertyNameDbNameKeyToLowerMap().containsKey( - dbNameKeyToLower)) { - return (String) getPropertyNameDbNameKeyToLowerMap().get( - dbNameKeyToLower); - } + final String tableDbName = getTableDbNameFlexibleMap() + .get(flexibleName); + if (tableDbName != null) { + return tableDbName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found DB name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } /** * The implementation. * - * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) - * @return DB name. (NotNull and NotEmpty) + * @param flexibleName The flexible name(IgnoreCase, IgnoreUnderscore). + * (NotNull, NotEmpty) + * @return DB name. (NotNull, NotEmpty) */ public String findPropertyName(String flexibleName) { - final String key = flexibleName.toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + assertStringNotNullAndNotTrimmedEmpty("flexibleName", flexibleName); + final ColumnInfo columnInfoMap = getColumnInfoFlexibleMap().get( + flexibleName); + if (columnInfoMap != null) { + return columnInfoMap.getPropertyName(); } - if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { - final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() - .get(key)).toLowerCase(); - if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { - return (String) getDbNamePropertyNameKeyToLowerMap().get( - dbNameToLower); - } + final String tablePropertyName = getTablePropertyNameFlexibleMap().get( + flexibleName); + if (tablePropertyName != null) { + return tablePropertyName; } - String msg = "Not found object by the flexible name: flexibleName=" + String msg = "Not found property name by the flexible name: flexibleName=" + flexibleName; - throw new IllegalStateException(msg); + throw new IllegalArgumentException(msg); } //========================================================================== @@ -735,10 +819,8 @@ protected <ENTITY extends Entity> void registerEntityPropertySetupper( String columnName, String propertyName, Eps<ENTITY> setupper, Map<String, Eps<ENTITY>> entityPropertySetupperMap) { + // Only column name is registered because the map must be flexible map. entityPropertySetupperMap.put(columnName, setupper); - entityPropertySetupperMap.put(propertyName, setupper); - entityPropertySetupperMap.put(columnName.toLowerCase(), setupper); - entityPropertySetupperMap.put(propertyName.toLowerCase(), setupper); } protected <ENTITY extends Entity> Eps<ENTITY> findEps( @@ -945,6 +1027,7 @@ /** * This class is for Internal. Don't use this! */ + @SuppressWarnings("unchecked") protected static class MapStringValueAnalyzer { protected java.util.Map<String, ? extends Object> _valueMap; @@ -1072,6 +1155,7 @@ // ========= // Assist Helper // ============= + @SuppressWarnings("unchecked") protected <ENTITY> ENTITY downcast(Entity entity) { checkDowncast(entity); return (ENTITY) entity; @@ -1118,10 +1202,10 @@ protected Map<String, String> setupKeyToLowerMap(boolean dbNameKey) { final Map<String, String> map; if (dbNameKey) { - map = newLinkedHashMap(getTableDbName().toLowerCase(), + map = newConcurrentHashMap(getTableDbName().toLowerCase(), getTablePropertyName()); } else { - map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + map = newConcurrentHashMap(getTablePropertyName().toLowerCase(), getTableDbName()); } Method[] methods = this.getClass().getMethods(); @@ -1178,6 +1262,17 @@ return new HashMap<KEY, VALUE>(); } + protected <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap() { + return new ConcurrentHashMap<KEY, VALUE>(); + } + + protected <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap( + KEY key, VALUE value) { + ConcurrentHashMap<KEY, VALUE> map = newConcurrentHashMap(); + map.put(key, value); + return map; + } + protected <KEY, VALUE> LinkedHashMap<KEY, VALUE> newLinkedHashMap() { return new LinkedHashMap<KEY, VALUE>(); } @@ -1201,23 +1296,26 @@ // ----------------------------------------------------- // Reflection Handling // ------------------- - private Set<String> _cachedMethodNames = new HashSet<String>(); // for - - // performance - + /** + * Does it have the method? + * + * @param methodName The name of method. (NotNull, NotEmpty, + * PublicMethodOnly) + * @return Determination. + */ protected boolean hasMethod(String methodName) { assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); - if (_cachedMethodNames.isEmpty()) { - synchronized (_cachedMethodNames) { - if (_cachedMethodNames.isEmpty()) { + if (_methodNameMap.isEmpty()) { + synchronized (_methodNameMap) { + if (_methodNameMap.isEmpty()) { final Method[] methods = this.getClass().getMethods(); for (Method method : methods) { - _cachedMethodNames.add(method.getName()); + _methodNameMap.put(method.getName(), DUMMY_VALUE); } } } } - return _cachedMethodNames.contains(methodName); + return _methodNameMap.containsKey(methodName); } // ----------------------------------------------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,23 +17,22 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface DBMeta { //========================================================================== // ========= // Definition // ========== - /** Map-string map-mark. */ + /** Map-string map mark. */ public static final String MAP_STRING_MAP_MARK = "map:"; - /** Map-string list-mark. */ + /** Map-string list mark. */ public static final String MAP_STRING_LIST_MARK = "list:"; - /** Map-string start-brace. */ + /** Map-string start brace. */ public static final String MAP_STRING_START_BRACE = "@{"; - /** Map-string end-brace. */ + /** Map-string end brace. */ public static final String MAP_STRING_END_BRACE = "@}"; /** Map-string delimiter. */ @@ -47,23 +46,23 @@ // Table Info // ========== /** - * Get table db-name. + * Get table DB name. * - * @return Table db-name. (NotNull) + * @return Table DB name. (NotNull) */ public String getTableDbName(); /** - * Get table property-name(JavaBeansRule). + * Get table property name(JavaBeansRule). * - * @return Table property-name(JavaBeansRule). (NotNull) + * @return Table property name(JavaBeansRule). (NotNull) */ public String getTablePropertyName(); /** - * Get table SQL-name. + * Get table SQL name. * - * @return Table SQL-name. (NotNull) + * @return Table SQL name. (NotNull) */ public String getTableSqlName(); @@ -80,10 +79,10 @@ public boolean hasFlexibleName(String flexibleName); /** - * Find db name by flexible name. {Target objects are TABLE and COLUMN} + * Find DB name by flexible name. {Target objects are TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findDbName(String flexibleName); @@ -92,60 +91,40 @@ * TABLE and COLUMN} * * @param flexibleName The flexible name. (NotNull and NotEmpty) - * @return Db name. (NotNull and NotEmpty) + * @return The DB name of anything. (NotNull and NotEmpty) */ public String findPropertyName(String flexibleName); //========================================================================== // ========= - // Name Map - // ======== - /** - * Get the key-to-lower map of DB name(lower) and property name. - * - * @return The key-to-lower map of DB name(lower) and property name. - * (NotNull) - */ - public Map<String, String> getDbNamePropertyNameKeyToLowerMap(); - - /** - * Get the key-to-lower map of property name(lower) and db name. - * - * @return The key-to-lower map of property name(lower) and db name. - * (NotNull) - */ - public Map<String, String> getPropertyNameDbNameKeyToLowerMap(); - - //========================================================================== - // ========= // Type Name // ========= /** - * Get the type-name of entity. + * Get the type name of entity. * - * @return The type-name of entity. (NotNull) + * @return The type name of entity. (NotNull) */ public String getEntityTypeName(); /** - * Get the type-name of condition-bean. + * Get the type name of condition-bean. * - * @return The type-name of condition-bean. (Nullable: If the condition-bean + * @return The type name of condition-bean. (Nullable: If the condition-bean * does not exist) */ public String getConditionBeanTypeName(); /** - * Get the type-name of dao. + * Get the type name of DAO. * - * @return The type-name of dao. (Nullable: If the dao does not exist) + * @return The type name of DAO. (Nullable: If the DAO does not exist) */ public String getDaoTypeName(); /** - * Get the type-name of behavior. + * Get the type name of behavior. * - * @return The type-name of behavior. (Nullable: If the behavior does not + * @return The type name of behavior. (Nullable: If the behavior does not * exist) */ public String getBehaviorTypeName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,113 +1,85 @@ package jp.sf.pal.timecard.db.allcommon.dbmeta; -import java.util.Collections; -import java.util.LinkedHashMap; +import java.lang.reflect.Method; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.allcommon.util.SimpleAssertUtil; /** - * DBMeta instance handler. + * The instance handler of DB meta. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class DBMetaInstanceHandler { //========================================================================== // ========= // Definition // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBMetaInstanceHandler.class); + + //========================================================================== + // ========= + // Resource Map + // ============ /** Table DB-name instance map. */ - protected static final Map<String, DBMeta> _tableDbNameInstanceMap = new LinkedHashMap<String, DBMeta>(); + protected static final Map<String, DBMeta> _tableDbNameInstanceMap = newConcurrentHashMap(); - /** The map of table DB-name and class name. */ - protected static final Map<String, String> _tableDbNameClassNameMap; - static { - Map<String, String> tmpMap = new LinkedHashMap<String, String>(); + /** The map of table DB name and class name. This is for initialization. */ + protected static final Map<String, String> _tableDbNameClassNameMap = newConcurrentHashMap(); - tmpMap.put("DAILY_REPORT", - "jp.sf.pal.timecard.db.bsentity.dbmeta.DailyReportDbm"); - tmpMap.put("EMPLOYEE", - "jp.sf.pal.timecard.db.bsentity.dbmeta.EmployeeDbm"); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("MONTHLY_REPORT", - "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyReportDbm"); - tmpMap - .put("MONTHLY_WORKING_REPORT", - "jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.timecard.db.bsentity.dbmeta.UserInfoDbm"); - tmpMap.put("WORKING_TYPE", - "jp.sf.pal.timecard.db.bsentity.dbmeta.WorkingTypeDbm"); + /** The flexible map of table DB name. This is for conversion at finding. */ + protected static final Map<String, String> _tableDbNameFlexibleMap = StringKeyMap + .createAsFlexibleConcurrent(); - _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); - } + /** The count of setting up resources of DB meta for internal information. */ + protected static int setupCount = 0; - /** The key-to-lower map of DB-name and property-name for table. */ - protected static final Map<String, String> _tableDbNamePropertyNameKeyToLowerMap; - static { - Map<String, String> tmpMap = new LinkedHashMap<String, String>(); - - tmpMap.put("DAILY_REPORT".toLowerCase(), "dailyReport"); - tmpMap.put("EMPLOYEE".toLowerCase(), "employee"); - tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("MONTHLY_REPORT".toLowerCase(), "monthlyReport"); - tmpMap.put("MONTHLY_WORKING_REPORT".toLowerCase(), - "monthlyWorkingReport"); - tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); - tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); - tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); - tmpMap.put("WORKING_TYPE".toLowerCase(), "workingType"); - - _tableDbNamePropertyNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - /** The key-to-lower map of property-name and DB-name for table. */ - protected static final Map<String, String> _tablePropertyNameDbNameKeyToLowerMap; - static { - Map<String, String> tmpMap = new LinkedHashMap<String, String>(); - - tmpMap.put("dailyReport".toLowerCase(), "DAILY_REPORT"); - tmpMap.put("employee".toLowerCase(), "EMPLOYEE"); - tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("monthlyReport".toLowerCase(), "MONTHLY_REPORT"); - tmpMap.put("monthlyWorkingReport".toLowerCase(), - "MONTHLY_WORKING_REPORT"); - tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); - tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - tmpMap.put("workingType".toLowerCase(), "WORKING_TYPE"); - - _tablePropertyNameDbNameKeyToLowerMap = Collections - .unmodifiableMap(tmpMap); - } - - protected static DBMeta getDBMeta(String className) { - try { - Class clazz = Class.forName(className); - java.lang.reflect.Method methoz = clazz.getMethod("getInstance", - (Class[]) null); - Object result = methoz.invoke(null, (Object[]) null); - return (DBMeta) result; - } catch (Exception e) { - throw new RuntimeException(e); + /** + * Set up the resource of DBMeta. Lock this class. + * + * @param tableDbNameClassNameMap The map of table DB name and class name. + * (NotNull) + */ + public static synchronized void setupDBMetaResource( + Map<String, String> tableDbNameClassNameMap) { + if (tableDbNameClassNameMap == null) { + String msg = "The argument 'tableDbNameClassNameMap' should not be null"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); } + if (tableDbNameClassNameMap.isEmpty()) { + String msg = "The argument 'tableDbNameClassNameMap' should not be empty"; + msg = msg + " at DBMetaInstanceHandler.setupDBMetaResource()"; + throw new IllegalArgumentException(msg); + } + final String firstMsg = "...Setting up resources of DB meta"; + final int tableCount = tableDbNameClassNameMap.size(); + if (setupCount == 0) { + _log.info(firstMsg + ": tables=" + tableCount); // basically here + } else { + _log.info(firstMsg + " AGAIN(" + (setupCount + 1) + + " times): tables=" + tableCount); + } + _tableDbNameInstanceMap.clear(); + _tableDbNameClassNameMap.clear(); + _tableDbNameFlexibleMap.clear(); + final Set<String> tableDbNameSet = tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + final String className = tableDbNameClassNameMap.get(tableDbName); + _tableDbNameClassNameMap.put(tableDbName, className); + _tableDbNameFlexibleMap.put(tableDbName, tableDbName); + } + ++setupCount; } /** - * @return The initialized map that contains all instances of dbmeta. + * @return The initialized map that contains all instances of DB meta. * (NotNull & NotEmpty) */ public static Map<String, DBMeta> getDBMetaMap() { @@ -140,45 +112,31 @@ // Main Method // =========== /** - * Find dbmeta by table flexible-name. + * Find DB meta by table flexible name. * * <pre> - * If the table name is 'ORDER_DETAIL', you can find the dbmeta by ...(as follows) + * If the table name is 'ORDER_DETAIL', you can find the DB meta by ...(as follows) * 'ORDER_DETAIL', 'ORDer_DeTAiL', 'order_detail' * , 'OrderDetail', 'orderdetail', 'oRderDetaIl' * </pre> * - * @param tableFlexibleName Table flexible-name. (NotNull) - * @return The instance of dbmeta. (NotNull) - * @exception DBMetaNotFoundException When the dbmeta is not found. + * @param tableFlexibleName The flexible name of table. (NotNull) + * @return The instance of DB meta. (NotNull) + * @exception DBMetaNotFoundException When the DB meta is not found. */ public static DBMeta findDBMeta(String tableFlexibleName) { assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", tableFlexibleName); - if (_tableDbNameInstanceMap.containsKey(tableFlexibleName)) { - return byTableDbName(tableFlexibleName); - } - String toLowerKey = tableFlexibleName.toLowerCase(); - if (_tableDbNamePropertyNameKeyToLowerMap.containsKey(toLowerKey)) { - String propertyName = (String) _tableDbNamePropertyNameKeyToLowerMap - .get(toLowerKey); - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(propertyName.toLowerCase()); - return byTableDbName(dbName); - } - if (_tablePropertyNameDbNameKeyToLowerMap.containsKey(toLowerKey)) { - String dbName = (String) _tablePropertyNameDbNameKeyToLowerMap - .get(toLowerKey); - return byTableDbName(dbName); - } final int dotLastIndex = tableFlexibleName.lastIndexOf("."); if (dotLastIndex >= 0) { - try { - return findDBMeta(tableFlexibleName.substring(dotLastIndex + 1)); - } catch (DBMetaNotFoundException e) { - // Nothing - } + tableFlexibleName = tableFlexibleName.substring(dotLastIndex + + ".".length()); } + final String tableDbName = _tableDbNameFlexibleMap + .get(tableFlexibleName); + if (tableDbName != null) { + return byTableDbName(tableDbName); + } String msg = "The instance map returned null by the key: key=" + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); @@ -202,8 +160,9 @@ assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); DBMeta instance = getCachedDBMeta(tableDbName); if (instance == null) { - String msg = "The instance map returned null by the key: key=" - + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + String msg = "The instance map returned null by the key:"; + msg = msg + " key=" + tableDbName + " instanceMap=" + + _tableDbNameInstanceMap; throw new DBMetaNotFoundException(msg); } return instance; @@ -225,10 +184,25 @@ return _tableDbNameInstanceMap.get(tableName); } + protected static DBMeta getDBMeta(String className) { + try { + Class<?> clazz = Class.forName(className); + Method methoz = clazz.getMethod("getInstance", (Class[]) null); + Object result = methoz.invoke(null, (Object[]) null); + return (DBMeta) result; + } catch (Exception e) { + throw new RuntimeException(e); + } + } + //========================================================================== // ========= // General Helper // ============== + protected static <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap() { + return new ConcurrentHashMap<KEY, VALUE>(); + } + // ----------------------------------------------------- // Assert Object // ------------- Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -222,7 +222,6 @@ * @author DBFlute(AutoGenerator) * @param <LOCAL_ENTITY> The type of local entity extends Entity */ - @ SuppressWarnings("unchecked") public class HierarchyArranger<LOCAL_ENTITY extends Entity> { //========================================================================== @@ -457,9 +456,9 @@ List<Entity> referrerList = extractReferrerList(localEntity, referrerInfo); if (referrerList == null) { - String msg = "The referrer list should not be null: localEntity=" - + localEntity + " referrerInfo=" + referrerInfo; - throw new IllegalStateException(msg); + // Initialize the list of referrer and inject it. + referrerList = new ArrayList<Entity>(); + injectReferrerList(localEntity, referrerInfo, referrerList); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -765,8 +764,8 @@ return capPropReferrerName; } - private java.lang.reflect.Method findMethod(Class clazz, String methodName, - Class[] argTypes) { + private java.lang.reflect.Method findMethod(Class<?> clazz, + String methodName, Class<?>[] argTypes) { try { return clazz.getMethod(methodName, argTypes); } catch (NoSuchMethodException ex) { @@ -852,10 +851,10 @@ return sb.toString(); } - private String createTypeViewFromTypeArray(Class[] array) { + private String createTypeViewFromTypeArray(Class<?>[] array) { final StringBuffer sb = new StringBuffer(); for (int i = 0; i < array.length; i++) { - final Class type = array[i]; + final Class<?> type = array[i]; if (sb.length() == 0) { sb.append(type.getSimpleName()); } else { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -16,7 +16,6 @@ * @author DBFlute(AutoGenerator) * @param <LOCAL_ENTITY> The type of local entity. */ - @ SuppressWarnings("unchecked") public class HierarchyRequest<LOCAL_ENTITY extends Entity> { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,13 +1,14 @@ package jp.sf.pal.timecard.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; /** - * The class of referer information. + * The class of referrer information. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface RelationInfo { public String getRelationPropertyName(); @@ -16,7 +17,7 @@ public DBMeta getTargetDBMeta(); - public java.util.Map<ColumnInfo, ColumnInfo> getLocalTargetColumnInfoMap(); + public Map<ColumnInfo, ColumnInfo> getLocalTargetColumnInfoMap(); public boolean isOneToOne(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,17 +1,20 @@ package jp.sf.pal.timecard.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.timecard.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.timecard.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.timecard.db.allcommon.helper.token.line.impl.LineTokenImpl; /** - * The implementation of map-string-builder. + * The implementation of map-string builder. * * @author DBFlute(AutoGenerator) */ public class MapStringBuilderImpl implements MapStringBuilder { - protected java.util.List<String> _columnNameList; + protected List<String> _columnNameList; protected String _msMapMark; @@ -26,10 +29,10 @@ protected boolean _trimDoubleQuotation; public void setColumnNames(String[] columnNames) { - _columnNameList = java.util.Arrays.asList(columnNames); + _columnNameList = Arrays.asList(columnNames); } - public void setColumnNameList(java.util.List<String> columnNameList) { + public void setColumnNameList(List<String> columnNameList) { _columnNameList = columnNameList; } @@ -83,7 +86,7 @@ return sb.toString(); } - public String buildFromList(java.util.List<String> valueList) { + public String buildFromList(List<String> valueList) { if (valueList == null) { String msg = "The argument[valueList] should not be null."; throw new IllegalArgumentException(msg); @@ -103,7 +106,7 @@ return sb.toString(); } - protected java.util.List<String> tokenize(String value, String delimiter) { + protected List<String> tokenize(String value, String delimiter) { final LineToken lineToken = new LineTokenImpl(); final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); lineTokenizingOption.setDelimiter(delimiter); @@ -144,8 +147,8 @@ } } - protected void assertColumnValueList(java.util.List<String> columnNameList, - java.util.List<String> valueList) { + protected void assertColumnValueList(List<String> columnNameList, + List<String> valueList) { if (columnNameList.size() != valueList.size()) { String msg = "The length of columnNameList and valueList are difference. (" + columnNameList.size() + ", " + valueList.size() + ")"; Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,201 @@ +package jp.sf.pal.timecard.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + * @param <VALUE> The type of value. + */ +public class StringKeyMap<VALUE> implements Map<String, VALUE> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map<String, VALUE> _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringKeyMap(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static <VALUE> StringKeyMap<VALUE> createAsFlexible() { + return new StringKeyMap<VALUE>(true, false); + } + + public static <VALUE> StringKeyMap<VALUE> createAsFlexibleConcurrent() { + return new StringKeyMap<VALUE>(true, true); + } + + public static <VALUE> StringKeyMap<VALUE> createAsCaseInsensitive() { + return new StringKeyMap<VALUE>(false, false); + } + + public static <VALUE> StringKeyMap<VALUE> createAsCaseInsensitiveConcurrent() { + return new StringKeyMap<VALUE>(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public VALUE get(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.get(stringKey); + } + return null; + } + + public VALUE put(String key, VALUE value) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.put(stringKey, value); + } + return null; + } + + public VALUE remove(Object key) { + final String stringKey = convertStringKey(key); + if (stringKey != null) { + return _internalMap.remove(stringKey); + } + return null; + } + + public final void putAll(Map<? extends String, ? extends VALUE> map) { + final Set<? extends String> keySet = map.keySet(); + for (String key : keySet) { + put(key, map.get(key)); + } + } + + public boolean containsKey(Object key) { + return get(key) != null; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public Set<String> keySet() { + return _internalMap.keySet(); + } + + public Collection<VALUE> values() { + return _internalMap.values(); + } + + public boolean containsValue(Object obj) { + return _internalMap.containsValue(obj); + } + + public Set<Entry<String, VALUE>> entrySet() { + return _internalMap.entrySet(); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object key) { + if (!(key instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) key)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap() { + return new ConcurrentHashMap<KEY, VALUE>(); + } + + protected static <KEY, VALUE> HashMap<KEY, VALUE> newHashMap() { + return new HashMap<KEY, VALUE>(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.hashCode(); + } + + @Override + public String toString() { + return _internalMap.toString(); + } +} \ No newline at end of file Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,233 @@ +package jp.sf.pal.timecard.db.allcommon.helper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class StringSet implements Set<String> { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final Object DUMMY_VALUE = new Object(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected final Map<String, Object> _internalMap; + + protected boolean _removeUnderscore; + + //========================================================================== + // ========= + // Constructor + // =========== + protected StringSet(boolean removeUnderscore, boolean concurrent) { + _removeUnderscore = removeUnderscore; + if (concurrent) { + _internalMap = newConcurrentHashMap(); + } else { + _internalMap = newHashMap(); + } + } + + public static StringSet createAsFlexible() { + return new StringSet(true, false); + } + + public static StringSet createAsFlexibleConcurrent() { + return new StringSet(true, true); + } + + public static StringSet createAsCaseInsensitive() { + return new StringSet(false, false); + } + + public static StringSet createAsCaseInsensitiveConcurrent() { + return new StringSet(false, true); + } + + //========================================================================== + // ========= + // Map Emulator + // ============ + // ----------------------------------------------------- + // Key Related + // ----------- + public boolean add(String value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.put(stringValue, DUMMY_VALUE) != null; + } + return false; + } + + public boolean remove(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.remove(stringValue) != null; + } + return false; + } + + public boolean contains(Object value) { + final String stringValue = convertStringKey(value); + if (stringValue != null) { + return _internalMap.containsKey(stringValue); + } + return false; + } + + // ----------------------------------------------------- + // Delegate + // -------- + public void clear() { + _internalMap.clear(); + } + + public int size() { + return _internalMap.size(); + } + + public boolean isEmpty() { + return _internalMap.isEmpty(); + } + + public boolean addAll(Collection<? extends String> c) { + boolean success = false; + for (String s : c) { + if (add(s)) { + success = true; + } + } + return success; + } + + public boolean removeAll(Collection<?> c) { + boolean success = false; + for (Object s : c) { + if (remove(s)) { + success = true; + } + } + return success; + } + + public boolean containsAll(Collection<?> c) { + for (Object s : c) { + if (contains(s)) { + return true; + } + } + return false; + } + + public Iterator<String> iterator() { + return _internalMap.keySet().iterator(); + } + + public boolean retainAll(Collection<?> c) { + boolean success = false; + for (Object s : c) { + if (!contains(s)) { + if (remove(s)) { + success = true; + } + } + } + return success; + } + + public Object[] toArray() { + return _internalMap.keySet().toArray(); + } + + public <T> T[] toArray(T[] a) { + return _internalMap.keySet().toArray(a); + } + + //========================================================================== + // ========= + // Key Converter + // ============= + protected String convertStringKey(Object value) { + if (!(value instanceof String)) { + return null; + } + return toLowerCase(removeUnderscore((String) value)); + } + + protected String removeUnderscore(String value) { + if (_removeUnderscore) { + return replace(value, "_", ""); + } + return value; + } + + protected String toLowerCase(String value) { + return value.toLowerCase(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + while (true) { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + break; + } + } + return sb.toString(); + } + + protected static <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap() { + return new ConcurrentHashMap<KEY, VALUE>(); + } + + protected static <KEY, VALUE> HashMap<KEY, VALUE> newHashMap() { + return new HashMap<KEY, VALUE>(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public boolean equals(Object obj) { + return _internalMap.keySet().equals(obj); + } + + @Override + public int hashCode() { + return _internalMap.keySet().hashCode(); + } + + @Override + public String toString() { + return _internalMap.keySet().toString(); + } +} \ No newline at end of file Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,213 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalIdentifierGeneratorFactory; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.dao.impl.BeanMetaDataFactoryImpl; +import org.seasar.dao.impl.BeanMetaDataImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * BeanMetaDataFactoryImpl for DBFlute. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BeanMetaDataFactoryExtension extends BeanMetaDataFactoryImpl { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The map of bean meta data for cache. */ + protected Map<Class<? extends Entity>, BeanMetaData> _metaMap = newConcurrentHashMap(); + + //========================================================================== + // ========= + // Override for Cache + // ================== + @Override + public BeanMetaData createBeanMetaData(Class beanClass) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass); + } + } + + @Override + public BeanMetaData createBeanMetaData(Class beanClass, + int relationNestLevel) { + final BeanMetaData cachedMeta = findCachedMeta(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(beanClass, relationNestLevel); + } + } + + @Override + public BeanMetaData createBeanMetaData(DatabaseMetaData dbMetaData, + Class beanClass, int relationNestLevel) { + final BeanMetaData cachedMeta = findOrCreateCachedMetaIfNeeds( + dbMetaData, beanClass, relationNestLevel); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, + relationNestLevel); + } + } + + protected BeanMetaData findCachedMeta(Class beanClass) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } + } + return null; + } + + protected BeanMetaData findOrCreateCachedMetaIfNeeds( + DatabaseMetaData dbMetaData, Class beanClass, int relationNestLevel) { + if (isDBFluteEntity(beanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(beanClass); + if (cachedMeta != null) { + return cachedMeta; + } else { + return super.createBeanMetaData(dbMetaData, beanClass, 0); + } + } + return null; + } + + //========================================================================== + // ========= + // BeanMetaData Creation + // ===================== + @Override + protected BeanMetaDataImpl createBeanMetaDataImpl() { + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // = = + // for ConditionBean and insert() and update() and delete() and so on... + // = = = = = = = = = =/ + return new BeanMetaDataImpl() { + protected List<IdentifierGenerator> _internalIdentifierGeneratorList = new ArrayList<IdentifierGenerator>(); + + protected Map<String, IdentifierGenerator> _internalIdentifierGeneratorsByPropertyName = newConcurrentHashMap(); + + // /= = = = = = = + // for cache + // = = = = =/ + @Override + public void initialize() { // for Cache + final Class myBeanClass = getBeanClass(); + if (isDBFluteEntity(myBeanClass)) { + final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); + if (cachedMeta == null) { + _metaMap.put(myBeanClass, this); + } + } + super.initialize(); + } + + // /= = = = = = = + // for insert() + // = = = = =/ + // The attributes 'identifierGenerators' and + // 'identifierGeneratorsByPropertyName' + // of super class are unused. It prepares original atributes here. + @Override + protected void setupIdentifierGenerator(PropertyType propertyType) { + final PropertyDesc pd = propertyType.getPropertyDesc(); + final String propertyName = propertyType.getPropertyName(); + final String idType = beanAnnotationReader.getId(pd, getDbms()); + final IdentifierGenerator generator = createInternalIdentifierGenerator( + propertyType, idType); + _internalIdentifierGeneratorList.add(generator); + _internalIdentifierGeneratorsByPropertyName.put(propertyName, + generator); + } + + protected IdentifierGenerator createInternalIdentifierGenerator( + PropertyType propertyType, String idType) { + return InternalIdentifierGeneratorFactory + .createIdentifierGenerator(propertyType, getDbms(), + idType); + } + + @Override + public IdentifierGenerator getIdentifierGenerator(int index) { + return _internalIdentifierGeneratorList.get(index); + } + + @Override + public int getIdentifierGeneratorSize() { + return _internalIdentifierGeneratorList.size(); + } + + @Override + public IdentifierGenerator getIdentifierGenerator( + String propertyName) { + return _internalIdentifierGeneratorsByPropertyName + .get(propertyName); + } + }; + } + + // /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + // Other extension points about BeanMetaDataImpl is as follows: + // + // S2DaoMetaDataExtension.createNonConcurrencyBmdFactory() + // --> for NonConcurrency (updateNonstrict() and deleteNonstrict() and so + // on...) + // + // S2DaoMetaDataExtension.createOutsideSqlCustomizeBeanMetaDataFactory() + // --> for OutsideSql but it overrides nothing. + // = = = = = = = = = =/ + + //========================================================================== + // ========= + // Relation Next Level + // =================== + /** + * Get the limit nest level of relation. + * + * @return The limit nest level of relation. + */ + @Override + protected int getLimitRelationNestLevel() { + return 2; // for Compatible to old version DBFlute + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected <KEY, VALUE> ConcurrentHashMap<KEY, VALUE> newConcurrentHashMap() { + return new ConcurrentHashMap<KEY, VALUE>(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean isDBFluteEntity(Class beanClass) { + return Entity.class.isAssignableFrom(beanClass); + } + + protected BeanMetaData getMetaFromCache(Class beanClass) { + return _metaMap.get(beanClass); + } +} \ No newline at end of file Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; @@ -41,6 +42,9 @@ /** Does it skip to cursor end? */ protected boolean _skipToCursorEnd; + /** Is the database DB2? */ + protected final boolean _db2 = DBDef.isCurrentDef(DBDef.DB2); + //========================================================================== // ========= // Constructor @@ -71,7 +75,7 @@ // Skip // ==== /** - * Skip to start-index. + * Skip to the point at start index. */ protected void skip() { if (!isAvailableSkipRecord()) { @@ -125,12 +129,15 @@ // Next // ==== /** - * Next. + * Move to the next record. * * @return Does the result set have next record? * @throws SQLException */ public boolean next() throws SQLException { + if (_db2 && _skipToCursorEnd) { // [DBFLUTE-243] + return false; + } final boolean hasNext = super.next(); ++_requestCounter; if (!isAvailableLimitLoopCount()) { Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,215 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanAnnotationReader; +import org.seasar.dao.ColumnNaming; +import org.seasar.dao.Dbms; +import org.seasar.dao.PropertyTypeFactory; +import org.seasar.dao.PropertyTypeFactoryBuilder; +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.impl.AbstractPropertyTypeFactory; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; + +/** + * The factory builder of property type for S2Dao. {Since S2Dao-1.0.47} + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class PropertyTypeFactoryBuilderExtension implements + PropertyTypeFactoryBuilder { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected ColumnNaming columnNaming; + + //========================================================================== + // ========= + // Build + // ===== + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming); + } + + public PropertyTypeFactory build(Class beanClass, + BeanAnnotationReader beanAnnotationReader, Dbms dbms, + DatabaseMetaData databaseMetaData) { + return new FastPropertyTypeFactoryExtension(beanClass, + beanAnnotationReader, valueTypeFactory, columnNaming, dbms); + } + + //========================================================================== + // ========= + // Extension Class + // =============== + protected static class FastPropertyTypeFactoryExtension extends + AbstractPropertyTypeFactory { + + protected DBMeta _dbmeta; + + protected String[] _noPersisteneProps; + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming); + initializeResources(); + } + + public FastPropertyTypeFactoryExtension(Class beanClass, + BeanAnnotationReader beanAnnotationReader, + ValueTypeFactory valueTypeFactory, ColumnNaming columnNaming, + Dbms dbms) { + super(beanClass, beanAnnotationReader, valueTypeFactory, + columnNaming, dbms); + initializeResources(); + } + + protected void initializeResources() { + if (isEntity()) { + _dbmeta = findDBMeta(); + } + _noPersisteneProps = beanAnnotationReader.getNoPersisteneProps(); + } + + protected boolean isEntity() { + return Entity.class.isAssignableFrom(beanClass); + } + + protected boolean hasDBMeta() { + return _dbmeta != null; + } + + protected DBMeta findDBMeta() { + try { + final Entity entity = (Entity) beanClass.newInstance(); + return entity.getDBMeta(); + } catch (Exception e) { + String msg = "beanClass.newInstance() threw the exception: beanClass=" + + beanClass; + throw new RuntimeException(msg, e); + } + } + + public PropertyType[] createBeanPropertyTypes(String tableName) { + final List<PropertyType> list = new ArrayList<PropertyType>(); + final BeanDesc beanDesc = getBeanDesc(); + for (int i = 0; i < beanDesc.getPropertyDescSize(); ++i) { + final PropertyDesc pd = beanDesc.getPropertyDesc(i); + + // Read-only property is unnecessary! + if (!pd.hasWriteMethod()) { + continue; + } + + // Relation property is unnecessary! + if (isRelation(pd)) { + continue; + } + + final PropertyType pt = createPropertyType(pd); + pt.setPrimaryKey(isPrimaryKey(pd)); + pt.setPersistent(isPersistent(pt)); + list.add(pt); + } + return list.toArray(new PropertyType[list.size()]); + } + + @Override + protected boolean isRelation(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() + && (_dbmeta.hasForeign(propertyName) || _dbmeta + .hasReferrer(propertyName))) { + return true; + } + return hasRelationNoAnnotation(propertyDesc); + } + + protected boolean hasRelationNoAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.hasRelationNo(propertyDesc); + } + + @Override + protected boolean isPrimaryKey(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + if (hasDBMeta() && _dbmeta.hasPrimaryKey() + && _dbmeta.hasColumn(propertyName)) { + if (_dbmeta.findColumnInfo(propertyName).isPrimary()) { + return true; + } + } + return hasIdAnnotation(propertyDesc); + } + + protected boolean hasIdAnnotation(PropertyDesc propertyDesc) { + final Dbms dbms = getDbms(); + return beanAnnotationReader.getId(propertyDesc, dbms) != null; + } + + @Override + protected boolean isPersistent(PropertyType propertyType) { + final String propertyName = propertyType.getPropertyName(); + final PropertyDesc propertyDesc = propertyType.getPropertyDesc(); + if ((hasDBMeta() && _dbmeta.hasColumn(propertyName)) + || hasColumnAnnotation(propertyDesc)) { + if (!isElementOfNoPersistentProps(propertyDesc)) { + return true; + } + } + return false; + } + + protected boolean hasColumnAnnotation(PropertyDesc propertyDesc) { + return beanAnnotationReader.getColumnAnnotation(propertyDesc) != null; + } + + protected boolean isElementOfNoPersistentProps(PropertyDesc propertyDesc) { + final String propertyName = propertyDesc.getPropertyName(); + final String[] props = _noPersisteneProps; + if (props != null && props.length >= 0) { + for (int i = 0; i < props.length; ++i) { + if (props[i].equals(propertyName)) { + return true; + } + } + } + return false; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ValueTypeFactory getValueTypeFactory() { + return valueTypeFactory; + } + + public void setValueTypeFactory(ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + public ColumnNaming getColumnNaming() { + return columnNaming; + } + + public void setColumnNaming(ColumnNaming columnNaming) { + this.columnNaming = columnNaming; + } +} Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,21 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao; + +import jp.sf.pal.timecard.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; + +/** + * The provider of latest SQL using SqlLogRegistry. This instance should be + * singleton. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlLogRegistryLatestSqlProvider implements LatestSqlProvider { + + public String getDisplaySql() { + return InternalSqlLogRegistry.peekCompleteSql(); + } + + public void clearSqlCache() { + InternalSqlLogRegistry.clearSqlLogRegistry(); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.timecard.db.allcommon.helper.StringSet; + import org.seasar.dao.DtoMetaData; import org.seasar.dao.RowCreator; import org.seasar.extension.jdbc.ResultSetHandler; -import org.seasar.framework.util.CaseInsensitiveSet; /** * @author DBFlute(AutoGenerator) @@ -67,10 +68,10 @@ return rowCreator.createRow(rs, propertyCache, beanClass); } - protected Set createColumnNames(final ResultSetMetaData rsmd) + protected Set<String> createColumnNames(final ResultSetMetaData rsmd) throws SQLException { final int count = rsmd.getColumnCount(); - final Set columnNames = new CaseInsensitiveSet(); + final Set<String> columnNames = StringSet.createAsCaseInsensitive(); for (int i = 0; i < count; ++i) { final String columnName = rsmd.getColumnLabel(i + 1); final int pos = columnName.lastIndexOf('.'); // [DAO-41] Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,7 +10,6 @@ import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.PrimaryKeyNotFoundRuntimeException; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -24,19 +23,13 @@ //========================================================================== // ========= - // Definition - // ========== - protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; - - //========================================================================== - // ========= // Attribute // ========= private PropertyType[] propertyTypes; - private boolean checkSingleRowUpdate = true; + protected boolean optimisticLockHandling; - protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + protected boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -44,15 +37,10 @@ // =========== public InternalAbstractAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean versionNoAutoIncrementOnMemory) { + String[] propertyNames, boolean optimisticLockHandling, + boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData); + this.optimisticLockHandling = optimisticLockHandling; this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; setupPropertyTypes(propertyNames); setupSql(); @@ -62,26 +50,19 @@ // ========= // Execute // ======= - public Object execute(Object[] args) { + public Object execute(Object[] args) { // NOT for Batch. Batch should + // override. InternalAbstractAutoHandler handler = createAutoHandler(); + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); handler.setLoggingMessageSqlArgs(args); int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw createNotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } - - protected NotSingleRowUpdatedRuntimeException createNotSingleRowUpdatedRuntimeException( + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( Object bean, int rows) { return new EntityAlreadyUpdatedException(bean, rows); } @@ -194,7 +175,7 @@ protected void setupDeleteSql() { checkPrimaryKey(); - StringBuilder sb = new StringBuilder(100); + final StringBuilder sb = new StringBuilder(100); sb.append("delete from "); sb.append(getBeanMetaData().getTableName()); setupUpdateWhere(sb); @@ -215,11 +196,11 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -15,49 +15,30 @@ //========================================================================== // ========= - // Attribute - // ========= - protected final boolean returningRows; - - //========================================================================== - // ========= // Constructor // =========== public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - this(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY); - } - - public InternalAbstractBatchAutoStaticCommand(DataSource dataSource, - StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - versionNoAutoIncrementOnMemory); - this.returningRows = returningRows; + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== // ========= // Execute // ======= + @Override public Object execute(Object[] args) { final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); - - // It is unnecessary! - // injectDaoClass(handler); - + handler.setOptimisticLockHandling(optimisticLockHandling); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); handler.setSql(getSql()); // The logging message SQL of procedure is unnecessary. // handler.setLoggingMessageSqlArgs(args); - if (this.returningRows) { - return handler.executeBatch(args); - } else { - final int updatedRows = handler.execute(args); - return new Integer(updatedRows); - } + return handler.executeBatch(args); } protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,10 +44,15 @@ } protected InternalSqlParser createInternalSqlParser(String sql) { - return new InternalSqlParser(sql); + return new InternalSqlParser(sql, isBlockNullParameter()); } - public CommandContext apply(Object[] args) {// It is necessary to be public! + protected boolean isBlockNullParameter() { // Extension Point! + return false; + } + + public CommandContext apply(Object[] args) { // It is necessary to be + // public! final CommandContext ctx = createCommandContext(args); rootNode.accept(ctx); return ctx; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; + import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public abstract class InternalAbstractSqlCommand implements SqlCommand { +public abstract class InternalAbstractSqlCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,8 +20,9 @@ // =========== public InternalDeleteAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames) { - super(dataSource, statementFactory, beanMetaData, propertyNames); + String[] propertyNames, boolean optimisticLockHandling) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + optimisticLockHandling, false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,9 +21,9 @@ // =========== public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { + String[] propertyNames, boolean optimisticLockHandling) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + optimisticLockHandling, false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; @@ -16,7 +17,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -83,7 +85,7 @@ String[] argNames, Class<?>[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalInsertAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.IdentifierGenerator; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; import org.seasar.dao.SqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -18,7 +18,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalInsertAutoDynamicCommand implements SqlCommand { +public class InternalInsertAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -32,8 +33,6 @@ protected String[] propertyNames; - protected boolean checkSingleRowUpdate = true; - //========================================================================== // ========= // Constructor @@ -56,9 +55,6 @@ handler.setSql(sql); handler.setLoggingMessageSqlArgs(args); final int rows = handler.execute(args); - if (isCheckSingleRowUpdate() && rows != 1) { - throw new NotSingleRowUpdatedRuntimeException(args[0], rows); - } return new Integer(rows); } @@ -161,12 +157,4 @@ public void setPropertyNames(String[] propertyNames) { this.propertyNames = propertyNames; } - - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { - this.checkSingleRowUpdate = checkSingleRowUpdate; - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,9 +21,9 @@ // =========== public InternalInsertBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows) { - super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows); + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames, false, + false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; @@ -13,7 +14,7 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalProcedureCommand implements SqlCommand { +public class InternalProcedureCommand implements SqlCommand, SqlExecution { //========================================================================== // ========= Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.XLog; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateAutoHandler; import org.seasar.dao.BeanMetaData; import org.seasar.dao.NoUpdatePropertyTypeRuntimeException; -import org.seasar.dao.impl.AbstractSqlCommand; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateAutoDynamicCommand extends AbstractSqlCommand { +public class InternalUpdateAutoDynamicCommand extends + InternalAbstractSqlCommand { //========================================================================== // ========= // Definition // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(InternalUpdateAutoDynamicCommand.class); + /** The result for no update as normal execution. */ + private static final Integer NO_UPDATE = new Integer(1); - private static final Integer NO_UPDATE = new Integer(0); - //========================================================================== // ========= // Attribute @@ -36,9 +34,9 @@ private String[] propertyNames; - private boolean checkSingleRowUpdate = true; + private boolean optimisticLockHandling; - private boolean versionNoAutoIncrementOnMemory = true; + private boolean versionNoAutoIncrementOnMemory; //========================================================================== // ========= @@ -59,8 +57,8 @@ final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, bean, getPropertyNames()); if (propertyTypes.length == 0) { - if (_log.isDebugEnabled()) { - _log.debug(createNoUpdateLogMessage(bean, bmd)); + if (isLogEnabled()) { + log(createNoUpdateLogMessage(bean, bmd)); } return NO_UPDATE; } @@ -83,10 +81,10 @@ BeanMetaData bmd, PropertyType[] propertyTypes) { InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler.setOptimisticLockHandling(optimisticLockHandling); //[DBFlute-0.8 + // .0] handler .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); - handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 - // .0] return handler; } @@ -182,17 +180,33 @@ sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); } sb.setLength(sb.length() - 5); - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); sb.append(" and ").append(pt.getColumnName()).append(" = ?"); } return sb.toString(); } + //========================================================================== + // ========= + // Execute Status Log + // ================== + protected void log(String msg) { + XLog.log(msg); + } + + protected boolean isLogEnabled() { + return XLog.isLogEnabled(); + } + + //========================================================================== + // ========= + // Accessor + // ======== protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } @@ -223,11 +237,7 @@ this.propertyNames = propertyNames; } - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,10 +21,10 @@ // =========== public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, - String[] propertyNames, boolean returningRows, + String[] propertyNames, boolean optimisticLockHandling, boolean versionNoAutoIncrementOnMemory) { super(dataSource, statementFactory, beanMetaData, propertyNames, - returningRows, versionNoAutoIncrementOnMemory); + optimisticLockHandling, versionNoAutoIncrementOnMemory); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -28,11 +28,16 @@ // ======= public Object execute(Object args[]) { final CommandContext ctx = apply(args); - final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( - getDataSource(), ctx.getSql(), getStatementFactory()); - Object[] bindVariables = ctx.getBindVariables(); + final InternalBasicUpdateHandler updateHandler = createBasicUpdateHandler(ctx); + final Object[] bindVariables = ctx.getBindVariables(); updateHandler.setLoggingMessageSqlArgs(bindVariables); return new Integer(updateHandler.execute(bindVariables, ctx .getBindVariableTypes())); } + + protected InternalBasicUpdateHandler createBasicUpdateHandler( + CommandContext ctx) { + return new InternalBasicUpdateHandler(getDataSource(), ctx.getSql(), + getStatementFactory()); + } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.timecard.db.allcommon.Entity; +import jp.sf.pal.timecard.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMetaInstanceHandler; @@ -27,7 +28,8 @@ /** * @author DBFlute(AutoGenerator) */ -public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand, + SqlExecution { //========================================================================== // ========= @@ -209,7 +211,7 @@ String[] argNames, Class<?>[] argTypes, Object[] args) { CommandContext context; { - InternalSqlParser parser = new InternalSqlParser(twoWaySql); + InternalSqlParser parser = new InternalSqlParser(twoWaySql, true); Node node = parser.parse(); InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.util.IntegerConversionUtil; /** * @author DBFlute(AutoGenerator) @@ -38,8 +40,10 @@ protected PropertyType[] propertyTypes; - protected boolean versionNoAutoIncrementOnMemory = true; + protected boolean optimisticLockHandling; + protected boolean versionNoAutoIncrementOnMemory; + //========================================================================== // ========= // Constructor @@ -52,6 +56,10 @@ this.propertyTypes = propertyTypes; } + //========================================================================== + // ========= + // Execute + // ======= public int execute(Object[] args) { Connection connection = getConnection(); try { @@ -77,6 +85,9 @@ } finally { close(ps); } + if (optimisticLockHandling && ret != 1) { + throw createEntityAlreadyUpdatedException(bean, ret); + } postUpdateBean(bean, ret); return ret; } @@ -96,12 +107,25 @@ } } + protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + //========================================================================== + // ========= + // Pre/Post Bean + // ============= protected void preUpdateBean(Object bean) { } protected void postUpdateBean(Object bean, int ret) { } + //========================================================================== + // ========= + // Bind Setupper + // ============= protected abstract void setupBindVariables(Object bean); protected void setupInsertBindVariables(Object bean) { @@ -149,7 +173,7 @@ if (value == null) { continue;// because of 'VERSION_NO = VERSION_NO + 1' } - int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + int intValue = SimpleTypeUtil.toPrimitiveInt(value) + 1; setVersionNo(new Integer(intValue)); varList.add(getVersionNo()); } else { @@ -182,13 +206,13 @@ varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasVersionNoPropertyType()) { + if (optimisticLockHandling && bmd.hasVersionNoPropertyType()) { PropertyType pt = bmd.getVersionNoPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); varValueTypeList.add(pt.getValueType()); } - if (bmd.hasTimestampPropertyType()) { + if (optimisticLockHandling && bmd.hasTimestampPropertyType()) { PropertyType pt = bmd.getTimestampPropertyType(); PropertyDesc pd = pt.getPropertyDesc(); varList.add(pd.getValue(bean)); @@ -260,6 +284,14 @@ this.propertyTypes = propertyTypes; } + public boolean isOptimisticLockHandling() { + return optimisticLockHandling; + } + + public void setOptimisticLockHandling(boolean optimisticLockHandling) { + this.optimisticLockHandling = optimisticLockHandling; + } + protected boolean isVersionNoAutoIncrementOnMemory() { return versionNoAutoIncrementOnMemory; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.DBDef; +import jp.sf.pal.timecard.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.timecard.db.allcommon.exception.EntityDuplicatedException; + import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -41,6 +46,39 @@ // ========= // Execute // ======= + public int execute(Object[] args) { + List<?> list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List<?>) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + int[] ret = execute(list); + int updatedRow = 0; + for (int i = 0; i < ret.length; i++) { + if (ret[i] > 0) { + updatedRow += ret[i]; + } + } + return updatedRow; + } + + public int[] executeBatch(Object[] args) { + List<?> list = null; + if (args[0] instanceof Object[]) { + list = Arrays.asList((Object[]) args[0]); + } else if (args[0] instanceof List) { + list = (List<?>) args[0]; + } + if (list == null) { + throw new IllegalArgumentException("args[0]"); + } + return execute(list); + } + public int[] execute(List<?> list, Class<?>[] argTypes) { return execute(list); } @@ -63,7 +101,9 @@ final Object bean = (Object) iter.next(); prepareBatchElement(ps, bean); } - return executeBatch(ps, list); + final int[] result = executeBatch(ps, list); + handleBatchUpdateResultWithOptimisticLock(ps, list, result); + return result; } finally { close(ps); } @@ -74,46 +114,100 @@ // postBatchUpdateBean(...); } - public int execute(Object[] args) { - List<?> list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List<?>) args[0]; + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // Optimistic Lock + // =============== + protected void handleBatchUpdateResultWithOptimisticLock( + PreparedStatement ps, List<?> list, int[] result) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { + final int updateCount; + try { + updateCount = ps.getUpdateCount(); + } catch (SQLException e) { + handleSQLException(e, ps); + return; // Unreachable! + } + handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, + updateCount); + } else { + handleBatchUpdateResultWithOptimisticLockByResult(list, result); } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + } + + protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( + List<?> list, int updateCount) { + if (list.isEmpty()) { + return;// for Safety! } - int[] ret = execute(list); - int updatedRow = 0; - for (int i = 0; i < ret.length; i++) { - if (ret[i] > 0) { - updatedRow += ret[i]; + if (updateCount < 0) { + return;// for Safety! + } + final int entityCount = list.size(); + if (updateCount < entityCount) { + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, + updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " updateCount=" + updateCount; + msg = msg + " entityCount=" + entityCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); } } - return updatedRow; } - public int[] executeBatch(Object[] args) { - List<?> list = null; - if (args[0] instanceof Object[]) { - list = Arrays.asList((Object[]) args[0]); - } else if (args[0] instanceof List) { - list = (List<?>) args[0]; + protected void handleBatchUpdateResultWithOptimisticLockByResult( + List<?> list, int[] result) { + if (list.isEmpty()) { + return;// for Safety! } - if (list == null) { - throw new IllegalArgumentException("args[0]"); + final int[] updatedCountArray = result; + final int entityCount = list.size(); + int index = 0; + boolean alreadyUpdated = false; + for (int oneUpdateCount : updatedCountArray) { + if (entityCount <= index) { + break;// for Safety! + } + if (oneUpdateCount == 0) { + alreadyUpdated = true; + break; + } else if (oneUpdateCount > 1) { + String msg = "The entity updated two or more records in batch update:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updatedCount=" + oneUpdateCount; + msg = msg + " allEntities=" + list; + throw new EntityDuplicatedException(msg); + } + ++index; } - return execute(list); + if (alreadyUpdated) { + int updateCount = 0; + for (int oneUpdateCount : updatedCountArray) { + updateCount = updateCount + oneUpdateCount; + } + if (isOptimisticLockHandling()) { + throw new BatchEntityAlreadyUpdatedException(list.get(index), + 0, updateCount); + } else { + String msg = "The entity have already deleted:"; + msg = msg + " entity=" + list.get(index); + msg = msg + " updateCount=" + updateCount; + msg = msg + " allEntities=" + list; + throw new EntityAlreadyDeletedException(msg); + } + } } - protected void prepareBatchElement(PreparedStatement ps, Object bean) { - setupBindVariables(bean); - logSql(getBindVariables(), getArgTypes(getBindVariables())); - bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); - addBatch(ps); - } - //========================================================================== // ========= // JDBC Delegator Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.timecard.db.allcommon.CallbackContext; +import jp.sf.pal.timecard.db.allcommon.DBDef; import jp.sf.pal.timecard.db.allcommon.DBFluteConfig; import jp.sf.pal.timecard.db.allcommon.InternalMapContext; import jp.sf.pal.timecard.db.allcommon.QLog; @@ -25,7 +26,6 @@ import org.seasar.extension.jdbc.StatementFactory; import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.exception.SQLRuntimeException; /** * @author DBFlute(AutoGenerator) @@ -73,7 +73,7 @@ return; } for (int i = 0; i < args.length; ++i) { - ValueType valueType = getValueType(argTypes[i]); + final ValueType valueType = findValueType(args[i], argTypes[i]); try { valueType.bindValue(ps, i + 1, args[i]); } catch (SQLException e) { @@ -82,6 +82,19 @@ } } + protected ValueType findValueType(Object arg, Class<?> argType) { + ValueType valueType = ValueTypes.getValueType(arg); + if (valueType != null) { + return valueType; + } + valueType = ValueTypes.getValueType(argType); + if (valueType != null) { + return valueType; + } + String msg = "Unknown type:argType=" + argType + " args=" + arg; + throw new IllegalStateException(msg); + } + protected Class<?>[] getArgTypes(Object[] args) { if (args == null) { return null; @@ -151,10 +164,6 @@ return InternalBindVariableUtil.getBindVariableText(bindVariable); } - protected ValueType getValueType(Class<?> clazz) { - return ValueTypes.getValueType(clazz); - } - //========================================================================== // ========= // Exception Handler @@ -194,9 +203,6 @@ public void handleSQLException(SQLException e, Statement statement, boolean uniqueConstraintValid, String completeSql) { - if (isSqlExceptionOldStyleHandling()) { - throw new SQLRuntimeException(e); - } if (uniqueConstraintValid && isUniqueConstraintException(e)) { throwEntityAlreadyExistsException(e, statement, completeSql); } @@ -217,10 +223,6 @@ .getUniqueConstraintDeterminator(); } - protected boolean isSqlExceptionOldStyleHandling() { - return DBFluteConfig.getInstance().isSqlExceptionOldStyleHandling(); - } - protected void throwEntityAlreadyExistsException(SQLException e, Statement statement, String completeSql) { String msg = "Look! Read the message below." + getLineSeparator(); @@ -560,7 +562,7 @@ // ========= // Assist Helper // ============= - // It needs this method if the target database doest not support line + // It needs this method if the target database does not support line // comment. protected String removeLineComment(final String sql) { // With removing CR! if (sql == null || sql.trim().length() == 0) { @@ -578,7 +580,8 @@ } sb.append(line).append("\n"); } - return sb.toString(); + final String filteredSql = sb.toString(); + return filteredSql.substring(0, filteredSql.lastIndexOf("\n")); } //========================================================================== @@ -606,9 +609,17 @@ } public void setSql(String sql) { + if (isRemoveLineCommentFromSql()) { + sql = removeLineComment(sql); + } this.sql = sql; } + protected boolean isRemoveLineCommentFromSql() { + // Because the MS-Access does not support line comments. + return DBDef.isCurrentDef(DBDef.MSAccess); + } + public StatementFactory getStatementFactory() { return statementFactory; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -45,8 +45,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public Object execute(Object[] args, Class[] argTypes) { + public Object execute(Object[] args, Class<?>[] argTypes) { Connection conn = getConnection(); try { return execute(conn, args, argTypes); @@ -55,8 +54,7 @@ } } - @SuppressWarnings("unchecked") - public Object execute(Connection conn, Object[] args, Class[] argTypes) { + public Object execute(Connection conn, Object[] args, Class<?>[] argTypes) { logSql(args, argTypes); PreparedStatement ps = null; try { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -29,8 +29,7 @@ return execute(args, getArgTypes(args)); } - @SuppressWarnings("unchecked") - public int execute(Object[] args, Class[] argTypes) { + public int execute(Object[] args, Class<?>[] argTypes) { Connection connection = getConnection(); try { return execute(connection, args, argTypes); @@ -39,8 +38,7 @@ } } - @SuppressWarnings("unchecked") - public int execute(Connection connection, Object[] args, Class[] argTypes) { + public int execute(Connection connection, Object[] args, Class<?>[] argTypes) { logSql(args, argTypes); PreparedStatement ps = prepareStatement(connection); try { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.timecard.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; @@ -21,7 +22,6 @@ import org.seasar.extension.jdbc.ValueType; import org.seasar.extension.jdbc.impl.PropertyTypeImpl; import org.seasar.extension.jdbc.types.ValueTypes; -import org.seasar.framework.util.CaseInsensitiveMap; /** * @author DBFlute(AutoGenerator) @@ -220,10 +220,9 @@ protected static abstract class InternalAbstractMapResultSetHandler implements ResultSetHandler { - @SuppressWarnings("unchecked") protected Map<String, Object> createRow(ResultSet rs, PropertyType[] propertyTypes) throws SQLException { - Map<String, Object> row = new CaseInsensitiveMap(); + Map<String, Object> row = StringKeyMap.createAsFlexible(); for (int i = 0; i < propertyTypes.length; ++i) { Object value = propertyTypes[i].getValueType().getValue(rs, i + 1); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.timecard.db.allcommon.exception.EntityAlreadyUpdatedException; - import org.seasar.dao.BeanMetaData; import org.seasar.extension.jdbc.PropertyType; import org.seasar.extension.jdbc.StatementFactory; @@ -17,12 +15,6 @@ // ========= // Constructor // =========== - private boolean checkSingleRowUpdate = true; - - //========================================================================== - // ========= - // Constructor - // =========== public InternalUpdateAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { @@ -41,27 +33,7 @@ @Override protected void postUpdateBean(Object bean, int ret) { - if (isCheckSingleRowUpdate() && ret < 1) { - throw createEntityAlreadyUpdatedException(bean, ret); - } updateVersionNoIfNeed(bean); updateTimestampIfNeed(bean); } - - protected EntityAlreadyUpdatedException createEntityAlreadyUpdatedException( - Object bean, int rows) { - return new EntityAlreadyUpdatedException(bean, rows); - } - - //========================================================================== - // ========= - // Accessor - // ======== - public boolean isCheckSingleRowUpdate() { - return checkSingleRowUpdate; - } - - public void setCheckSingleRowUpdate(boolean resultCheck) { - this.checkSingleRowUpdate = resultCheck; - } } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -45,22 +45,25 @@ // ========= // Attribute // ========= + protected String specifiedSql; + + protected boolean blockNullParameter; + protected InternalSqlTokenizer tokenizer; protected Stack<Node> nodeStack = new Stack<Node>(); - protected String specifiedSql;// Extension! - //========================================================================== // ========= // Constructor // =========== - public InternalSqlParser(String sql) { + public InternalSqlParser(String sql, boolean blockNullParameter) { sql = sql.trim(); if (sql.endsWith(";")) { sql = sql.substring(0, sql.length() - 1); } - specifiedSql = sql;// Extension! + specifiedSql = sql; + this.blockNullParameter = blockNullParameter; tokenizer = new InternalSqlTokenizer(sql); } @@ -303,12 +306,14 @@ protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension // ! - return new InternalBindVariableNode(expr, testValue, specifiedSql); + return new InternalBindVariableNode(expr, testValue, specifiedSql, + blockNullParameter); } protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension // ! - return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql, + blockNullParameter); } protected ContainerNode createIfNode(String expr) {// Extension! @@ -344,12 +349,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalBindVariableNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -360,7 +368,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -462,12 +470,15 @@ protected String _specifiedSql; + protected boolean _blockNullParameter; + public InternalEmbeddedValueNode(String expression, String testValue, - String specifiedSql) { + String specifiedSql, boolean blockNullParameter) { this._expression = expression; this._testValue = testValue; this._names = InternalStringUtil.split(expression, "."); this._specifiedSql = specifiedSql; + this._blockNullParameter = blockNullParameter; } public void accept(CommandContext ctx) { @@ -478,7 +489,7 @@ valueAndType.setTargetType(clazz); setupValueAndType(valueAndType); - if (valueAndType.getTargetValue() == null) { + if (_blockNullParameter && valueAndType.getTargetValue() == null) { throwBindOrEmbeddedParameterNullValueException(valueAndType); } if (!isInScope()) { @@ -1276,7 +1287,8 @@ String[] argNames, Class<?>[] argTypes, Object[] args) { final CommandContext context; { - final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final InternalSqlParser parser = new InternalSqlParser(twoWaySql, + false); final Node node = parser.parse(); final InternalCommandContextCreator creator = new InternalCommandContextCreator( argNames, argTypes); Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,146 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalIdentifierAbstractGenerator implements + IdentifierGenerator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected PropertyType propertyType; + + protected Dbms dbms; + + protected ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAbstractGenerator(PropertyType propertyType, + Dbms dbms) { + this.propertyType = propertyType; + this.dbms = dbms; + resultSetHandler = new InternalIdentifierResultSetHandler(propertyType + .getValueType()); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected Object executeSql(DataSource ds, String sql, Object[] args) { + InternalBasicSelectHandler selectHandler = createSelectHandler(ds, sql); + if (args != null) { + selectHandler.setLoggingMessageSqlArgs(args); + } + return selectHandler.execute(args); + } + + protected InternalBasicSelectHandler createSelectHandler(DataSource ds, + String sql) { + // Use original statement factory for identifier generator. + return new InternalBasicSelectHandler(ds, sql, resultSetHandler, + createStatementFactory(ds, sql)); + } + + protected StatementFactory createStatementFactory(DataSource ds, String sql) { + return new InternalIdentifierGeneratorStatementFactory(); + } + + protected void reflectIdentifier(Object bean, Object value) { + if (propertyType == null) { + String msg = "The arguement[propertyType] should not be null: value=" + + value; + throw new IllegalArgumentException(msg); + } + PropertyDesc pd = propertyType.getPropertyDesc(); + pd.setValue(bean, value); + } + + //========================================================================== + // ========= + // Result Set Handler + // ================== + protected static class InternalIdentifierResultSetHandler implements + ResultSetHandler { + private ValueType valueType; + + public InternalIdentifierResultSetHandler(ValueType valueType) { + this.valueType = valueType; + } + + public Object handle(ResultSet rs) throws SQLException { + if (rs.next()) { + return valueType.getValue(rs, 1); + } + return null; + } + } + + //========================================================================== + // ========= + // Statement Factory + // ================= + protected static class InternalIdentifierGeneratorStatementFactory + implements StatementFactory { + public PreparedStatement createPreparedStatement(Connection conn, + String sql) { + try { + return conn.prepareStatement(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, + String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null; // Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getPropertyName() { + return propertyType.getPropertyName(); + } + + public Dbms getDbms() { + return dbms; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,33 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierAssignedGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierAssignedGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + } + + public boolean isSelfGenerate() { + return true; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,105 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.timecard.db.allcommon.util.SimpleStringUtil; + +import org.seasar.dao.Dbms; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.ClassUtil; +import org.seasar.framework.util.ConstructorUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierGeneratorFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + private static Map<String, Class<?>> generatorClasses = new HashMap<String, Class<?>>(); + + static { + addIdentifierGeneratorClass("assigned", + InternalIdentifierAssignedGenerator.class); + addIdentifierGeneratorClass("identity", + InternalIdentifierIdentityGenerator.class); + addIdentifierGeneratorClass("sequence", + InternalIdentifierSequenceGenerator.class); + } + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalIdentifierGeneratorFactory() { + } + + //========================================================================== + // ========= + // Identifier Generator + // ==================== + public static void addIdentifierGeneratorClass(String name, Class<?> clazz) { + generatorClasses.put(name, clazz); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms) { + return createIdentifierGenerator(propertyType, dbms, null); + } + + public static IdentifierGenerator createIdentifierGenerator( + PropertyType propertyType, Dbms dbms, String annotation) { + if (propertyType == null) { + String msg = "The argument[propertyType] should not be null: dbms=" + + dbms + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (dbms == null) { + String msg = "The argument[dbms] should not be null: propertyType=" + + propertyType + " annotation=" + annotation; + throw new IllegalArgumentException(msg); + } + if (annotation == null) { + return new InternalIdentifierAssignedGenerator(propertyType, dbms); + } + String[] array = SimpleStringUtil.split(annotation, "=, "); + Class<?> clazz = getGeneratorClass(array[0]); + IdentifierGenerator generator = createIdentifierGenerator(clazz, + propertyType, dbms); + for (int i = 1; i < array.length; i += 2) { + setProperty(generator, array[i].trim(), array[i + 1].trim()); + } + return generator; + } + + protected static Class<?> getGeneratorClass(String name) { + Class<?> clazz = generatorClasses.get(name); + if (clazz != null) { + return clazz; + } + return ClassUtil.forName(name); + } + + protected static IdentifierGenerator createIdentifierGenerator( + Class<?> clazz, PropertyType propertyType, Dbms dbms) { + Constructor<?> constructor = ClassUtil.getConstructor(clazz, + new Class<?>[] { PropertyType.class, Dbms.class }); + return (IdentifierGenerator) ConstructorUtil.newInstance(constructor, + new Object[] { propertyType, dbms }); + } + + protected static void setProperty(IdentifierGenerator generator, + String propertyName, String value) { + BeanDesc beanDesc = BeanDescFactory.getBeanDesc(generator.getClass()); + PropertyDesc pd = beanDesc.getPropertyDesc(propertyName); + pd.setValue(generator, value); + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,35 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import javax.sql.DataSource; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierIdentityGenerator extends + InternalIdentifierAbstractGenerator { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierIdentityGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + Object value = executeSql(ds, getDbms().getIdentitySelectString(), null); + reflectIdentifier(bean, value); + } + + public boolean isSelfGenerate() { + return false; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,116 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.timecard.db.allcommon.util.SimpleTypeUtil; + +import org.seasar.dao.Dbms; +import org.seasar.extension.jdbc.PropertyType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalIdentifierSequenceGenerator extends + InternalIdentifierAbstractGenerator { + + // - - - - - - - - - - + // [Unused on DBFlute] + // - - - - - - - - - - + + //========================================================================== + // ========= + // Attribute + // ========= + private String sequenceName; + + private long allocationSize = 0; + + private HashMap<DataSource, IdContext> idContextMap = new HashMap<DataSource, IdContext>(); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalIdentifierSequenceGenerator(PropertyType propertyType, + Dbms dbms) { + super(propertyType, dbms); + } + + //========================================================================== + // ========= + // Implementation + // ============== + public void setIdentifier(Object bean, DataSource ds) { + reflectIdentifier(bean, getNextValue(ds)); + } + + public boolean isSelfGenerate() { + return getDbms().isSelfGenerate(); + } + + //========================================================================== + // ========= + // Next Value + // ========== + protected Object getNextValue(DataSource ds) { + if (allocationSize > 0) { + long value = getIdContext(ds).getNextValue(ds); + return new Long(value); + } + return getNewInitialValue(ds); + } + + protected Object getNewInitialValue(DataSource ds) { + return executeSql(ds, getDbms().getSequenceNextValString(sequenceName), + null); + } + + protected IdContext getIdContext(DataSource ds) { + synchronized (idContextMap) { + IdContext context = idContextMap.get(ds); + if (context == null) { + context = new IdContext(); + idContextMap.put(ds, context); + } + return context; + } + } + + public class IdContext { + protected long initialValue; + + protected long allocated = Long.MAX_VALUE; + + public synchronized long getNextValue(DataSource ds) { + if (allocated < allocationSize) { + return initialValue + allocated++; + } + initialValue = SimpleTypeUtil + .toPrimitiveLong(getNewInitialValue(ds)); + allocated = 1; + return initialValue; + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getSequenceName() { + return sequenceName; + } + + public void setSequenceName(String sequenceName) { + this.sequenceName = sequenceName; + } + + public long getAllocationSize() { + return allocationSize; + } + + public void setAllocationSize(long allocationSize) { + this.allocationSize = allocationSize; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.DBDef; import org.seasar.dao.ValueTypeFactory; import org.seasar.dao.util.TypeUtil; @@ -146,9 +146,9 @@ } final Class<?> type = field.getType(); if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. - if (ConditionBeanContext.isOracle()) { + if (DBDef.isCurrentDef(DBDef.Oracle)) { return ValueTypes.ORACLE_RESULT_SET; - } else if (ConditionBeanContext.isPostgreSql()) { + } else if (DBDef.isCurrentDef(DBDef.PostgreSQL)) { return ValueTypes.POSTGRE_RESULT_SET; } else { return ValueTypes.SERIALIZABLE_BYTE_ARRAY; Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,158 @@ +package jp.sf.pal.timecard.db.allcommon.s2dao.internal.various; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.timecard.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.timecard.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalStatementFactory implements StatementFactory { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalStatementFactory.class); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig defaultStatementConfig; + + protected boolean internalDebug; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalStatementFactory() { + } + + //========================================================================== + // ========= + // Implementation + // ============== + public PreparedStatement createPreparedStatement(Connection conn, String sql) { + try { + final StatementConfig config = findStatementConfigOnThread(); + ; + final int resultSetType; + if (config != null && config.hasResultSetType()) { + resultSetType = config.getResultSetType(); + } else if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + resultSetType = defaultStatementConfig.getResultSetType(); + } else { + resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY; + } + final int resultSetConcurrency = java.sql.ResultSet.CONCUR_READ_ONLY; + if (internalDebug) { + _log.debug("...Creating prepareStatement(sql, " + resultSetType + + ", " + resultSetConcurrency + ")"); + } + final PreparedStatement ps = conn.prepareStatement(sql, + resultSetType, resultSetConcurrency); + if (config != null && config.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as request: " + + config); + } + reflectStatementOptions(config, ps); + } else { + reflectDefaultOptionsToStatementIfNeeds(ps); + } + return ps; + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + public CallableStatement createCallableStatement(Connection conn, String sql) { + return prepareCall(conn, sql); + } + + protected StatementConfig findStatementConfigOnThread() { + final StatementConfig config; + if (ConditionBeanContext.isExistConditionBeanOnThread()) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + config = cb.getStatementConfig(); + } else if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + config = context.getStatementConfig(); + } else { + config = null; + } + return config; + } + + protected void reflectDefaultOptionsToStatementIfNeeds(PreparedStatement ps) { + if (defaultStatementConfig != null + && defaultStatementConfig.hasStatementOptions()) { + if (internalDebug) { + _log.debug("...Setting statement config as default: " + + defaultStatementConfig); + } + reflectStatementOptions(defaultStatementConfig, ps); + return; + } + } + + protected void reflectStatementOptions(StatementConfig config, + PreparedStatement ps) { + try { + if (config.hasQueryTimeout()) { + ps.setQueryTimeout(config.getQueryTimeout()); + } + if (config.hasFetchSize()) { + ps.setFetchSize(config.getFetchSize()); + } + if (config.hasMaxRows()) { + ps.setMaxRows(config.getMaxRows()); + } + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + + protected CallableStatement prepareCall(Connection conn, String sql) { + try { + return conn.prepareCall(sql); + } catch (SQLException e) { + handleSQLException(e, null); + return null;// Unreachable! + } + } + + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + this.defaultStatementConfig = defaultStatementConfig; + } + + public void setInternalDebug(boolean internalDebug) { + this.internalDebug = internalDebug; + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,11 +7,8 @@ //========================================================================== // ========= - // Assert + // Object // ====== - // ----------------------------------------------------- - // Assert Object - // ------------- /** * Assert that the object is not null. * @@ -32,9 +29,10 @@ } } - // ----------------------------------------------------- - // Assert String - // ------------- + //========================================================================== + // ========= + // String + // ====== /** * Assert that the entity is not null and not trimmed empty. * Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,117 @@ +package jp.sf.pal.timecard.db.allcommon.util; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleResourceUtil { + + //========================================================================== + // ========= + // Resource Path + // ============= + public static String getResourcePath(String path, String extension) { + if (extension == null) { + return path; + } + extension = "." + extension; + if (path.endsWith(extension)) { + return path; + } + return path.replace('.', '/') + extension; + } + + public static String getResourcePath(Class<?> clazz) { + return clazz.getName().replace('.', '/') + ".class"; + } + + //========================================================================== + // ========= + // Resource URL + // ============ + public static URL getResourceUrl(String path) { + return getResourceUrl(path, null); + } + + public static URL getResourceUrl(String path, String extension) { + return getResourceUrl(path, extension, Thread.currentThread() + .getContextClassLoader()); + } + + public static URL getResourceUrl(String path, String extension, + ClassLoader loader) { + if (path == null || loader == null) { + return null; + } + path = getResourcePath(path, extension); + return loader.getResource(path); + } + + //========================================================================== + // ========= + // Resource Stream + // =============== + public static InputStream getResourceStream(String path) { + return getResourceStream(path, null); + } + + public static InputStream getResourceStream(String path, String extension) { + final URL url = getResourceUrl(path, extension); + return url != null ? openStream(url) : null; + } + + //========================================================================== + // ========= + // Resource Existence + // ================== + public static boolean isExist(String path) { + return getResourceUrl(path) != null; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected static ClassLoader getClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + protected static InputStream openStream(URL url) { + try { + URLConnection connection = url.openConnection(); + connection.setUseCaches(false); + return connection.getInputStream(); + } catch (IOException e) { + String msg = "Failed to open the stream: url=" + url; + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,14 +1,20 @@ package jp.sf.pal.timecard.db.allcommon.util; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + /** * @author DBFlute(AutoGenerator) */ public class SimpleStringUtil { + protected static final String[] EMPTY_STRINGS = new String[0]; + //========================================================================== // ========= - // String - // ====== + // Replace + // ======= public static String replace(String text, String fromText, String toText) { if (text == null || fromText == null || toText == null) { return null; @@ -32,6 +38,26 @@ } while (true); } + //========================================================================== + // ========= + // Split + // ===== + public static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List<String> list = new ArrayList<String>(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Initial Convert + // =============== public static String initCap(String str) { assertObjectNotNull("str", str); return str.substring(0, 1).toUpperCase() + str.substring(1); @@ -42,9 +68,10 @@ return str.substring(0, 1).toLowerCase() + str.substring(1); } - // ----------------------------------------------------- - // Assert Object - // ------------- + //========================================================================== + // ========= + // Assert Helper + // ============= /** * Assert that the object is not null. * Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -0,0 +1,692 @@ +package jp.sf.pal.timecard.db.allcommon.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.DateFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.concurrent.ConcurrentHashMap; + +/** + * {Refers to S2Container's utility and Extends it} + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleTypeUtil { + + //========================================================================== + // ========= + // Convert To + // ========== + // ----------------------------------------------------- + // Boolean + // ------- + public static Boolean toBoolean(Object o) { + if (o == null) { + return null; + } else if (o instanceof Boolean) { + return (Boolean) o; + } else if (o instanceof Number) { + int num = ((Number) o).intValue(); + return Boolean.valueOf(num != 0); + } else if (o instanceof String) { + String s = (String) o; + if ("true".equalsIgnoreCase(s)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(s)) { + return Boolean.FALSE; + } else if (s.equals("0")) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } else { + return Boolean.TRUE; + } + } + + // ----------------------------------------------------- + // Integer + // ------- + public static Integer toInteger(Object o) { + return toInteger(o, null); + } + + public static Integer toInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Integer) { + return (Integer) o; + } else if (o instanceof Number) { + return new Integer(((Number) o).intValue()); + } else if (o instanceof String) { + return toInteger((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Integer(new SimpleDateFormat(pattern).format(o)); + } + return new Integer((int) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Integer(1) : new Integer( + 0); + } else { + return toInteger(o.toString()); + } + } + + protected static Integer toInteger(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Integer(normalize(s)); + } + + public static int toPrimitiveInt(Object o) { + return toPrimitiveInt(o, null); + } + + public static int toPrimitiveInt(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).intValue(); + } else if (o instanceof String) { + return toPrimitiveInt((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Integer + .parseInt(new SimpleDateFormat(pattern).format(o)); + } + return (int) ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveInt(o.toString()); + } + } + + protected static int toPrimitiveInt(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Integer.parseInt(normalize(s)); + } + + // ----------------------------------------------------- + // BigDecimal + // ---------- + public static BigDecimal toBigDecimal(Object o) { + return toBigDecimal(o, null); + } + + public static BigDecimal toBigDecimal(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigDecimal) { + return (BigDecimal) o; + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new BigDecimal(new SimpleDateFormat(pattern).format(o)); + } + return new BigDecimal(Long.toString(((java.util.Date) o).getTime())); + } else if (o instanceof String) { + String s = (String) o; + if (s == null || s.trim().length() == 0) { + return null; + } + return new BigDecimal(new BigDecimal(s).toPlainString()); + } else { + return new BigDecimal(new BigDecimal(o.toString()).toPlainString()); + } + } + + // ----------------------------------------------------- + // Double + // ------ + public static Double toDouble(Object o) { + return toDouble(o, null); + } + + public static Double toDouble(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Double) { + return (Double) o; + } else if (o instanceof Number) { + return new Double(((Number) o).doubleValue()); + } else if (o instanceof String) { + return toDouble((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Double(new SimpleDateFormat(pattern).format(o)); + } + return new Double(((java.util.Date) o).getTime()); + } else { + return toDouble(o.toString()); + } + } + + protected static Double toDouble(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Double(normalize(s)); + } + + // ----------------------------------------------------- + // Long + // ---- + public static Long toLong(Object o) { + return toLong(o, null); + } + + public static Long toLong(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Long) { + return (Long) o; + } else if (o instanceof Number) { + return new Long(((Number) o).longValue()); + } else if (o instanceof String) { + return toLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Long(new SimpleDateFormat(pattern).format(o)); + } + return new Long(((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Long(1) : new Long(0); + } else { + return toLong(o.toString()); + } + } + + protected static Long toLong(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Long(normalize(s)); + } + + public static long toPrimitiveLong(Object o) { + return toPrimitiveLong(o, null); + } + + public static long toPrimitiveLong(Object o, String pattern) { + if (o == null) { + return 0; + } else if (o instanceof Number) { + return ((Number) o).longValue(); + } else if (o instanceof String) { + return toPrimitiveLong((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return Long.parseLong(new SimpleDateFormat(pattern).format(o)); + } + return ((java.util.Date) o).getTime(); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? 1 : 0; + } else { + return toPrimitiveLong(o.toString()); + } + } + + protected static long toPrimitiveLong(String s) { + if (s == null || s.trim().length() == 0) { + return 0; + } + return Long.parseLong(normalize(s)); + } + + // ----------------------------------------------------- + // Float + // ----- + public static Float toFloat(Object o) { + return toFloat(o, null); + } + + public static Float toFloat(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Float) { + return (Float) o; + } else if (o instanceof Number) { + return new Float(((Number) o).floatValue()); + } else if (o instanceof String) { + return toFloat((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Float(new SimpleDateFormat(pattern).format(o)); + } + return new Float(((java.util.Date) o).getTime()); + } else { + return toFloat(o.toString()); + } + } + + protected static Float toFloat(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Float(normalize(s)); + } + + // ----------------------------------------------------- + // Short + // ----- + public static Short toShort(Object o) { + return toShort(o, null); + } + + public static Short toShort(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Short) { + return (Short) o; + } else if (o instanceof Number) { + return new Short(((Number) o).shortValue()); + } else if (o instanceof String) { + return toShort((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Short(new SimpleDateFormat(pattern).format(o)); + } + return new Short((short) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Short((short) 1) + : new Short((short) 0); + } else { + return toShort(o.toString()); + } + } + + protected static Short toShort(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Short(normalize(s)); + } + + // ----------------------------------------------------- + // BigInteger + // ---------- + public static BigInteger toBigInteger(Object o) { + return toBigInteger(o, null); + } + + public static BigInteger toBigInteger(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof BigInteger) { + return (BigInteger) o; + } else { + Long l = toLong(o, pattern); + if (l == null) { + return null; + } + return BigInteger.valueOf(l.longValue()); + } + } + + // ----------------------------------------------------- + // Byte + // ---- + public static Byte toByte(Object o) { + return toByte(o, null); + } + + public static Byte toByte(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof Byte) { + return (Byte) o; + } else if (o instanceof Number) { + return new Byte(((Number) o).byteValue()); + } else if (o instanceof String) { + return toByte((String) o); + } else if (o instanceof java.util.Date) { + if (pattern != null) { + return new Byte(new SimpleDateFormat(pattern).format(o)); + } + return new Byte((byte) ((java.util.Date) o).getTime()); + } else if (o instanceof Boolean) { + return ((Boolean) o).booleanValue() ? new Byte((byte) 1) + : new Byte((byte) 0); + } else { + return toByte(o.toString()); + } + } + + protected static Byte toByte(String s) { + if (s == null || s.trim().length() == 0) { + return null; + } + return new Byte(normalize(s)); + } + + // ----------------------------------------------------- + // Date + // ---- + public static Date toDate(Object o) { + return toDate(o, null); + } + + public static Date toDate(Object o, String pattern) { + if (o == null) { + return null; + } else if (o instanceof String) { + return toDate((String) o, pattern); + } else if (o instanceof Date) { + return (Date) o; + } else if (o instanceof Calendar) { + return ((Calendar) o).getTime(); + } else { + return toDate(o.toString(), pattern); + } + } + + protected static Date toDate(String s, String pattern) { + return toDate(s, pattern, Locale.getDefault()); + } + + protected static Date toDate(String s, String pattern, Locale locale) { + if (s == null || s.trim().length() == 0) { + return null; + } + SimpleDateFormat sdf = getDateFormat(s, pattern, locale); + try { + return sdf.parse(s); + } catch (ParseException e) { + String msg = "Failed to parse the string to date: "; + msg = msg + " string=" + s + " format=" + sdf + " locale=" + locale; + throw new IllegalStateException(msg, e); + } + } + + public static java.sql.Date toSqlDate(Object o) { + return toSqlDate(o, null); + } + + public static java.sql.Date toSqlDate(Object o, String pattern) { + if (o instanceof java.sql.Date) { + return (java.sql.Date) o; + } + java.util.Date date = toDate(o, pattern); + if (date != null) { + return new java.sql.Date(date.getTime()); + } + return null; + } + + // ----------------------------------------------------- + // Number + // ------ + public static Object toNumber(Class<?> type, Object o) { + if (type == Integer.class) { + return toInteger(o); + } else if (type == BigDecimal.class) { + return toBigDecimal(o); + } else if (type == Double.class) { + return toDouble(o); + } else if (type == Long.class) { + return toLong(o); + } else if (type == Float.class) { + return toFloat(o); + } else if (type == Short.class) { + return toShort(o); + } else if (type == BigInteger.class) { + return toBigInteger(o); + } else if (type == Byte.class) { + return toByte(o); + } + return o; + } + + // ----------------------------------------------------- + // Wrapper + // ------- + public static Object toWrapper(Class<?> type, Object o) { + if (type == int.class) { + Integer i = toInteger(o); + if (i != null) { + return i; + } + return new Integer(0); + } else if (type == double.class) { + Double d = toDouble(o); + if (d != null) { + return d; + } + return new Double(0); + } else if (type == long.class) { + Long l = toLong(o); + if (l != null) { + return l; + } + return new Long(0); + } else if (type == float.class) { + Float f = toFloat(o); + if (f != null) { + return f; + } + return new Float(0); + } else if (type == short.class) { + Short s = toShort(o); + if (s != null) { + return s; + } + return new Short((short) 0); + } else if (type == boolean.class) { + Boolean b = toBoolean(o); + if (b != null) { + return b; + } + return Boolean.FALSE; + } else if (type == byte.class) { + Byte b = toByte(o); + if (b != null) { + return b; + } + return new Byte((byte) 0); + } + return o; + } + + //========================================================================== + // ========= + // Normalize + // ========= + protected static String normalize(String s) { + return normalize(s, Locale.getDefault()); + } + + protected static String normalize(String s, Locale locale) { + if (s == null) { + return null; + } + DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); + char decimalSep = symbols.getDecimalSeparator(); + char groupingSep = symbols.getGroupingSeparator(); + StringBuilder sb = new StringBuilder(20); + for (int i = 0; i < s.length(); ++i) { + char c = s.charAt(i); + if (c == groupingSep) { + continue; + } else if (c == decimalSep) { + c = '.'; + } + sb.append(c); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + + // ----------------------------------------------------- + // DateFormat + // ---------- + protected static SimpleDateFormat getDateFormat(String s, String pattern, + Locale locale) { + if (pattern != null) { + return new SimpleDateFormat(pattern); + } + return getDateFormat(s, locale); + } + + protected static SimpleDateFormat getDateFormat(String s, Locale locale) { + String pattern = getDateFormatPattern(locale); + String shortPattern = removeDateDelimiter(pattern); + String delimitor = findDateDelimiter(s); + if (delimitor == null) { + if (s.length() == shortPattern.length()) { + return new SimpleDateFormat(shortPattern); + } + if (s.length() == shortPattern.length() + 2) { + return new SimpleDateFormat(replace(shortPattern, "yy", "yyyy")); + } + } else { + String[] array = split(s, delimitor); + for (int i = 0; i < array.length; ++i) { + if (array[i].length() == 4) { + pattern = replace(pattern, "yy", "yyyy"); + break; + } + } + return new SimpleDateFormat(pattern); + } + return new SimpleDateFormat(); + } + + protected static String getDateFormatPattern(Locale locale) { + SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance( + DateFormat.SHORT, locale); + String pattern = df.toPattern(); + int index = pattern.indexOf(' '); + if (index > 0) { + pattern = pattern.substring(0, index); + } + if (pattern.indexOf("MM") < 0) { + pattern = replace(pattern, "M", "MM"); + } + if (pattern.indexOf("dd") < 0) { + pattern = replace(pattern, "d", "dd"); + } + return pattern; + } + + protected static String removeDateDelimiter(String pattern) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pattern.length(); ++i) { + char c = pattern.charAt(i); + if (c == 'y' || c == 'M' || c == 'd') { + sb.append(c); + } + } + return sb.toString(); + } + + protected static String findDateDelimiter(String value) { + for (int i = 0; i < value.length(); ++i) { + char c = value.charAt(i); + if (Character.isDigit(c)) { + continue; + } + return Character.toString(c); + } + return null; + } + + // ----------------------------------------------------- + // DecimalFormatSymbols + // -------------------- + protected static Map<Locale, DecimalFormatSymbols> symbolsCache = new ConcurrentHashMap<Locale, DecimalFormatSymbols>(); + + protected static DecimalFormatSymbols getDecimalFormatSymbols() { + return getDecimalFormatSymbols(Locale.getDefault()); + } + + protected static DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) { + DecimalFormatSymbols symbols = (DecimalFormatSymbols) symbolsCache + .get(locale); + if (symbols == null) { + symbols = new DecimalFormatSymbols(locale); + symbolsCache.put(locale, symbols); + } + return symbols; + } + + // ----------------------------------------------------- + // String + // ------ + protected static String replace(String text, String fromText, String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + StringBuilder sb = new StringBuilder(); + int pos = 0; + int pos2 = 0; + do { + pos = text.indexOf(fromText, pos2); + if (pos == 0) { + sb.append(toText); + pos2 = fromText.length(); + } else if (pos > 0) { + sb.append(text.substring(pos2, pos)); + sb.append(toText); + pos2 = pos + fromText.length(); + } else { + sb.append(text.substring(pos2)); + return sb.toString(); + } + } while (true); + } + + protected static final String[] EMPTY_STRINGS = new String[0]; + + protected static String[] split(final String str, final String delimiter) { + if (str == null || str.trim().length() == 0) { + return EMPTY_STRINGS; + } + final List<String> list = new ArrayList<String>(); + final StringTokenizer st = new StringTokenizer(str, delimiter); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected static void assertObjectNotNull(String variableName, Object value) { + if (variableName == null) { + String msg = "The value should not be null: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The value should not be null: variableName=" + + variableName; + throw new IllegalArgumentException(msg); + } + } +} Property changes on: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsDailyReportBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.DailyReportDbm; import jp.sf.pal.timecard.db.cbean.DailyReportCB; -import jp.sf.pal.timecard.db.exdao.DailyReportDao; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.MonthlyReport; /** - * The behavior of DAILY_REPORT. + * The behavior of DAILY_REPORT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -66,12 +64,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected DailyReportDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -83,39 +75,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return DailyReportDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public DailyReportDbm getMyDBMeta() { return DailyReportDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public DailyReportDao getMyDao() { - return _dao; - } - - public void setMyDao(DailyReportDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -145,7 +116,7 @@ * @return The selected count. */ public int selectCount(DailyReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -222,7 +193,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<DailyReport> selectList(DailyReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<DailyReport>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -238,7 +209,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<DailyReport> selectPage(final DailyReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<DailyReport> invoker = new PagingInvoker<DailyReport>( getTableDbName()); final PagingHandler<DailyReport> handler = new PagingHandler<DailyReport>() { @@ -259,6 +230,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * dailyReportBhv.scalarSelect(Date.class).max(new ScalarQuery(DailyReportCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<DailyReportCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + DailyReportCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<DailyReportCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,8 +265,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - DailyReportCB cb, ValueLabelSetupper<DailyReport> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(DailyReportCB cb, + ValueLabelSetupper<DailyReport> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'MonthlyReport'. * @@ -600,11 +597,11 @@ */ public int queryUpdate(DailyReport dailyReport, DailyReportCB cb) { assertObjectNotNull("dailyReport", dailyReport); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(dailyReport); filterEntityOfUpdate(dailyReport); assertEntityOfUpdate(dailyReport); - return getMyDao().updateByQuery(cb, dailyReport); + return invoke(createQueryUpdateEntityCBCommand(dailyReport, cb)); } /** @@ -614,8 +611,8 @@ * @return The deleted count. */ public int queryDelete(DailyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -627,19 +624,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(DailyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((DailyReportCB) cb); + } + protected List<DailyReport> delegateSelectList(DailyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, DailyReport.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((DailyReportCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -647,62 +652,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(DailyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(DailyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(DailyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(DailyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<DailyReport> ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<DailyReport> ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<DailyReport> ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<DailyReport> ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<DailyReport> ls) { - assertObjectNotNull("dailyReportList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsEmployeeBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; import jp.sf.pal.timecard.db.exbhv.MonthlyReportBhv; -import jp.sf.pal.timecard.db.exdao.EmployeeDao; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of EMPLOYEE. + * The behavior of EMPLOYEE that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -71,12 +69,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected EmployeeDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -88,39 +80,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return EmployeeDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public EmployeeDbm getMyDBMeta() { return EmployeeDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public EmployeeDao getMyDao() { - return _dao; - } - - public void setMyDao(EmployeeDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -150,7 +121,7 @@ * @return The selected count. */ public int selectCount(EmployeeCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -227,7 +198,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<Employee> selectList(EmployeeCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<Employee>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -243,7 +214,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<Employee> selectPage(final EmployeeCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Employee> invoker = new PagingInvoker<Employee>( getTableDbName()); final PagingHandler<Employee> handler = new PagingHandler<Employee>() { @@ -264,6 +235,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * employeeBhv.scalarSelect(Date.class).max(new ScalarQuery(EmployeeCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<EmployeeCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + EmployeeCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<EmployeeCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -273,8 +270,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - EmployeeCB cb, ValueLabelSetupper<Employee> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(EmployeeCB cb, + ValueLabelSetupper<Employee> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -377,8 +374,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -703,11 +700,11 @@ */ public int queryUpdate(Employee employee, EmployeeCB cb) { assertObjectNotNull("employee", employee); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(employee); filterEntityOfUpdate(employee); assertEntityOfUpdate(employee); - return getMyDao().updateByQuery(cb, employee); + return invoke(createQueryUpdateEntityCBCommand(employee, cb)); } /** @@ -717,8 +714,8 @@ * @return The deleted count. */ public int queryDelete(EmployeeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -730,19 +727,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(EmployeeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((EmployeeCB) cb); + } + protected List<Employee> delegateSelectList(EmployeeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Employee.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((EmployeeCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -750,62 +755,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(Employee e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(Employee e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Employee e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(Employee e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<Employee> ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<Employee> ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<Employee> ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<Employee> ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<Employee> ls) { - assertObjectNotNull("employeeList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.exbhv.GroupMappingBhv; import jp.sf.pal.timecard.db.exbhv.UserInfoBhv; -import jp.sf.pal.timecard.db.exdao.GroupInfoDao; import jp.sf.pal.timecard.db.exentity.GroupInfo; import jp.sf.pal.timecard.db.exentity.GroupMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of GROUP_INFO. + * The behavior of GROUP_INFO that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -73,12 +71,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected GroupInfoDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -90,39 +82,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return GroupInfoDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public GroupInfoDbm getMyDBMeta() { return GroupInfoDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public GroupInfoDao getMyDao() { - return _dao; - } - - public void setMyDao(GroupInfoDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -152,7 +123,7 @@ * @return The selected count. */ public int selectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -229,7 +200,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<GroupInfo> selectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<GroupInfo>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -245,7 +216,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<GroupInfo> selectPage(final GroupInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<GroupInfo> invoker = new PagingInvoker<GroupInfo>( getTableDbName()); final PagingHandler<GroupInfo> handler = new PagingHandler<GroupInfo>() { @@ -266,6 +237,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * groupInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupInfoCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<GroupInfoCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + GroupInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<GroupInfoCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - GroupInfoCB cb, ValueLabelSetupper<GroupInfo> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(GroupInfoCB cb, + ValueLabelSetupper<GroupInfo> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { assertObjectNotNull("groupInfo", groupInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupInfo); filterEntityOfUpdate(groupInfo); assertEntityOfUpdate(groupInfo); - return getMyDao().updateByQuery(cb, groupInfo); + return invoke(createQueryUpdateEntityCBCommand(groupInfo, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -793,19 +790,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupInfoCB) cb); + } + protected List<GroupInfo> delegateSelectList(GroupInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupInfo.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -813,62 +818,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(GroupInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(GroupInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<GroupInfo> ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<GroupInfo> ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<GroupInfo> ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<GroupInfo> ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<GroupInfo> ls) { - assertObjectNotNull("groupInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.timecard.db.cbean.GroupMappingCB; -import jp.sf.pal.timecard.db.exdao.GroupMappingDao; import jp.sf.pal.timecard.db.exentity.GroupInfo; import jp.sf.pal.timecard.db.exentity.GroupMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of GROUP_MAPPING. + * The behavior of GROUP_MAPPING that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -67,12 +65,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected GroupMappingDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -84,39 +76,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return GroupMappingDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public GroupMappingDbm getMyDBMeta() { return GroupMappingDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public GroupMappingDao getMyDao() { - return _dao; - } - - public void setMyDao(GroupMappingDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -146,7 +117,7 @@ * @return The selected count. */ public int selectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -226,7 +197,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<GroupMapping> selectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<GroupMapping>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -242,7 +213,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<GroupMapping> selectPage(final GroupMappingCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<GroupMapping> invoker = new PagingInvoker<GroupMapping>( getTableDbName()); final PagingHandler<GroupMapping> handler = new PagingHandler<GroupMapping>() { @@ -263,6 +234,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * groupMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(GroupMappingCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<GroupMappingCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + GroupMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<GroupMappingCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - GroupMappingCB cb, + public List<Map<String, Object>> selectValueLabelList(GroupMappingCB cb, ValueLabelSetupper<GroupMapping> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -285,8 +281,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -499,11 +495,11 @@ */ public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { assertObjectNotNull("groupMapping", groupMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(groupMapping); filterEntityOfUpdate(groupMapping); assertEntityOfUpdate(groupMapping); - return getMyDao().updateByQuery(cb, groupMapping); + return invoke(createQueryUpdateEntityCBCommand(groupMapping, cb)); } /** @@ -513,8 +509,8 @@ * @return The deleted count. */ public int queryDelete(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -526,19 +522,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((GroupMappingCB) cb); + } + protected List<GroupMapping> delegateSelectList(GroupMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, GroupMapping.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((GroupMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -546,38 +550,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(GroupMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(GroupMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List<GroupMapping> ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<GroupMapping> ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List<GroupMapping> ls) { - assertObjectNotNull("groupMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyReportBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,14 +21,13 @@ import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.exbhv.DailyReportBhv; import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; -import jp.sf.pal.timecard.db.exdao.MonthlyReportDao; import jp.sf.pal.timecard.db.exentity.DailyReport; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; /** - * The behavior of MONTHLY_REPORT. + * The behavior of MONTHLY_REPORT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -74,12 +72,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected MonthlyReportDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -91,39 +83,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return MonthlyReportDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public MonthlyReportDbm getMyDBMeta() { return MonthlyReportDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public MonthlyReportDao getMyDao() { - return _dao; - } - - public void setMyDao(MonthlyReportDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -153,7 +124,7 @@ * @return The selected count. */ public int selectCount(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -233,7 +204,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<MonthlyReport> selectList(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<MonthlyReport>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -249,7 +220,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<MonthlyReport> selectPage(final MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<MonthlyReport> invoker = new PagingInvoker<MonthlyReport>( getTableDbName()); final PagingHandler<MonthlyReport> handler = new PagingHandler<MonthlyReport>() { @@ -270,6 +241,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * monthlyReportBhv.scalarSelect(Date.class).max(new ScalarQuery(MonthlyReportCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<MonthlyReportCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + MonthlyReportCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<MonthlyReportCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -279,8 +276,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - MonthlyReportCB cb, + public List<Map<String, Object>> selectValueLabelList(MonthlyReportCB cb, ValueLabelSetupper<MonthlyReport> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -483,8 +479,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Employee'. * @@ -802,11 +798,11 @@ */ public int queryUpdate(MonthlyReport monthlyReport, MonthlyReportCB cb) { assertObjectNotNull("monthlyReport", monthlyReport); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(monthlyReport); filterEntityOfUpdate(monthlyReport); assertEntityOfUpdate(monthlyReport); - return getMyDao().updateByQuery(cb, monthlyReport); + return invoke(createQueryUpdateEntityCBCommand(monthlyReport, cb)); } /** @@ -816,8 +812,8 @@ * @return The deleted count. */ public int queryDelete(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -829,19 +825,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MonthlyReportCB) cb); + } + protected List<MonthlyReport> delegateSelectList(MonthlyReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MonthlyReport.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MonthlyReportCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -849,62 +853,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(MonthlyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(MonthlyReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(MonthlyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(MonthlyReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<MonthlyReport> ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<MonthlyReport> ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<MonthlyReport> ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<MonthlyReport> ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<MonthlyReport> ls) { - assertObjectNotNull("monthlyReportList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsMonthlyWorkingReportBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.MonthlyWorkingReportDbm; import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; -import jp.sf.pal.timecard.db.exdao.MonthlyWorkingReportDao; import jp.sf.pal.timecard.db.exentity.MonthlyReport; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; import jp.sf.pal.timecard.db.exentity.WorkingType; /** - * The behavior of MONTHLY_WORKING_REPORT. + * The behavior of MONTHLY_WORKING_REPORT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -67,12 +65,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected MonthlyWorkingReportDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -84,39 +76,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return MonthlyWorkingReportDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public MonthlyWorkingReportDbm getMyDBMeta() { return MonthlyWorkingReportDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public MonthlyWorkingReportDao getMyDao() { - return _dao; - } - - public void setMyDao(MonthlyWorkingReportDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -146,7 +117,7 @@ * @return The selected count. */ public int selectCount(MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -228,7 +199,7 @@ */ public ListResultBean<MonthlyWorkingReport> selectList( MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<MonthlyWorkingReport>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -245,7 +216,7 @@ */ public PagingResultBean<MonthlyWorkingReport> selectPage( final MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<MonthlyWorkingReport> invoker = new PagingInvoker<MonthlyWorkingReport>( getTableDbName()); final PagingHandler<MonthlyWorkingReport> handler = new PagingHandler<MonthlyWorkingReport>() { @@ -266,6 +237,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * monthlyWorkingReportBhv.scalarSelect(Date.class).max(new ScalarQuery(MonthlyWorkingReportCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<MonthlyWorkingReportCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + MonthlyWorkingReportCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<MonthlyWorkingReportCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,7 +272,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( + public List<Map<String, Object>> selectValueLabelList( MonthlyWorkingReportCB cb, ValueLabelSetupper<MonthlyWorkingReport> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -288,8 +285,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'MonthlyReport'. * @@ -516,11 +513,11 @@ public int queryUpdate(MonthlyWorkingReport monthlyWorkingReport, MonthlyWorkingReportCB cb) { assertObjectNotNull("monthlyWorkingReport", monthlyWorkingReport); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(monthlyWorkingReport); filterEntityOfUpdate(monthlyWorkingReport); assertEntityOfUpdate(monthlyWorkingReport); - return getMyDao().updateByQuery(cb, monthlyWorkingReport); + return invoke(createQueryUpdateEntityCBCommand(monthlyWorkingReport, cb)); } /** @@ -530,8 +527,8 @@ * @return The deleted count. */ public int queryDelete(MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -543,20 +540,28 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MonthlyWorkingReportCB) cb); + } + protected List<MonthlyWorkingReport> delegateSelectList( MonthlyWorkingReportCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MonthlyWorkingReport.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MonthlyWorkingReportCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -564,38 +569,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(MonthlyWorkingReport e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(MonthlyWorkingReport e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List<MonthlyWorkingReport> ls) { - assertObjectNotNull("monthlyWorkingReportList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<MonthlyWorkingReport> ls) { - assertObjectNotNull("monthlyWorkingReportList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List<MonthlyWorkingReport> ls) { - assertObjectNotNull("monthlyWorkingReportList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.exbhv.RoleMappingBhv; import jp.sf.pal.timecard.db.exbhv.UserInfoBhv; -import jp.sf.pal.timecard.db.exdao.RoleInfoDao; import jp.sf.pal.timecard.db.exentity.RoleInfo; import jp.sf.pal.timecard.db.exentity.RoleMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of ROLE_INFO. + * The behavior of ROLE_INFO that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -73,12 +71,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected RoleInfoDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -90,39 +82,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return RoleInfoDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public RoleInfoDbm getMyDBMeta() { return RoleInfoDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public RoleInfoDao getMyDao() { - return _dao; - } - - public void setMyDao(RoleInfoDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -152,7 +123,7 @@ * @return The selected count. */ public int selectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -229,7 +200,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<RoleInfo> selectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<RoleInfo>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -245,7 +216,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<RoleInfo> selectPage(final RoleInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<RoleInfo> invoker = new PagingInvoker<RoleInfo>( getTableDbName()); final PagingHandler<RoleInfo> handler = new PagingHandler<RoleInfo>() { @@ -266,6 +237,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * roleInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleInfoCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<RoleInfoCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + RoleInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<RoleInfoCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -275,8 +272,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - RoleInfoCB cb, ValueLabelSetupper<RoleInfo> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(RoleInfoCB cb, + ValueLabelSetupper<RoleInfo> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -467,8 +464,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -764,11 +761,11 @@ */ public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { assertObjectNotNull("roleInfo", roleInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleInfo); filterEntityOfUpdate(roleInfo); assertEntityOfUpdate(roleInfo); - return getMyDao().updateByQuery(cb, roleInfo); + return invoke(createQueryUpdateEntityCBCommand(roleInfo, cb)); } /** @@ -778,8 +775,8 @@ * @return The deleted count. */ public int queryDelete(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -791,19 +788,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleInfoCB) cb); + } + protected List<RoleInfo> delegateSelectList(RoleInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleInfo.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -811,62 +816,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(RoleInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(RoleInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<RoleInfo> ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<RoleInfo> ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<RoleInfo> ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<RoleInfo> ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<RoleInfo> ls) { - assertObjectNotNull("roleInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.timecard.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.timecard.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.timecard.db.cbean.RoleMappingCB; -import jp.sf.pal.timecard.db.exdao.RoleMappingDao; import jp.sf.pal.timecard.db.exentity.RoleInfo; import jp.sf.pal.timecard.db.exentity.RoleMapping; import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of ROLE_MAPPING. + * The behavior of ROLE_MAPPING that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -67,12 +65,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected RoleMappingDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -84,39 +76,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return RoleMappingDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public RoleMappingDbm getMyDBMeta() { return RoleMappingDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public RoleMappingDao getMyDao() { - return _dao; - } - - public void setMyDao(RoleMappingDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -146,7 +117,7 @@ * @return The selected count. */ public int selectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -223,7 +194,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<RoleMapping> selectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<RoleMapping>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -239,7 +210,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<RoleMapping> selectPage(final RoleMappingCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<RoleMapping> invoker = new PagingInvoker<RoleMapping>( getTableDbName()); final PagingHandler<RoleMapping> handler = new PagingHandler<RoleMapping>() { @@ -260,6 +231,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * roleMappingBhv.scalarSelect(Date.class).max(new ScalarQuery(RoleMappingCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<RoleMappingCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + RoleMappingCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<RoleMappingCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -269,8 +266,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - RoleMappingCB cb, ValueLabelSetupper<RoleMapping> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(RoleMappingCB cb, + ValueLabelSetupper<RoleMapping> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -281,8 +278,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'RoleInfo'. * @@ -494,11 +491,11 @@ */ public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { assertObjectNotNull("roleMapping", roleMapping); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(roleMapping); filterEntityOfUpdate(roleMapping); assertEntityOfUpdate(roleMapping); - return getMyDao().updateByQuery(cb, roleMapping); + return invoke(createQueryUpdateEntityCBCommand(roleMapping, cb)); } /** @@ -508,8 +505,8 @@ * @return The deleted count. */ public int queryDelete(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -521,19 +518,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((RoleMappingCB) cb); + } + protected List<RoleMapping> delegateSelectList(RoleMappingCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, RoleMapping.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((RoleMappingCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -541,38 +546,71 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(RoleMapping e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateDelete(RoleMapping e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int[] delegateInsertList(List<RoleMapping> ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<RoleMapping> ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateDeleteList(List<RoleMapping> ls) { - assertObjectNotNull("roleMappingList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + //========================================================================== // ========= // Optimistic Lock Info Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -24,7 +23,6 @@ import jp.sf.pal.timecard.db.exbhv.EmployeeBhv; import jp.sf.pal.timecard.db.exbhv.GroupMappingBhv; import jp.sf.pal.timecard.db.exbhv.RoleMappingBhv; -import jp.sf.pal.timecard.db.exdao.UserInfoDao; import jp.sf.pal.timecard.db.exentity.Employee; import jp.sf.pal.timecard.db.exentity.GroupInfo; import jp.sf.pal.timecard.db.exentity.GroupMapping; @@ -33,14 +31,14 @@ import jp.sf.pal.timecard.db.exentity.UserInfo; /** - * The behavior of USER_INFO. + * The behavior of USER_INFO that the type is TABLE. <br /> * * <pre> * [primary-key] * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -78,12 +76,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected UserInfoDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -95,39 +87,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return UserInfoDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public UserInfoDbm getMyDBMeta() { return UserInfoDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public UserInfoDao getMyDao() { - return _dao; - } - - public void setMyDao(UserInfoDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -157,7 +128,7 @@ * @return The selected count. */ public int selectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -234,7 +205,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<UserInfo> selectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<UserInfo>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -250,7 +221,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<UserInfo> selectPage(final UserInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<UserInfo> invoker = new PagingInvoker<UserInfo>( getTableDbName()); final PagingHandler<UserInfo> handler = new PagingHandler<UserInfo>() { @@ -271,6 +242,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * userInfoBhv.scalarSelect(Date.class).max(new ScalarQuery(UserInfoCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<UserInfoCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + UserInfoCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<UserInfoCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -280,8 +277,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - UserInfoCB cb, ValueLabelSetupper<UserInfo> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(UserInfoCB cb, + ValueLabelSetupper<UserInfo> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -653,8 +650,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -979,11 +976,11 @@ */ public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { assertObjectNotNull("userInfo", userInfo); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(userInfo); filterEntityOfUpdate(userInfo); assertEntityOfUpdate(userInfo); - return getMyDao().updateByQuery(cb, userInfo); + return invoke(createQueryUpdateEntityCBCommand(userInfo, cb)); } /** @@ -993,8 +990,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1006,19 +1003,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((UserInfoCB) cb); + } + protected List<UserInfo> delegateSelectList(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, UserInfo.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((UserInfoCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -1026,62 +1031,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(UserInfo e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(UserInfo e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<UserInfo> ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<UserInfo> ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<UserInfo> ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<UserInfo> ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<UserInfo> ls) { - assertObjectNotNull("userInfoList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsbhv/BsWorkingTypeBhv.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -1,9 +1,8 @@ package jp.sf.pal.timecard.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.timecard.db.allcommon.DaoReadable; -import jp.sf.pal.timecard.db.allcommon.DaoWritable; import jp.sf.pal.timecard.db.allcommon.Entity; import jp.sf.pal.timecard.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.timecard.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,12 +19,11 @@ import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv; -import jp.sf.pal.timecard.db.exdao.WorkingTypeDao; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; import jp.sf.pal.timecard.db.exentity.WorkingType; /** - * The behavior of WORKING_TYPE. + * The behavior of WORKING_TYPE that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -70,12 +68,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected WorkingTypeDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -87,39 +79,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return WorkingTypeDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public WorkingTypeDbm getMyDBMeta() { return WorkingTypeDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public WorkingTypeDao getMyDao() { - return _dao; - } - - public void setMyDao(WorkingTypeDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -149,7 +120,7 @@ * @return The selected count. */ public int selectCount(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -226,7 +197,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<WorkingType> selectList(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<WorkingType>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -242,7 +213,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<WorkingType> selectPage(final WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<WorkingType> invoker = new PagingInvoker<WorkingType>( getTableDbName()); final PagingHandler<WorkingType> handler = new PagingHandler<WorkingType>() { @@ -263,6 +234,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * workingTypeBhv.scalarSelect(Date.class).max(new ScalarQuery(WorkingTypeCB cb) { + * cb.specify().columnXxxDatetime(); // the required specification of target column + * cb.query().setXxxName_PrefixSearch("S"); // query as you like it + * }); + * </pre> + * + * @param <RESULT> The type of result. + * @param resultType The type of result. (NotNull) + * @return The scalar value derived by a function. (Nullable) + */ + public <RESULT> SLFunction<WorkingTypeCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + WorkingTypeCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<WorkingTypeCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - WorkingTypeCB cb, ValueLabelSetupper<WorkingType> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(WorkingTypeCB cb, + ValueLabelSetupper<WorkingType> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -379,8 +376,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -683,11 +680,11 @@ */ public int queryUpdate(WorkingType workingType, WorkingTypeCB cb) { assertObjectNotNull("workingType", workingType); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(workingType); filterEntityOfUpdate(workingType); assertEntityOfUpdate(workingType); - return getMyDao().updateByQuery(cb, workingType); + return invoke(createQueryUpdateEntityCBCommand(workingType, cb)); } /** @@ -697,8 +694,8 @@ * @return The deleted count. */ public int queryDelete(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -710,19 +707,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((WorkingTypeCB) cb); + } + protected List<WorkingType> delegateSelectList(WorkingTypeCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, WorkingType.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((WorkingTypeCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -730,62 +735,97 @@ if (!processBeforeInsert(e)) { return 1; } - return getMyDao().insert(e); + return invoke(createInsertEntityCommand(e)); } + protected int doCallCreate(Entity entity) { + return delegateInsert(downcast(entity)); + } + protected int delegateUpdate(WorkingType e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateModifiedOnly(e); + return invoke(createUpdateEntityCommand(e)); } + protected int doCallModify(Entity entity) { + return delegateUpdate(downcast(entity)); + } + protected int delegateUpdateNonstrict(WorkingType e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(WorkingType e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().delete(e); + return invoke(createDeleteEntityCommand(e)); } + protected int doCallRemove(Entity entity) { + return delegateDelete(downcast(entity)); + } + protected int delegateDeleteNonstrict(WorkingType e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<WorkingType> ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchInsertEntityCommand(helpFilterBeforeInsertInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doCreateList(List<Entity> ls) { + return delegateInsertList((List) ls); + } + protected int[] delegateUpdateList(List<WorkingType> ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateEntityCommand(helpFilterBeforeUpdateInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doModifyList(List<Entity> ls) { + return delegateUpdateList((List) ls); + } + protected int[] delegateUpdateListNonstrict(List<WorkingType> ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<WorkingType> ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteEntityCommand(helpFilterBeforeDeleteInternally(ls))); } + @SuppressWarnings("unchecked") + protected int[] doRemoveList(List<Entity> ls) { + return delegateDeleteList((List) ls); + } + protected int[] delegateDeleteListNonstrict(List<WorkingType> ls) { - assertObjectNotNull("workingTypeList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsDailyReport.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsDailyReport implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsEmployee.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsEmployee implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsGroupMapping.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyReport.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -45,7 +45,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsMonthlyReport implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsMonthlyWorkingReport.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsMonthlyWorkingReport implements Entity, java.io.Serializable { Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsRoleMapping.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsUserInfo.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,7 @@ * USER_ID * * [column] - * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * USER_ID, GIVEN_NAME, FAMILY_NAME, MIDDLE_NAME, GIVEN_NAME_DESC, FAMILY_NAME_DESC, NICKNAME, GENDER, BIRTH_DATE, EMAIL, URL, TELEPHONE, LOCALE, ROLE_ID, GROUP_ID, STATUS, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO * * [sequence] * @@ -47,7 +47,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -115,6 +114,9 @@ /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ protected String _groupId; + /** STATUS: {VARCHAR(1)} */ + protected String _status; + /** CREATED_TIME: {NotNull : TIMESTAMP} */ protected java.sql.Timestamp _createdTime; @@ -462,6 +464,7 @@ sb.append(delimiter).append(getLocale()); sb.append(delimiter).append(getRoleId()); sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getStatus()); sb.append(delimiter).append(getCreatedTime()); sb.append(delimiter).append(getCreatedBy()); sb.append(delimiter).append(getUpdatedTime()); @@ -813,6 +816,28 @@ this._groupId = groupId; } + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String status_COLUMN = "STATUS"; + + /** + * STATUS: {VARCHAR(1)} <br /> + * + * @return The value of the column 'STATUS'. (Nullable) + */ + public String getStatus() { + return _status; + } + + /** + * STATUS: {VARCHAR(1)} <br /> + * + * @param status The value of the column 'STATUS'. (Nullable) + */ + public void setStatus(String status) { + _modifiedProperties.addPropertyName("status"); + this._status = status; + } + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ public static final String createdTime_COLUMN = "CREATED_TIME"; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/BsWorkingType.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsWorkingType implements Entity, java.io.Serializable { //========================================================================== Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/DailyReportDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.DailyReport; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class DailyReportDbm extends AbstractDBMeta { private static final DailyReportDbm _instance = new DailyReportDbm(); @@ -173,40 +173,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -371,7 +345,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<DailyReport>> _epsMap = newHashMap(); + protected Map<String, Eps<DailyReport>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsDate(), columnDate()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/EmployeeDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.Employee; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class EmployeeDbm extends AbstractDBMeta { private static final EmployeeDbm _instance = new EmployeeDbm(); @@ -125,40 +125,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -335,7 +309,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<Employee>> _epsMap = newHashMap(); + protected Map<String, Eps<Employee>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUsername(), columnUsername()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.GroupInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupInfoDbm extends AbstractDBMeta { private static final GroupInfoDbm _instance = new GroupInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<GroupInfo>> _epsMap = newHashMap(); + protected Map<String, Eps<GroupInfo>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsGroupId(), columnGroupId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.GroupMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupMappingDbm extends AbstractDBMeta { private static final GroupMappingDbm _instance = new GroupMappingDbm(); @@ -68,40 +68,14 @@ return _columnGroupId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<GroupMapping>> _epsMap = newHashMap(); + protected Map<String, Eps<GroupMapping>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyReportDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.MonthlyReport; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MonthlyReportDbm extends AbstractDBMeta { private static final MonthlyReportDbm _instance = new MonthlyReportDbm(); @@ -167,40 +167,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -376,7 +350,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<MonthlyReport>> _epsMap = newHashMap(); + protected Map<String, Eps<MonthlyReport>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsYear(), columnYear()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/MonthlyWorkingReportDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.MonthlyWorkingReport; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MonthlyWorkingReportDbm extends AbstractDBMeta { private static final MonthlyWorkingReportDbm _instance = new MonthlyWorkingReportDbm(); @@ -75,40 +75,14 @@ return _columnWorkingTypeId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -275,7 +249,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<MonthlyWorkingReport>> _epsMap = newHashMap(); + protected Map<String, Eps<MonthlyWorkingReport>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsValue(), columnValue()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.RoleInfo; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleInfoDbm extends AbstractDBMeta { private static final RoleInfoDbm _instance = new RoleInfoDbm(); @@ -138,40 +138,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -341,7 +315,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<RoleInfo>> _epsMap = newHashMap(); + protected Map<String, Eps<RoleInfo>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.RoleMapping; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleMappingDbm extends AbstractDBMeta { private static final RoleMappingDbm _instance = new RoleMappingDbm(); @@ -68,40 +68,14 @@ return _columnRoleId; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -263,7 +237,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<RoleMapping>> _epsMap = newHashMap(); + protected Map<String, Eps<RoleMapping>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsUserId(), columnUserId()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -9,6 +9,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.UserInfo; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoDbm extends AbstractDBMeta { private static final UserInfoDbm _instance = new UserInfoDbm(); @@ -93,6 +93,9 @@ protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", String.class, false, 255, 0); + protected ColumnInfo _columnStatus = cci("STATUS", "status", String.class, + false, 1, 0); + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", "createdTime", java.sql.Timestamp.class, false, null, null); @@ -174,6 +177,10 @@ return _columnGroupId; } + public ColumnInfo columnStatus() { + return _columnStatus; + } + public ColumnInfo columnCreatedTime() { return _columnCreatedTime; } @@ -202,40 +209,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -431,7 +412,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<UserInfo>> _epsMap = newHashMap(); + protected Map<String, Eps<UserInfo>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsUserId(), columnUserId()); setupEps(_epsMap, new EpsGivenName(), columnGivenName()); @@ -448,6 +430,7 @@ setupEps(_epsMap, new EpsLocale(), columnLocale()); setupEps(_epsMap, new EpsRoleId(), columnRoleId()); setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsStatus(), columnStatus()); setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); @@ -556,6 +539,12 @@ } } + public static class EpsStatus implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setStatus((String) v); + } + } + public static class EpsCreatedTime implements Eps<UserInfo> { public void setup(UserInfo e, Object v) { e.setCreatedTime((java.sql.Timestamp) v); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/bsentity/dbmeta/WorkingTypeDbm.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,6 +8,7 @@ import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.timecard.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.timecard.db.allcommon.helper.StringKeyMap; import jp.sf.pal.timecard.db.exentity.WorkingType; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class WorkingTypeDbm extends AbstractDBMeta { private static final WorkingTypeDbm _instance = new WorkingTypeDbm(); @@ -131,40 +131,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -328,7 +302,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<WorkingType>> _epsMap = newHashMap(); + protected Map<String, Eps<WorkingType>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsDailyReportCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsDailyReportCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,24 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<DailyReportCB> - * unionQuery). - */ - public void union(DailyReportCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<DailyReportCB> - * unionQuery). - */ - public void unionAll(DailyReportCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected MonthlyReportNss _nssMonthlyReport; public MonthlyReportNss getNssMonthlyReport() { @@ -203,7 +188,8 @@ public DailyReportCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -215,8 +201,10 @@ protected MonthlyReportCB.Specification _monthlyReport; public Specification(ConditionBean baseCB, - SpQyCall<DailyReportCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<DailyReportCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -306,7 +294,8 @@ public MonthlyReportCB.Specification specifyMonthlyReport() { assertForeign("monthlyReport"); if (_monthlyReport == null) { - _monthlyReport = new MonthlyReportCB.Specification(_baseCB, + _monthlyReport = new MonthlyReportCB.Specification( + _baseCB, new SpQyCall<MonthlyReportCQ>() { public boolean has() { return _myQyCall.has() @@ -318,7 +307,8 @@ public MonthlyReportCQ qy() { return _myQyCall.qy().queryMonthlyReport(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _monthlyReport; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsEmployeeCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsEmployeeCB extends AbstractConditionBean { //========================================================================== @@ -87,7 +86,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -137,23 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<EmployeeCB> unionQuery). - */ - public void union(EmployeeCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<EmployeeCB> - * unionQuery). - */ - public void unionAll(EmployeeCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfoByUsername; public UserInfoNss getNssUserInfoByUsername() { @@ -227,7 +213,8 @@ public EmployeeCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +227,10 @@ protected UserInfoCB.Specification _userInfoByManager; public Specification(ConditionBean baseCB, SpQyCall<EmployeeCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -306,7 +295,8 @@ public UserInfoCB.Specification specifyUserInfoByUsername() { assertForeign("userInfoByUsername"); if (_userInfoByUsername == null) { - _userInfoByUsername = new UserInfoCB.Specification(_baseCB, + _userInfoByUsername = new UserInfoCB.Specification( + _baseCB, new SpQyCall<UserInfoCQ>() { public boolean has() { return _myQyCall.has() @@ -318,7 +308,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfoByUsername(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUsername; } @@ -326,7 +317,8 @@ public UserInfoCB.Specification specifyUserInfoByManager() { assertForeign("userInfoByManager"); if (_userInfoByManager == null) { - _userInfoByManager = new UserInfoCB.Specification(_baseCB, + _userInfoByManager = new UserInfoCB.Specification( + _baseCB, new SpQyCall<UserInfoCQ>() { public boolean has() { return _myQyCall.has() @@ -338,7 +330,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfoByManager(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByManager; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsGroupInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<GroupInfoCB> unionQuery). - */ - public void union(GroupInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<GroupInfoCB> - * unionQuery). - */ - public void unionAll(GroupInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public GroupInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -190,8 +178,10 @@ protected SpQyCall<GroupInfoCQ> _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall<GroupInfoCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<GroupInfoCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsGroupMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<GroupMappingCB> - * unionQuery). - */ - public void union(GroupMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<GroupMappingCB> - * unionQuery). - */ - public void unionAll(GroupMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -226,7 +211,8 @@ public GroupMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall<GroupMappingCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<GroupMappingCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyReportCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMonthlyReportCB extends AbstractConditionBean { //========================================================================== @@ -88,7 +87,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -138,24 +142,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<MonthlyReportCB> - * unionQuery). - */ - public void union(MonthlyReportCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<MonthlyReportCB> - * unionQuery). - */ - public void unionAll(MonthlyReportCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -164,7 +150,6 @@ // ========= // Setup Select // ============ - protected EmployeeNss _nssEmployee; public EmployeeNss getNssEmployee() { @@ -204,7 +189,8 @@ public MonthlyReportCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -216,8 +202,10 @@ protected EmployeeCB.Specification _employee; public Specification(ConditionBean baseCB, - SpQyCall<MonthlyReportCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<MonthlyReportCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -314,7 +302,8 @@ public EmployeeCQ qy() { return _myQyCall.qy().queryEmployee(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _employee; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsMonthlyWorkingReportCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMonthlyWorkingReportCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<MonthlyWorkingReportCB> - * unionQuery). - */ - public void union(MonthlyWorkingReportCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<MonthlyWorkingReportCB> - * unionQuery). - */ - public void unionAll(MonthlyWorkingReportCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected MonthlyReportNss _nssMonthlyReport; public MonthlyReportNss getNssMonthlyReport() { @@ -227,7 +212,8 @@ public MonthlyWorkingReportCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ public Specification(ConditionBean baseCB, SpQyCall<MonthlyWorkingReportCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -280,7 +268,8 @@ public MonthlyReportCB.Specification specifyMonthlyReport() { assertForeign("monthlyReport"); if (_monthlyReport == null) { - _monthlyReport = new MonthlyReportCB.Specification(_baseCB, + _monthlyReport = new MonthlyReportCB.Specification( + _baseCB, new SpQyCall<MonthlyReportCQ>() { public boolean has() { return _myQyCall.has() @@ -292,7 +281,8 @@ public MonthlyReportCQ qy() { return _myQyCall.qy().queryMonthlyReport(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _monthlyReport; } @@ -300,7 +290,8 @@ public WorkingTypeCB.Specification specifyWorkingType() { assertForeign("workingType"); if (_workingType == null) { - _workingType = new WorkingTypeCB.Specification(_baseCB, + _workingType = new WorkingTypeCB.Specification( + _baseCB, new SpQyCall<WorkingTypeCQ>() { public boolean has() { return _myQyCall.has() @@ -311,7 +302,8 @@ public WorkingTypeCQ qy() { return _myQyCall.qy().queryWorkingType(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _workingType; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsRoleInfoCB extends AbstractConditionBean { //========================================================================== @@ -86,7 +85,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -136,23 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<RoleInfoCB> unionQuery). - */ - public void union(RoleInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<RoleInfoCB> - * unionQuery). - */ - public void unionAll(RoleInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -180,7 +167,8 @@ public RoleInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +177,10 @@ protected SpQyCall<RoleInfoCQ> _myQyCall; public Specification(ConditionBean baseCB, SpQyCall<RoleInfoCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsRoleMappingCB extends AbstractConditionBean { //========================================================================== @@ -89,7 +88,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -139,24 +143,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<RoleMappingCB> - * unionQuery). - */ - public void union(RoleMappingCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<RoleMappingCB> - * unionQuery). - */ - public void unionAll(RoleMappingCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected RoleInfoNss _nssRoleInfo; public RoleInfoNss getNssRoleInfo() { @@ -226,7 +211,8 @@ public RoleMappingCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,10 @@ protected UserInfoCB.Specification _userInfo; public Specification(ConditionBean baseCB, - SpQyCall<RoleMappingCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<RoleMappingCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -285,7 +273,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } @@ -304,7 +293,8 @@ public UserInfoCQ qy() { return _myQyCall.qy().queryUserInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfo; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -93,7 +92,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -143,23 +147,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<UserInfoCB> unionQuery). - */ - public void union(UserInfoCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<UserInfoCB> - * unionQuery). - */ - public void unionAll(UserInfoCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -168,7 +155,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -229,7 +215,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +229,10 @@ protected RoleInfoCB.Specification _roleInfo; public Specification(ConditionBean baseCB, SpQyCall<UserInfoCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -307,6 +296,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -363,7 +356,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -382,7 +376,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/bs/BsWorkingTypeCB.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -16,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsWorkingTypeCB extends AbstractConditionBean { //========================================================================== @@ -84,7 +83,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -134,24 +138,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<WorkingTypeCB> - * unionQuery). - */ - public void union(WorkingTypeCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<WorkingTypeCB> - * unionQuery). - */ - public void unionAll(WorkingTypeCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -179,7 +165,8 @@ public WorkingTypeCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -189,8 +176,10 @@ protected SpQyCall<WorkingTypeCQ> _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall<WorkingTypeCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<WorkingTypeCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsDailyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsDailyReportCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param date The value of date as equal. */ @@ -155,7 +155,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as notEqual. */ @@ -164,7 +164,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as greaterThan. */ @@ -173,7 +173,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as lessThan. */ @@ -182,7 +182,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as greaterEqual. */ @@ -191,7 +191,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param date The value of date as lessEqual. */ @@ -230,7 +230,7 @@ abstract protected ConditionValue getCValueDate(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param dayOfWeek The value of dayOfWeek as equal. */ @@ -239,7 +239,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as notEqual. */ @@ -248,7 +248,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as greaterThan. */ @@ -257,7 +257,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as lessThan. */ @@ -266,7 +266,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as greaterEqual. */ @@ -275,7 +275,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param dayOfWeek The value of dayOfWeek as lessEqual. */ @@ -316,7 +316,7 @@ abstract protected ConditionValue getCValueDayOfWeek(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param dateType The value of dateType as equal. */ @@ -325,7 +325,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as notEqual. */ @@ -334,7 +334,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as greaterThan. */ @@ -343,7 +343,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as lessThan. */ @@ -352,7 +352,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as greaterEqual. */ @@ -361,7 +361,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param dateType The value of dateType as lessEqual. */ @@ -402,7 +402,7 @@ abstract protected ConditionValue getCValueDateType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param workingType The value of workingType as equal. @@ -412,7 +412,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as notEqual. */ @@ -421,7 +421,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as greaterThan. */ @@ -430,7 +430,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as lessThan. */ @@ -439,7 +439,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as greaterEqual. */ @@ -448,7 +448,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingType The value of workingType as lessEqual. */ @@ -489,7 +489,7 @@ abstract protected ConditionValue getCValueWorkingType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param status The value of status as equal. @@ -499,7 +499,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -508,7 +508,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -517,7 +517,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -526,7 +526,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -535,7 +535,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -576,7 +576,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param startTime The value of startTime as equal. */ @@ -585,7 +585,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as notEqual. */ @@ -594,7 +594,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterThan. */ @@ -603,7 +603,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessThan. */ @@ -612,7 +612,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterEqual. */ @@ -621,7 +621,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessEqual. */ @@ -630,14 +630,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStartTime_IsNull() { regStartTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStartTime_IsNotNull() { regStartTime(CK_ISNN, DUMMY_OBJECT); @@ -656,7 +656,7 @@ abstract protected ConditionValue getCValueStartTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param endTime The value of endTime as equal. */ @@ -665,7 +665,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as notEqual. */ @@ -674,7 +674,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterThan. */ @@ -683,7 +683,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessThan. */ @@ -692,7 +692,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterEqual. */ @@ -701,7 +701,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessEqual. */ @@ -710,14 +710,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndTime_IsNull() { regEndTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndTime_IsNotNull() { regEndTime(CK_ISNN, DUMMY_OBJECT); @@ -736,7 +736,7 @@ abstract protected ConditionValue getCValueEndTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param breakTime The value of breakTime as equal. */ @@ -745,7 +745,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as notEqual. */ @@ -754,7 +754,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as greaterThan. */ @@ -763,7 +763,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as lessThan. */ @@ -772,7 +772,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as greaterEqual. */ @@ -781,7 +781,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param breakTime The value of breakTime as lessEqual. */ @@ -790,14 +790,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBreakTime_IsNull() { regBreakTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBreakTime_IsNotNull() { regBreakTime(CK_ISNN, DUMMY_OBJECT); @@ -816,7 +816,7 @@ abstract protected ConditionValue getCValueBreakTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIME} * * @param otjTime The value of otjTime as equal. */ @@ -825,7 +825,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as notEqual. */ @@ -834,7 +834,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as greaterThan. */ @@ -843,7 +843,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as lessThan. */ @@ -852,7 +852,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as greaterEqual. */ @@ -861,7 +861,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param otjTime The value of otjTime as lessEqual. */ @@ -870,14 +870,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setOtjTime_IsNull() { regOtjTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setOtjTime_IsNotNull() { regOtjTime(CK_ISNN, DUMMY_OBJECT); @@ -896,7 +896,7 @@ abstract protected ConditionValue getCValueOtjTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {BIGINT} * * @param workingTime The value of workingTime as equal. */ @@ -905,7 +905,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as notEqual. */ @@ -914,7 +914,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterThan. */ @@ -923,7 +923,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessThan. */ @@ -932,7 +932,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterEqual. */ @@ -941,7 +941,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessEqual. */ @@ -970,14 +970,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setWorkingTime_IsNull() { regWorkingTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setWorkingTime_IsNotNull() { regWorkingTime(CK_ISNN, DUMMY_OBJECT); @@ -996,7 +996,7 @@ abstract protected ConditionValue getCValueWorkingTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(200)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(200)} * * @param memo The value of memo as equal. */ @@ -1005,7 +1005,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -1014,7 +1014,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -1023,7 +1023,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -1032,7 +1032,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -1041,7 +1041,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -1050,7 +1050,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -1059,20 +1059,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1083,38 +1069,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection<String> memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection<String> memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -1131,7 +1131,7 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0] : FK to MONTHLY_REPORT} * * @param monthlyReportId The value of monthlyReportId as equal. @@ -1141,7 +1141,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as notEqual. */ @@ -1150,7 +1150,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterThan. */ @@ -1159,7 +1159,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessThan. */ @@ -1168,7 +1168,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterEqual. */ @@ -1177,7 +1177,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessEqual. */ @@ -1207,34 +1207,18 @@ regMonthlyReportId(CK_NINS, cTL(monthlyReportIdList)); } - /** - * @param monthlyReportCBquery Query. - * @deprecated Please use inScopeMonthlyReport(subQuery) method. - */ - public void setMonthlyReportId_InScopeSubQuery_MonthlyReport( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyReportCBquery, "MONTHLY_REPORT_ID", - "ID", subQueryPropertyName); - } - public void inScopeMonthlyReport(SubQuery<MonthlyReportCB> subQuery) { assertObjectNotNull("subQuery<MonthlyReportCB>", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MONTHLY_REPORT_ID", "ID", subQueryPropertyName); } - abstract public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + public abstract String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( MonthlyReportCQ subQuery); protected void regMonthlyReportId(ConditionKey key, Object value) { @@ -1250,7 +1234,7 @@ abstract protected ConditionValue getCValueMonthlyReportId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1259,7 +1243,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1268,7 +1252,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1277,7 +1261,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1286,7 +1270,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1295,7 +1279,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1305,7 +1289,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1323,7 +1307,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1349,7 +1333,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1359,7 +1343,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1368,7 +1352,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1377,7 +1361,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1386,7 +1370,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1395,7 +1379,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1404,7 +1388,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1413,20 +1397,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1437,27 +1407,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1473,7 +1457,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1482,7 +1466,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1491,7 +1475,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1500,7 +1484,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1509,7 +1493,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1518,7 +1502,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1528,7 +1512,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1546,7 +1530,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1572,7 +1556,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1582,7 +1566,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1591,7 +1575,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1600,7 +1584,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1609,7 +1593,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1618,7 +1602,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1627,7 +1611,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1636,20 +1620,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1660,27 +1630,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1696,7 +1680,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1706,7 +1690,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1715,7 +1699,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1724,7 +1708,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1733,7 +1717,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1742,7 +1726,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1782,6 +1766,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<DailyReportCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<DailyReportCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<DailyReportCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<DailyReportCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<DailyReportCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<DailyReportCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<DailyReportCB>(new SSQSetupper<DailyReportCB>() { + public void setup(String function, SubQuery<DailyReportCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<DailyReportCB> subQuery, String operand) { + assertObjectNotNull("subQuery<DailyReportCB>", subQuery); + DailyReportCB cb = new DailyReportCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(DailyReportCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return DailyReportCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsEmployeeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -13,14 +13,12 @@ import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; -import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of EMPLOYEE. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsEmployeeCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +48,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +58,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +67,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +76,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +85,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +94,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,34 +122,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param monthlyReportCBquery Query. - * @deprecated Please use inScopeMonthlyReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_MonthlyReportList( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyReportList(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyReportCBquery, "ID", "EMPLOYEE_ID", - subQueryPropertyName); - } - public void inScopeMonthlyReportList(SubQuery<MonthlyReportCB> subQuery) { assertObjectNotNull("subQuery<MonthlyReportCB>", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MonthlyReportList( + public abstract String keepId_InScopeSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); public void notInScopeMonthlyReportList(SubQuery<MonthlyReportCB> subQuery) { @@ -159,31 +142,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MonthlyReportList( + public abstract String keepId_NotInScopeSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); /** - * @param monthlyReportCBquery Query. - * @deprecated Please use existsMonthlyReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_MonthlyReportList( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyReportList(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(monthlyReportCBquery, "ID", "EMPLOYEE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select EMPLOYEE_ID from * MONTHLY_REPORT where ...)} * @@ -196,12 +163,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MonthlyReportList( + public abstract String keepId_ExistsSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); /** @@ -217,38 +184,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "EMPLOYEE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MonthlyReportList( + public abstract String keepId_NotExistsSubQuery_MonthlyReportList( MonthlyReportCQ subQuery); public void xderiveMonthlyReportList(String function, SubQuery<MonthlyReportCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<MonthlyReportCB>", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "EMPLOYEE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MonthlyReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "EMPLOYEE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MonthlyReportList( + public abstract String keepId_DerivedReferrer_MonthlyReportList( MonthlyReportCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -265,8 +232,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param username The value of username as equal. */ @@ -275,7 +242,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as notEqual. */ @@ -284,7 +251,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as greaterThan. */ @@ -293,7 +260,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as lessThan. */ @@ -302,7 +269,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as greaterEqual. */ @@ -311,7 +278,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as lessEqual. */ @@ -320,7 +287,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param username The value of username as prefixSearch. */ @@ -329,20 +296,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param username The value of username as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUsername_LikeSearch( - String username, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(username), getCValueUsername(), - "USERNAME", "Username", "username", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -353,43 +306,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param username The collection of username as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param usernameList The collection of username as notInScope. */ - public void setUsername_InScope( - String username, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(username), getCValueUsername(), - "USERNAME", "Username", "username", inScopeOption); + public void setUsername_NotInScope(Collection<String> usernameList) { + regUsername(CK_NINS, cTL(usernameList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param usernameList The collection of username as notInScope. + * @param username The value of username as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUsername_NotInScope(Collection<String> usernameList) { - regUsername(CK_NINS, cTL(usernameList)); + public void setUsername_LikeSearch( + String username, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(username), getCValueUsername(), "USERNAME", + "Username", "username", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUsername(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param username The value of username as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUsername_InScopeSubQuery_UserInfoByUsername( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUsername_InScopeSubQuery_UserInfoByUsername(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USERNAME", "USER_ID", - subQueryPropertyName); + public void setUsername_NotLikeSearch( + String username, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(username), getCValueUsername(), "USERNAME", + "Username", "username", likeSearchOption); } public void inScopeUserInfoByUsername(SubQuery<UserInfoCB> subQuery) { @@ -398,12 +349,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUsername_InScopeSubQuery_UserInfoByUsername(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USERNAME", "USER_ID", subQueryPropertyName); } - abstract public String keepUsername_InScopeSubQuery_UserInfoByUsername( + public abstract String keepUsername_InScopeSubQuery_UserInfoByUsername( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regUsername(ConditionKey key, Object value) { @@ -419,8 +370,8 @@ abstract protected ConditionValue getCValueUsername(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param manager The value of manager as equal. */ @@ -429,7 +380,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as notEqual. */ @@ -438,7 +389,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as greaterThan. */ @@ -447,7 +398,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as lessThan. */ @@ -456,7 +407,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as greaterEqual. */ @@ -465,7 +416,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as lessEqual. */ @@ -474,7 +425,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param manager The value of manager as prefixSearch. */ @@ -483,20 +434,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param manager The value of manager as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setManager_LikeSearch( - String manager, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(manager), getCValueManager(), - "MANAGER", "Manager", "manager", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -507,43 +444,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param manager The collection of manager as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param managerList The collection of manager as notInScope. */ - public void setManager_InScope( - String manager, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(manager), getCValueManager(), - "MANAGER", "Manager", "manager", inScopeOption); + public void setManager_NotInScope(Collection<String> managerList) { + regManager(CK_NINS, cTL(managerList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param managerList The collection of manager as notInScope. + * @param manager The value of manager as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setManager_NotInScope(Collection<String> managerList) { - regManager(CK_NINS, cTL(managerList)); + public void setManager_LikeSearch( + String manager, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(manager), getCValueManager(), "MANAGER", "Manager", + "manager", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByManager(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param manager The value of manager as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setManager_InScopeSubQuery_UserInfoByManager( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepManager_InScopeSubQuery_UserInfoByManager(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "MANAGER", "USER_ID", - subQueryPropertyName); + public void setManager_NotLikeSearch( + String manager, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(manager), getCValueManager(), "MANAGER", "Manager", + "manager", likeSearchOption); } public void inScopeUserInfoByManager(SubQuery<UserInfoCB> subQuery) { @@ -552,12 +487,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepManager_InScopeSubQuery_UserInfoByManager(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MANAGER", "USER_ID", subQueryPropertyName); } - abstract public String keepManager_InScopeSubQuery_UserInfoByManager( + public abstract String keepManager_InScopeSubQuery_UserInfoByManager( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regManager(ConditionKey key, Object value) { @@ -573,8 +508,8 @@ abstract protected ConditionValue getCValueManager(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[T]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[T]} * * @param isAvailable The value of isAvailable as equal. */ @@ -583,7 +518,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as notEqual. */ @@ -592,7 +527,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as greaterThan. */ @@ -601,7 +536,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as lessThan. */ @@ -610,7 +545,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as greaterEqual. */ @@ -619,7 +554,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as lessEqual. */ @@ -628,7 +563,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param isAvailable The value of isAvailable as prefixSearch. */ @@ -637,21 +572,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param isAvailable The value of isAvailable as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setIsAvailable_LikeSearch( - String isAvailable, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(isAvailable), - getCValueIsAvailable(), "IS_AVAILABLE", "IsAvailable", - "isAvailable", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -662,27 +582,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param isAvailable The collection of isAvailable as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param isAvailableList The collection of isAvailable as notInScope. */ - public void setIsAvailable_InScope( + public void setIsAvailable_NotInScope(Collection<String> isAvailableList) { + regIsAvailable(CK_NINS, cTL(isAvailableList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param isAvailable The value of isAvailable as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setIsAvailable_LikeSearch( String isAvailable, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(isAvailable), getCValueIsAvailable(), - "IS_AVAILABLE", "IsAvailable", "isAvailable", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(isAvailable), getCValueIsAvailable(), + "IS_AVAILABLE", "IsAvailable", "isAvailable", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param isAvailableList The collection of isAvailable as notInScope. + * @param isAvailable The value of isAvailable as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setIsAvailable_NotInScope(Collection<String> isAvailableList) { - regIsAvailable(CK_NINS, cTL(isAvailableList)); + public void setIsAvailable_NotLikeSearch( + String isAvailable, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(isAvailable), getCValueIsAvailable(), + "IS_AVAILABLE", "IsAvailable", "isAvailable", likeSearchOption); } protected void regIsAvailable(ConditionKey key, Object value) { @@ -698,7 +632,7 @@ abstract protected ConditionValue getCValueIsAvailable(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -707,7 +641,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -716,7 +650,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -725,7 +659,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -734,7 +668,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -743,7 +677,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -753,7 +687,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -771,7 +705,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -797,7 +731,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -807,7 +741,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -816,7 +750,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -825,7 +759,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -834,7 +768,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -843,7 +777,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -852,7 +786,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -861,20 +795,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -885,27 +805,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -921,7 +855,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -930,7 +864,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -939,7 +873,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -948,7 +882,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -957,7 +891,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -966,7 +900,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -976,7 +910,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -994,7 +928,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1020,7 +954,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1030,7 +964,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1039,7 +973,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1048,7 +982,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1057,7 +991,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1066,7 +1000,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1075,7 +1009,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1084,20 +1018,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1108,27 +1028,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1144,7 +1078,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1153,7 +1087,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1162,7 +1096,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1171,7 +1105,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1180,7 +1114,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1189,7 +1123,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1199,7 +1133,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1217,7 +1151,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1231,14 +1165,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1257,7 +1191,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1266,7 +1200,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1275,7 +1209,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1284,7 +1218,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1293,7 +1227,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1302,7 +1236,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1311,7 +1245,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1320,20 +1254,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1344,38 +1264,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection<String> deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1394,7 +1328,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1404,7 +1338,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1413,7 +1347,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1422,7 +1356,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1431,7 +1365,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1440,7 +1374,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1480,6 +1414,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<EmployeeCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<EmployeeCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<EmployeeCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<EmployeeCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<EmployeeCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<EmployeeCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<EmployeeCB>(new SSQSetupper<EmployeeCB>() { + public void setup(String function, SubQuery<EmployeeCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<EmployeeCB> subQuery, String operand) { + assertObjectNotNull("subQuery<EmployeeCB>", subQuery); + EmployeeCB cb = new EmployeeCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(EmployeeCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return EmployeeCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param groupId The value of groupId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection<String> groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection<String> groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setGroupId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery<UserInfoCB> subQuery) { assertObjectNotNull("subQuery<UserInfoCB>", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + public abstract String keepGroupId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepGroupId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery<UserInfoCB> subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotInScopeSubQuery_UserInfoList( + public abstract String keepGroupId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from GROUP_MAPPING * where ...)} * @@ -278,31 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setGroupId_ExistsSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select GROUP_ID from USER_INFO where * ...)} * @@ -315,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + public abstract String keepGroupId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -337,12 +272,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + public abstract String keepGroupId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -358,53 +293,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_NotExistsSubQuery_UserInfoList( + public abstract String keepGroupId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery<GroupMappingCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + public abstract String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery<UserInfoCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<UserInfoCB>", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepGroupId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "GROUP_ID", + "GROUP_ID", subQueryPropertyName, aliasName); } - abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + public abstract String keepGroupId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -423,7 +358,7 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -432,7 +367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -441,7 +376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -450,7 +385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -459,7 +394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -468,7 +403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -477,7 +412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -486,20 +421,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -510,38 +431,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection<String> nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection<String> nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -558,7 +493,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -567,7 +502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -576,7 +511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -585,7 +520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -594,7 +529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -603,7 +538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -612,7 +547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -621,21 +556,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -646,38 +566,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection<String> descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection<String> descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -696,7 +630,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -705,7 +639,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -714,7 +648,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -723,7 +657,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -732,7 +666,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -741,7 +675,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -750,7 +684,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -759,20 +693,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -783,38 +703,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection<String> emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection<String> emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -832,7 +766,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -841,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -850,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -859,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -868,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -877,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -886,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -895,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -919,38 +839,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection<String> urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection<String> urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -967,7 +901,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -976,7 +910,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -985,7 +919,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -994,7 +928,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1003,7 +937,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1012,7 +946,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1021,7 +955,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1030,20 +964,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1054,38 +974,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection<String> telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection<String> telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1104,7 +1038,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1113,7 +1047,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1122,7 +1056,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1131,7 +1065,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1140,7 +1074,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1149,7 +1083,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1159,7 +1093,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1177,7 +1111,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1203,7 +1137,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1213,7 +1147,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1222,7 +1156,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1231,7 +1165,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1240,7 +1174,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1249,7 +1183,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1258,7 +1192,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1267,20 +1201,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1291,27 +1211,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1327,7 +1261,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1336,7 +1270,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1345,7 +1279,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1354,7 +1288,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1363,7 +1297,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1372,7 +1306,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1382,7 +1316,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1400,7 +1334,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1426,7 +1360,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1436,7 +1370,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1445,7 +1379,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1454,7 +1388,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1463,7 +1397,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1472,7 +1406,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1481,7 +1415,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1490,20 +1424,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1514,27 +1434,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1550,7 +1484,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1559,7 +1493,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1568,7 +1502,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1577,7 +1511,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1586,7 +1520,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1595,7 +1529,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1605,7 +1539,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1623,7 +1557,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1637,14 +1571,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1663,7 +1597,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1672,7 +1606,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1681,7 +1615,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1690,7 +1624,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1699,7 +1633,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1708,7 +1642,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1717,7 +1651,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1726,20 +1660,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1750,38 +1670,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection<String> deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1800,7 +1734,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1809,7 +1743,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1818,7 +1752,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1827,7 +1761,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1836,7 +1770,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1845,7 +1779,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1885,6 +1819,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<GroupInfoCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<GroupInfoCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<GroupInfoCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<GroupInfoCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<GroupInfoCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<GroupInfoCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<GroupInfoCB>(new SSQSetupper<GroupInfoCB>() { + public void setup(String function, SubQuery<GroupInfoCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<GroupInfoCB> subQuery, String operand) { + assertObjectNotNull("subQuery<GroupInfoCB>", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupInfoCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -11,16 +11,13 @@ import jp.sf.pal.timecard.db.cbean.GroupInfoCB; import jp.sf.pal.timecard.db.cbean.GroupMappingCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; -import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of GROUP_MAPPING. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection<String> userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery<UserInfoCB> subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,43 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection<String> groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection<String> groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery<GroupInfoCB> subQuery) { @@ -434,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ subQuery); protected void regGroupId(ConditionKey key, Object value) { @@ -454,6 +421,53 @@ abstract protected ConditionValue getCValueGroupId(); + public SSQFunction<GroupMappingCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<GroupMappingCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<GroupMappingCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<GroupMappingCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<GroupMappingCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<GroupMappingCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<GroupMappingCB>( + new SSQSetupper<GroupMappingCB>() { + public void setup(String function, + SubQuery<GroupMappingCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<GroupMappingCB> subQuery, String operand) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(GroupMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return GroupMappingCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -22,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsMonthlyReportCQ extends AbstractConditionQuery { //========================================================================== @@ -52,7 +51,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -61,7 +61,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +70,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +79,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +97,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,52 +125,20 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param dailyReportCBquery Query. - * @deprecated Please use inScopeDailyReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_DailyReportList( - DailyReportCQ dailyReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_DailyReportList(dailyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(dailyReportCBquery, "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName); - } - public void inScopeDailyReportList(SubQuery<DailyReportCB> subQuery) { assertObjectNotNull("subQuery<DailyReportCB>", subQuery); DailyReportCB cb = new DailyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_DailyReportList( + public abstract String keepId_InScopeSubQuery_DailyReportList( DailyReportCQ subQuery); - /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use inScopeMonthlyWorkingReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyWorkingReportCBquery, "ID", - "MONTHLY_REPORT_ID", subQueryPropertyName); - } - public void inScopeMonthlyWorkingReportList( SubQuery<MonthlyWorkingReportCB> subQuery) { assertObjectNotNull("subQuery<MonthlyWorkingReportCB>", subQuery); @@ -178,12 +146,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_InScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void notInScopeDailyReportList(SubQuery<DailyReportCB> subQuery) { @@ -192,12 +160,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_DailyReportList( + public abstract String keepId_NotInScopeSubQuery_DailyReportList( DailyReportCQ subQuery); public void notInScopeMonthlyWorkingReportList( @@ -207,31 +175,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * @param dailyReportCBquery Query. - * @deprecated Please use existsDailyReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_DailyReportList( - DailyReportCQ dailyReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_DailyReportList(dailyReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(dailyReportCBquery, "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MONTHLY_REPORT_ID from * DAILY_REPORT where ...)} * @@ -244,31 +196,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_DailyReportList( + public abstract String keepId_ExistsSubQuery_DailyReportList( DailyReportCQ subQuery); /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use existsMonthlyWorkingReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(monthlyWorkingReportCBquery, "ID", - "MONTHLY_REPORT_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MONTHLY_REPORT_ID from * MONTHLY_WORKING_REPORT where ...)} * @@ -283,12 +219,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_ExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** @@ -304,12 +240,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_DailyReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_DailyReportList( + public abstract String keepId_NotExistsSubQuery_DailyReportList( DailyReportCQ subQuery); /** @@ -327,53 +263,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MONTHLY_REPORT_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void xderiveDailyReportList(String function, SubQuery<DailyReportCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<DailyReportCB>", subQuery); DailyReportCB cb = new DailyReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_DailyReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_DailyReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MONTHLY_REPORT_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_DailyReportList( + public abstract String keepId_DerivedReferrer_DailyReportList( DailyReportCQ subQuery); public void xderiveMonthlyWorkingReportList(String function, SubQuery<MonthlyWorkingReportCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<MonthlyWorkingReportCB>", subQuery); MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MONTHLY_REPORT_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MonthlyWorkingReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MONTHLY_REPORT_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public abstract String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -390,7 +326,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param year The value of year as equal. */ @@ -399,7 +335,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as notEqual. */ @@ -408,7 +344,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as greaterThan. */ @@ -417,7 +353,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as lessThan. */ @@ -426,7 +362,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as greaterEqual. */ @@ -435,7 +371,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param year The value of year as lessEqual. */ @@ -474,7 +410,7 @@ abstract protected ConditionValue getCValueYear(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param month The value of month as equal. */ @@ -483,7 +419,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as notEqual. */ @@ -492,7 +428,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as greaterThan. */ @@ -501,7 +437,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as lessThan. */ @@ -510,7 +446,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as greaterEqual. */ @@ -519,7 +455,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param month The value of month as lessEqual. */ @@ -559,7 +495,7 @@ abstract protected ConditionValue getCValueMonth(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[1]} * * @param status The value of status as equal. @@ -569,7 +505,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -578,7 +514,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -587,7 +523,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -596,7 +532,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -605,7 +541,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -646,7 +582,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : DOUBLE : * Default=[0]} * * @param stdWorkingDays The value of stdWorkingDays as equal. @@ -656,7 +592,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as notEqual. */ @@ -665,7 +601,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as greaterThan. */ @@ -675,7 +611,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as lessThan. */ @@ -684,7 +620,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as greaterEqual. */ @@ -694,7 +630,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingDays The value of stdWorkingDays as lessEqual. */ @@ -737,7 +673,7 @@ abstract protected ConditionValue getCValueStdWorkingDays(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param workingTime The value of workingTime as equal. @@ -747,7 +683,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as notEqual. */ @@ -756,7 +692,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterThan. */ @@ -765,7 +701,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessThan. */ @@ -774,7 +710,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as greaterEqual. */ @@ -783,7 +719,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingTime The value of workingTime as lessEqual. */ @@ -824,7 +760,7 @@ abstract protected ConditionValue getCValueWorkingTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param stdWorkingTime The value of stdWorkingTime as equal. @@ -834,7 +770,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as notEqual. */ @@ -843,7 +779,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as greaterThan. */ @@ -852,7 +788,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as lessThan. */ @@ -861,7 +797,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as greaterEqual. */ @@ -870,7 +806,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param stdWorkingTime The value of stdWorkingTime as lessEqual. */ @@ -911,7 +847,7 @@ abstract protected ConditionValue getCValueStdWorkingTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param overTime The value of overTime as equal. @@ -921,7 +857,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as notEqual. */ @@ -930,7 +866,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as greaterThan. */ @@ -939,7 +875,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as lessThan. */ @@ -948,7 +884,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as greaterEqual. */ @@ -957,7 +893,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param overTime The value of overTime as lessEqual. */ @@ -998,7 +934,7 @@ abstract protected ConditionValue getCValueOverTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : * Default=[0]} * * @param mntOverTime The value of mntOverTime as equal. @@ -1008,7 +944,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as notEqual. */ @@ -1017,7 +953,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as greaterThan. */ @@ -1026,7 +962,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as lessThan. */ @@ -1035,7 +971,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as greaterEqual. */ @@ -1044,7 +980,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param mntOverTime The value of mntOverTime as lessEqual. */ @@ -1085,7 +1021,7 @@ abstract protected ConditionValue getCValueMntOverTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * EMPLOYEE} * * @param employeeId The value of employeeId as equal. @@ -1095,7 +1031,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as notEqual. */ @@ -1104,7 +1040,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as greaterThan. */ @@ -1113,7 +1049,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as lessThan. */ @@ -1122,7 +1058,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as greaterEqual. */ @@ -1131,7 +1067,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param employeeId The value of employeeId as lessEqual. */ @@ -1159,34 +1095,18 @@ regEmployeeId(CK_NINS, cTL(employeeIdList)); } - /** - * @param employeeCBquery Query. - * @deprecated Please use inScopeEmployee(subQuery) method. - */ - public void setEmployeeId_InScopeSubQuery_Employee( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepEmployeeId_InScopeSubQuery_Employee(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(employeeCBquery, "EMPLOYEE_ID", "ID", - subQueryPropertyName); - } - public void inScopeEmployee(SubQuery<EmployeeCB> subQuery) { assertObjectNotNull("subQuery<EmployeeCB>", subQuery); EmployeeCB cb = new EmployeeCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepEmployeeId_InScopeSubQuery_Employee(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "EMPLOYEE_ID", "ID", subQueryPropertyName); } - abstract public String keepEmployeeId_InScopeSubQuery_Employee( + public abstract String keepEmployeeId_InScopeSubQuery_Employee( EmployeeCQ subQuery); protected void regEmployeeId(ConditionKey key, Object value) { @@ -1202,7 +1122,7 @@ abstract protected ConditionValue getCValueEmployeeId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1211,7 +1131,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1220,7 +1140,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1229,7 +1149,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1238,7 +1158,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1247,7 +1167,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1257,7 +1177,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1275,7 +1195,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1301,7 +1221,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1311,7 +1231,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1320,7 +1240,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1329,7 +1249,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1338,7 +1258,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1347,7 +1267,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1356,7 +1276,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1365,20 +1285,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1389,27 +1295,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1425,7 +1345,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1434,7 +1354,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1443,7 +1363,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1452,7 +1372,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1461,7 +1381,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1470,7 +1390,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1480,7 +1400,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1498,7 +1418,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1524,7 +1444,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1534,7 +1454,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1543,7 +1463,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1552,7 +1472,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1561,7 +1481,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1570,7 +1490,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1579,7 +1499,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1588,20 +1508,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1612,27 +1518,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1648,7 +1568,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1657,7 +1577,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1666,7 +1586,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1675,7 +1595,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1684,7 +1604,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1693,7 +1613,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1703,7 +1623,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1721,7 +1641,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1735,14 +1655,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1761,7 +1681,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1770,7 +1690,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1779,7 +1699,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1788,7 +1708,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1797,7 +1717,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1806,7 +1726,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1815,7 +1735,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1824,20 +1744,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1848,38 +1754,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection<String> deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1898,7 +1818,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1908,7 +1828,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1917,7 +1837,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1926,7 +1846,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1935,7 +1855,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1944,7 +1864,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1984,6 +1904,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<MonthlyReportCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<MonthlyReportCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<MonthlyReportCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<MonthlyReportCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<MonthlyReportCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<MonthlyReportCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<MonthlyReportCB>( + new SSQSetupper<MonthlyReportCB>() { + public void setup(String function, + SubQuery<MonthlyReportCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<MonthlyReportCB> subQuery, String operand) { + assertObjectNotNull("subQuery<MonthlyReportCB>", subQuery); + MonthlyReportCB cb = new MonthlyReportCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MonthlyReportCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MonthlyReportCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsMonthlyWorkingReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsMonthlyWorkingReportCQ extends AbstractConditionQuery { @@ -51,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -60,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,14 +125,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -149,7 +149,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DOUBLE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : DOUBLE} * * @param value The value of value as equal. */ @@ -158,7 +158,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as notEqual. */ @@ -167,7 +167,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterThan. */ @@ -176,7 +176,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessThan. */ @@ -185,7 +185,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterEqual. */ @@ -194,7 +194,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessEqual. */ @@ -234,7 +234,7 @@ abstract protected ConditionValue getCValueValue(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * MONTHLY_REPORT} * * @param monthlyReportId The value of monthlyReportId as equal. @@ -244,7 +244,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as notEqual. */ @@ -253,7 +253,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterThan. */ @@ -262,7 +262,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessThan. */ @@ -271,7 +271,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as greaterEqual. */ @@ -280,7 +280,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param monthlyReportId The value of monthlyReportId as lessEqual. */ @@ -310,34 +310,18 @@ regMonthlyReportId(CK_NINS, cTL(monthlyReportIdList)); } - /** - * @param monthlyReportCBquery Query. - * @deprecated Please use inScopeMonthlyReport(subQuery) method. - */ - public void setMonthlyReportId_InScopeSubQuery_MonthlyReport( - MonthlyReportCQ monthlyReportCBquery) { - String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(monthlyReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyReportCBquery, "MONTHLY_REPORT_ID", - "ID", subQueryPropertyName); - } - public void inScopeMonthlyReport(SubQuery<MonthlyReportCB> subQuery) { assertObjectNotNull("subQuery<MonthlyReportCB>", subQuery); MonthlyReportCB cb = new MonthlyReportCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMonthlyReportId_InScopeSubQuery_MonthlyReport(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MONTHLY_REPORT_ID", "ID", subQueryPropertyName); } - abstract public String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( + public abstract String keepMonthlyReportId_InScopeSubQuery_MonthlyReport( MonthlyReportCQ subQuery); protected void regMonthlyReportId(ConditionKey key, Object value) { @@ -353,7 +337,7 @@ abstract protected ConditionValue getCValueMonthlyReportId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * WORKING_TYPE} * * @param workingTypeId The value of workingTypeId as equal. @@ -363,7 +347,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as notEqual. */ @@ -372,7 +356,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as greaterThan. */ @@ -381,7 +365,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as lessThan. */ @@ -390,7 +374,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as greaterEqual. */ @@ -399,7 +383,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param workingTypeId The value of workingTypeId as lessEqual. */ @@ -428,34 +412,18 @@ regWorkingTypeId(CK_NINS, cTL(workingTypeIdList)); } - /** - * @param workingTypeCBquery Query. - * @deprecated Please use inScopeWorkingType(subQuery) method. - */ - public void setWorkingTypeId_InScopeSubQuery_WorkingType( - WorkingTypeCQ workingTypeCBquery) { - String subQueryPropertyName = keepWorkingTypeId_InScopeSubQuery_WorkingType(workingTypeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(workingTypeCBquery, "WORKING_TYPE_ID", "ID", - subQueryPropertyName); - } - public void inScopeWorkingType(SubQuery<WorkingTypeCB> subQuery) { assertObjectNotNull("subQuery<WorkingTypeCB>", subQuery); WorkingTypeCB cb = new WorkingTypeCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepWorkingTypeId_InScopeSubQuery_WorkingType(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "WORKING_TYPE_ID", "ID", subQueryPropertyName); } - abstract public String keepWorkingTypeId_InScopeSubQuery_WorkingType( + public abstract String keepWorkingTypeId_InScopeSubQuery_WorkingType( WorkingTypeCQ subQuery); protected void regWorkingTypeId(ConditionKey key, Object value) { @@ -470,6 +438,53 @@ abstract protected ConditionValue getCValueWorkingTypeId(); + public SSQFunction<MonthlyWorkingReportCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<MonthlyWorkingReportCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<MonthlyWorkingReportCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<MonthlyWorkingReportCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<MonthlyWorkingReportCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<MonthlyWorkingReportCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<MonthlyWorkingReportCB>( + new SSQSetupper<MonthlyWorkingReportCB>() { + public void setup(String function, + SubQuery<MonthlyWorkingReportCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<MonthlyWorkingReportCB> subQuery, String operand) { + assertObjectNotNull("subQuery<MonthlyWorkingReportCB>", subQuery); + MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MonthlyWorkingReportCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MonthlyWorkingReportCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +49,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param roleId The value of roleId as equal. @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -105,7 +104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -114,20 +113,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -138,43 +123,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection<String> roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection<String> roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { @@ -183,42 +166,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); - /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoList(subQuery) method. - */ - public void setRoleId_InScopeSubQuery_UserInfoList( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - public void inScopeUserInfoList(SubQuery<UserInfoCB> subQuery) { assertObjectNotNull("subQuery<UserInfoCB>", subQuery); UserInfoCB cb = new UserInfoCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + public abstract String keepRoleId_InScopeSubQuery_UserInfoList( UserInfoCQ subQuery); public void notInScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { @@ -227,12 +194,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepRoleId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeUserInfoList(SubQuery<UserInfoCB> subQuery) { @@ -241,31 +208,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotInScopeSubQuery_UserInfoList( + public abstract String keepRoleId_NotInScopeSubQuery_UserInfoList( UserInfoCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from ROLE_MAPPING * where ...)} * @@ -278,30 +229,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param userInfoCBquery Query. - * @deprecated Please use existsUserInfoList(subQuery) method. - */ - public void setRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(userInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ROLE_ID from USER_INFO where * ...)} * @@ -314,12 +250,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + public abstract String keepRoleId_ExistsSubQuery_UserInfoList( UserInfoCQ subQuery); /** @@ -335,12 +271,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + public abstract String keepRoleId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -356,53 +292,53 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_NotExistsSubQuery_UserInfoList( + public abstract String keepRoleId_NotExistsSubQuery_UserInfoList( UserInfoCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery<RoleMappingCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + public abstract String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); public void xderiveUserInfoList(String function, SubQuery<UserInfoCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<UserInfoCB>", subQuery); UserInfoCB cb = new UserInfoCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepRoleId_DerivedReferrer_UserInfoList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ROLE_ID", + "ROLE_ID", subQueryPropertyName, aliasName); } - abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + public abstract String keepRoleId_DerivedReferrer_UserInfoList( UserInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -421,7 +357,7 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param name The value of name as equal. */ @@ -430,7 +366,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -439,7 +375,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -448,7 +384,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -457,7 +393,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -466,7 +402,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -475,7 +411,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -484,20 +420,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -508,38 +430,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection<String> nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection<String> nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setName_IsNull() { regName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setName_IsNotNull() { regName(CK_ISNN, DUMMY_OBJECT); @@ -556,7 +492,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param description The value of description as equal. */ @@ -565,7 +501,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as notEqual. */ @@ -574,7 +510,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterThan. */ @@ -583,7 +519,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessThan. */ @@ -592,7 +528,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as greaterEqual. */ @@ -601,7 +537,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as lessEqual. */ @@ -610,7 +546,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param description The value of description as prefixSearch. */ @@ -619,21 +555,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param description The value of description as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDescription_LikeSearch( - String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(description), - getCValueDescription(), "DESCRIPTION", "Description", - "description", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -644,38 +565,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param description The collection of description as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param descriptionList The collection of description as notInScope. */ - public void setDescription_InScope( + public void setDescription_NotInScope(Collection<String> descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param description The value of description as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDescription_LikeSearch( String description, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(description), getCValueDescription(), "DESCRIPTION", + "Description", "description", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param descriptionList The collection of description as notInScope. + * @param description The value of description as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDescription_NotInScope(Collection<String> descriptionList) { - regDescription(CK_NINS, cTL(descriptionList)); + public void setDescription_NotLikeSearch( + String description, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDescription_IsNull() { regDescription(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDescription_IsNotNull() { regDescription(CK_ISNN, DUMMY_OBJECT); @@ -694,7 +629,7 @@ abstract protected ConditionValue getCValueDescription(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -703,7 +638,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -712,7 +647,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -721,7 +656,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -730,7 +665,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -739,7 +674,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -748,7 +683,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -757,20 +692,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -781,38 +702,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection<String> emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection<String> emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -830,7 +765,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -839,7 +774,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -848,7 +783,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -857,7 +792,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -866,7 +801,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -875,7 +810,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -884,7 +819,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -893,20 +828,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -917,38 +838,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection<String> urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection<String> urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -965,7 +900,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -974,7 +909,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -983,7 +918,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -992,7 +927,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1001,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1010,7 +945,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1019,7 +954,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1028,20 +963,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1052,38 +973,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection<String> telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection<String> telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -1102,7 +1037,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -1111,7 +1046,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1120,7 +1055,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1129,7 +1064,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1138,7 +1073,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1147,7 +1082,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1157,7 +1092,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1175,7 +1110,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -1201,7 +1136,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -1211,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1220,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1229,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1238,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1247,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1256,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1265,20 +1200,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1289,27 +1210,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1325,7 +1260,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -1334,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1343,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1352,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1361,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1370,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1380,7 +1315,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1398,7 +1333,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1424,7 +1359,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1434,7 +1369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1423,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1512,27 +1433,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1548,7 +1483,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1557,7 +1492,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1501,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1510,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1519,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1528,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1538,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1621,7 +1556,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1635,14 +1570,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1661,7 +1596,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1670,7 +1605,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1679,7 +1614,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1688,7 +1623,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1697,7 +1632,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1706,7 +1641,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1715,7 +1650,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1724,20 +1659,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1748,38 +1669,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection<String> deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1798,7 +1733,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -1807,7 +1742,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1816,7 +1751,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1825,7 +1760,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1834,7 +1769,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1843,7 +1778,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1883,6 +1818,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<RoleInfoCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<RoleInfoCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<RoleInfoCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<RoleInfoCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<RoleInfoCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<RoleInfoCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<RoleInfoCB>(new SSQSetupper<RoleInfoCB>() { + public void setup(String function, SubQuery<RoleInfoCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<RoleInfoCB> subQuery, String operand) { + assertObjectNotNull("subQuery<RoleInfoCB>", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleInfoCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -11,16 +11,13 @@ import jp.sf.pal.timecard.db.cbean.RoleInfoCB; import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; -import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of ROLE_MAPPING. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { //========================================================================== @@ -50,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -59,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -148,8 +146,8 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param userId The value of userId as equal. */ @@ -158,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -167,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -176,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -185,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -194,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -203,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -212,20 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,42 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection<String> userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_UserInfo(UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeUserInfo(SubQuery<UserInfoCB> subQuery) { @@ -280,12 +263,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_UserInfo( + public abstract String keepUserId_InScopeSubQuery_UserInfo( jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ subQuery); protected void regUserId(ConditionKey key, Object value) { @@ -301,8 +284,8 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -311,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -320,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -329,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -338,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -347,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -356,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -365,20 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -389,42 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection<String> roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection<String> roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery<RoleInfoCB> subQuery) { @@ -433,12 +401,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ subQuery); protected void regRoleId(ConditionKey key, Object value) { @@ -453,6 +421,50 @@ abstract protected ConditionValue getCValueRoleId(); + public SSQFunction<RoleMappingCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<RoleMappingCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<RoleMappingCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<RoleMappingCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<RoleMappingCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<RoleMappingCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<RoleMappingCB>(new SSQSetupper<RoleMappingCB>() { + public void setup(String function, SubQuery<RoleMappingCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<RoleMappingCB> subQuery, String operand) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(RoleMappingCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return RoleMappingCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -15,9 +15,7 @@ import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; -import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -26,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -56,7 +53,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -66,7 +63,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -75,7 +72,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -84,7 +81,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -93,7 +90,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -102,7 +99,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -111,7 +108,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -120,20 +117,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param userId The value of userId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUserId_LikeSearch( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -144,43 +127,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param userId The collection of userId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param userIdList The collection of userId as notInScope. */ - public void setUserId_InScope( - String userId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), - "USER_ID", "UserId", "userId", inScopeOption); + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param userIdList The collection of userId as notInScope. + * @param userId The value of userId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUserId_NotInScope(Collection<String> userIdList) { - regUserId(CK_NINS, cTL(userIdList)); + public void setUserId_LikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param employeeCBquery Query. - * @deprecated Please use inScopeEmployeeByUsernameList(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param userId The value of userId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUserId_InScopeSubQuery_EmployeeByUsernameList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByUsernameList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(employeeCBquery, "USER_ID", "USERNAME", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeEmployeeByUsernameList(SubQuery<EmployeeCB> subQuery) { @@ -189,102 +170,54 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_InScopeSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); - /** - * @param employeeCBquery Query. - * @deprecated Please use inScopeEmployeeByManagerList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_EmployeeByManagerList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByManagerList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(employeeCBquery, "USER_ID", "MANAGER", - subQueryPropertyName); - } - public void inScopeEmployeeByManagerList(SubQuery<EmployeeCB> subQuery) { assertObjectNotNull("subQuery<EmployeeCB>", subQuery); EmployeeCB cb = new EmployeeCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_EmployeeByManagerList( + public abstract String keepUserId_InScopeSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); - /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); GroupMappingCB cb = new GroupMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeEmployeeByUsernameList(SubQuery<EmployeeCB> subQuery) { @@ -293,12 +226,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_NotInScopeSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); public void notInScopeEmployeeByManagerList(SubQuery<EmployeeCB> subQuery) { @@ -307,12 +240,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_EmployeeByManagerList( + public abstract String keepUserId_NotInScopeSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); public void notInScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -321,12 +254,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { @@ -335,31 +268,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + public abstract String keepUserId_NotInScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** - * @param employeeCBquery Query. - * @deprecated Please use existsEmployeeByUsernameList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_EmployeeByUsernameList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByUsernameList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(employeeCBquery, "USER_ID", "USERNAME", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USERNAME from EMPLOYEE where * ...)} * @@ -373,31 +290,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_ExistsSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); /** - * @param employeeCBquery Query. - * @deprecated Please use existsEmployeeByManagerList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_EmployeeByManagerList( - EmployeeCQ employeeCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByManagerList(employeeCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(employeeCBquery, "USER_ID", "MANAGER", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MANAGER from EMPLOYEE where * ...)} * @@ -411,31 +312,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_EmployeeByManagerList( + public abstract String keepUserId_ExistsSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); /** - * @param groupMappingCBquery Query. - * @deprecated Please use existsGroupMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from GROUP_MAPPING * where ...)} * @@ -448,31 +333,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -485,12 +354,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + public abstract String keepUserId_ExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); /** @@ -507,12 +376,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USERNAME", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_NotExistsSubQuery_EmployeeByUsernameList( EmployeeCQ subQuery); /** @@ -529,12 +398,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "MANAGER", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_EmployeeByManagerList( + public abstract String keepUserId_NotExistsSubQuery_EmployeeByManagerList( EmployeeCQ subQuery); /** @@ -551,12 +420,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + public abstract String keepUserId_NotExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** @@ -572,83 +441,83 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + public abstract String keepUserId_NotExistsSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void xderiveEmployeeByUsernameList(String function, SubQuery<EmployeeCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<EmployeeCB>", subQuery); EmployeeCB cb = new EmployeeCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_EmployeeByUsernameList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USERNAME", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_EmployeeByUsernameList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USERNAME", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_EmployeeByUsernameList( + public abstract String keepUserId_DerivedReferrer_EmployeeByUsernameList( EmployeeCQ subQuery); public void xderiveEmployeeByManagerList(String function, SubQuery<EmployeeCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<EmployeeCB>", subQuery); EmployeeCB cb = new EmployeeCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_EmployeeByManagerList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "MANAGER", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_EmployeeByManagerList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "MANAGER", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_EmployeeByManagerList( + public abstract String keepUserId_DerivedReferrer_EmployeeByManagerList( EmployeeCQ subQuery); public void xderiveGroupMappingList(String function, SubQuery<GroupMappingCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); GroupMappingCB cb = new GroupMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_GroupMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + public abstract String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery); public void xderiveRoleMappingList(String function, SubQuery<RoleMappingCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); RoleMappingCB cb = new RoleMappingCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_RoleMappingList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "USER_ID", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + public abstract String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUserId_IsNull() { regUserId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUserId_IsNotNull() { regUserId(CK_ISNN, DUMMY_OBJECT); @@ -667,7 +536,7 @@ abstract protected ConditionValue getCValueUserId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenName The value of givenName as equal. */ @@ -676,7 +545,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -685,7 +554,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -694,7 +563,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -703,7 +572,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -712,7 +581,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -721,7 +590,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -730,20 +599,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenName The value of givenName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenName_LikeSearch( - String givenName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -754,38 +609,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenName The collection of givenName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameList The collection of givenName as notInScope. */ - public void setGivenName_InScope( + public void setGivenName_NotInScope(Collection<String> givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenName The value of givenName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenName_LikeSearch( String givenName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameList The collection of givenName as notInScope. + * @param givenName The value of givenName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenName_NotInScope(Collection<String> givenNameList) { - regGivenName(CK_NINS, cTL(givenNameList)); + public void setGivenName_NotLikeSearch( + String givenName, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenName), getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenName_IsNull() { regGivenName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenName_IsNotNull() { regGivenName(CK_ISNN, DUMMY_OBJECT); @@ -804,7 +673,7 @@ abstract protected ConditionValue getCValueGivenName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyName The value of familyName as equal. */ @@ -813,7 +682,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -822,7 +691,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -831,7 +700,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -840,7 +709,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -849,7 +718,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -858,7 +727,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -867,20 +736,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyName The value of familyName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyName_LikeSearch( - String familyName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -891,38 +746,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyName The collection of familyName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameList The collection of familyName as notInScope. */ - public void setFamilyName_InScope( + public void setFamilyName_NotInScope(Collection<String> familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyName The value of familyName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyName_LikeSearch( String familyName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameList The collection of familyName as notInScope. + * @param familyName The value of familyName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyName_NotInScope(Collection<String> familyNameList) { - regFamilyName(CK_NINS, cTL(familyNameList)); + public void setFamilyName_NotLikeSearch( + String familyName, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyName), getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyName_IsNull() { regFamilyName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyName_IsNotNull() { regFamilyName(CK_ISNN, DUMMY_OBJECT); @@ -941,7 +810,7 @@ abstract protected ConditionValue getCValueFamilyName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(50)} * * @param middleName The value of middleName as equal. */ @@ -950,7 +819,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -959,7 +828,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -968,7 +837,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -977,7 +846,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -986,7 +855,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -995,7 +864,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1004,20 +873,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param middleName The value of middleName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMiddleName_LikeSearch( - String middleName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1028,38 +883,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param middleName The collection of middleName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param middleNameList The collection of middleName as notInScope. */ - public void setMiddleName_InScope( + public void setMiddleName_NotInScope(Collection<String> middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param middleName The value of middleName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMiddleName_LikeSearch( String middleName, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param middleNameList The collection of middleName as notInScope. + * @param middleName The value of middleName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMiddleName_NotInScope(Collection<String> middleNameList) { - regMiddleName(CK_NINS, cTL(middleNameList)); + public void setMiddleName_NotLikeSearch( + String middleName, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(middleName), getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMiddleName_IsNull() { regMiddleName(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMiddleName_IsNotNull() { regMiddleName(CK_ISNN, DUMMY_OBJECT); @@ -1078,7 +947,7 @@ abstract protected ConditionValue getCValueMiddleName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param givenNameDesc The value of givenNameDesc as equal. */ @@ -1087,7 +956,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1096,7 +965,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1105,7 +974,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1114,7 +983,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1123,7 +992,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1132,7 +1001,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1141,21 +1010,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param givenNameDesc The value of givenNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGivenNameDesc_LikeSearch( - String givenNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1166,39 +1020,54 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param givenNameDesc The collection of givenNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param givenNameDescList The collection of givenNameDesc as notInScope. */ - public void setGivenNameDesc_InScope( + public void setGivenNameDesc_NotInScope(Collection<String> givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param givenNameDesc The value of givenNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGivenNameDesc_LikeSearch( String givenNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param givenNameDescList The collection of givenNameDesc as notInScope. + * @param givenNameDesc The value of givenNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGivenNameDesc_NotInScope(Collection<String> givenNameDescList) { - regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + public void setGivenNameDesc_NotLikeSearch( + String givenNameDesc, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(givenNameDesc), getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNull() { regGivenNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGivenNameDesc_IsNotNull() { regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1217,7 +1086,7 @@ abstract protected ConditionValue getCValueGivenNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param familyNameDesc The value of familyNameDesc as equal. */ @@ -1226,7 +1095,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1235,7 +1104,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1244,7 +1113,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1253,7 +1122,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1262,7 +1131,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1271,7 +1140,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1280,21 +1149,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param familyNameDesc The value of familyNameDesc as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setFamilyNameDesc_LikeSearch( - String familyNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1305,40 +1159,55 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param familyNameDesc The collection of familyNameDesc as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param familyNameDescList The collection of familyNameDesc as notInScope. */ - public void setFamilyNameDesc_InScope( + public void setFamilyNameDesc_NotInScope( + Collection<String> familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param familyNameDesc The value of familyNameDesc as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setFamilyNameDesc_LikeSearch( String familyNameDesc, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param familyNameDescList The collection of familyNameDesc as notInScope. + * @param familyNameDesc The value of familyNameDesc as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setFamilyNameDesc_NotInScope( - Collection<String> familyNameDescList) { - regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + public void setFamilyNameDesc_NotLikeSearch( + String familyNameDesc, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(familyNameDesc), getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNull() { regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setFamilyNameDesc_IsNotNull() { regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); @@ -1357,7 +1226,7 @@ abstract protected ConditionValue getCValueFamilyNameDesc(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param nickname The value of nickname as equal. */ @@ -1366,7 +1235,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1375,7 +1244,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1384,7 +1253,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1393,7 +1262,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1402,7 +1271,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1411,7 +1280,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1420,20 +1289,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param nickname The value of nickname as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setNickname_LikeSearch( - String nickname, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1444,38 +1299,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param nickname The collection of nickname as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nicknameList The collection of nickname as notInScope. */ - public void setNickname_InScope( + public void setNickname_NotInScope(Collection<String> nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param nickname The value of nickname as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setNickname_LikeSearch( String nickname, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nicknameList The collection of nickname as notInScope. + * @param nickname The value of nickname as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setNickname_NotInScope(Collection<String> nicknameList) { - regNickname(CK_NINS, cTL(nicknameList)); + public void setNickname_NotLikeSearch( + String nickname, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(nickname), getCValueNickname(), "NICKNAME", + "Nickname", "nickname", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setNickname_IsNull() { regNickname(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setNickname_IsNotNull() { regNickname(CK_ISNN, DUMMY_OBJECT); @@ -1494,7 +1363,7 @@ abstract protected ConditionValue getCValueNickname(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * * @param gender The value of gender as equal. */ @@ -1503,7 +1372,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1512,7 +1381,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1521,7 +1390,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1530,7 +1399,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1539,7 +1408,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1548,7 +1417,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1557,20 +1426,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param gender The value of gender as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGender_LikeSearch( - String gender, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1581,38 +1436,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param gender The collection of gender as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param genderList The collection of gender as notInScope. */ - public void setGender_InScope( + public void setGender_NotInScope(Collection<String> genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param gender The value of gender as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setGender_LikeSearch( String gender, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param genderList The collection of gender as notInScope. + * @param gender The value of gender as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGender_NotInScope(Collection<String> genderList) { - regGender(CK_NINS, cTL(genderList)); + public void setGender_NotLikeSearch( + String gender, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(gender), getCValueGender(), "GENDER", "Gender", + "gender", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGender_IsNull() { regGender(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGender_IsNotNull() { regGender(CK_ISNN, DUMMY_OBJECT); @@ -1631,7 +1500,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1640,7 +1509,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1649,7 +1518,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1658,7 +1527,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1667,7 +1536,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1676,7 +1545,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1686,7 +1555,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1702,7 +1571,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {DATE} + * OnlyOnceRegistered. {DATE} * * @param fromDate The from-date of birthDate. (Nullable) * @param toDate The to-date of birthDate. (Nullable) @@ -1716,14 +1585,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setBirthDate_IsNull() { regBirthDate(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setBirthDate_IsNotNull() { regBirthDate(CK_ISNN, DUMMY_OBJECT); @@ -1742,7 +1611,7 @@ abstract protected ConditionValue getCValueBirthDate(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param email The value of email as equal. */ @@ -1751,7 +1620,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1760,7 +1629,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1769,7 +1638,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1778,7 +1647,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1787,7 +1656,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1796,7 +1665,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1805,20 +1674,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param email The value of email as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setEmail_LikeSearch( - String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1829,38 +1684,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param email The collection of email as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param emailList The collection of email as notInScope. */ - public void setEmail_InScope( + public void setEmail_NotInScope(Collection<String> emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param email The value of email as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setEmail_LikeSearch( String email, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(email), getCValueEmail(), "EMAIL", "Email", "email", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param emailList The collection of email as notInScope. + * @param email The value of email as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setEmail_NotInScope(Collection<String> emailList) { - regEmail(CK_NINS, cTL(emailList)); + public void setEmail_NotLikeSearch( + String email, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(email), getCValueEmail(), "EMAIL", "Email", + "email", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEmail_IsNull() { regEmail(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEmail_IsNotNull() { regEmail(CK_ISNN, DUMMY_OBJECT); @@ -1878,7 +1747,7 @@ abstract protected ConditionValue getCValueEmail(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param url The value of url as equal. */ @@ -1887,7 +1756,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1896,7 +1765,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1905,7 +1774,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1914,7 +1783,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1923,7 +1792,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1932,7 +1801,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1941,20 +1810,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param url The value of url as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUrl_LikeSearch( - String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1965,38 +1820,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param url The collection of url as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param urlList The collection of url as notInScope. */ - public void setUrl_InScope( + public void setUrl_NotInScope(Collection<String> urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param url The value of url as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUrl_LikeSearch( String url, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param urlList The collection of url as notInScope. + * @param url The value of url as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUrl_NotInScope(Collection<String> urlList) { - regUrl(CK_NINS, cTL(urlList)); + public void setUrl_NotLikeSearch( + String url, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(url), getCValueUrl(), "URL", "Url", "url", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setUrl_IsNull() { regUrl(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setUrl_IsNotNull() { regUrl(CK_ISNN, DUMMY_OBJECT); @@ -2013,7 +1882,7 @@ abstract protected ConditionValue getCValueUrl(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param telephone The value of telephone as equal. */ @@ -2022,7 +1891,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2031,7 +1900,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2040,7 +1909,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2049,7 +1918,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2058,7 +1927,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2067,7 +1936,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2076,20 +1945,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param telephone The value of telephone as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTelephone_LikeSearch( - String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2100,38 +1955,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param telephone The collection of telephone as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param telephoneList The collection of telephone as notInScope. */ - public void setTelephone_InScope( + public void setTelephone_NotInScope(Collection<String> telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param telephone The value of telephone as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTelephone_LikeSearch( String telephone, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param telephoneList The collection of telephone as notInScope. + * @param telephone The value of telephone as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTelephone_NotInScope(Collection<String> telephoneList) { - regTelephone(CK_NINS, cTL(telephoneList)); + public void setTelephone_NotLikeSearch( + String telephone, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(telephone), getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setTelephone_IsNull() { regTelephone(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setTelephone_IsNotNull() { regTelephone(CK_ISNN, DUMMY_OBJECT); @@ -2150,7 +2019,7 @@ abstract protected ConditionValue getCValueTelephone(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(5)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(5)} * * @param locale The value of locale as equal. */ @@ -2159,7 +2028,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2168,7 +2037,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2177,7 +2046,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2186,7 +2055,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2195,7 +2064,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2204,7 +2073,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2213,20 +2082,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param locale The value of locale as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setLocale_LikeSearch( - String locale, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2237,38 +2092,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param locale The collection of locale as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param localeList The collection of locale as notInScope. */ - public void setLocale_InScope( + public void setLocale_NotInScope(Collection<String> localeList) { + regLocale(CK_NINS, cTL(localeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param locale The value of locale as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocale_LikeSearch( String locale, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param localeList The collection of locale as notInScope. + * @param locale The value of locale as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setLocale_NotInScope(Collection<String> localeList) { - regLocale(CK_NINS, cTL(localeList)); + public void setLocale_NotLikeSearch( + String locale, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(locale), getCValueLocale(), "LOCALE", "Locale", + "locale", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setLocale_IsNull() { regLocale(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setLocale_IsNotNull() { regLocale(CK_ISNN, DUMMY_OBJECT); @@ -2287,8 +2156,8 @@ abstract protected ConditionValue getCValueLocale(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * ROLE_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to ROLE_INFO} * * @param roleId The value of roleId as equal. */ @@ -2297,7 +2166,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2306,7 +2175,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2315,7 +2184,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2324,7 +2193,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2333,7 +2202,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2342,7 +2211,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2351,20 +2220,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param roleId The value of roleId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setRoleId_LikeSearch( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2375,42 +2230,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param roleId The collection of roleId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param roleIdList The collection of roleId as notInScope. */ - public void setRoleId_InScope( - String roleId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), - "ROLE_ID", "RoleId", "roleId", inScopeOption); + public void setRoleId_NotInScope(Collection<String> roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param roleIdList The collection of roleId as notInScope. + * @param roleId The value of roleId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setRoleId_NotInScope(Collection<String> roleIdList) { - regRoleId(CK_NINS, cTL(roleIdList)); + public void setRoleId_LikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } /** - * @param roleInfoCBquery Query. - * @deprecated Please use inScopeRoleInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param roleId The value of roleId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ roleInfoCBquery) { - String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(roleInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleInfoCBquery, "ROLE_ID", "ROLE_ID", - subQueryPropertyName); + public void setRoleId_NotLikeSearch( + String roleId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery<RoleInfoCB> subQuery) { @@ -2419,23 +2273,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", subQueryPropertyName); } - abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + public abstract String keepRoleId_InScopeSubQuery_RoleInfo( jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setRoleId_IsNull() { regRoleId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setRoleId_IsNotNull() { regRoleId(CK_ISNN, DUMMY_OBJECT); @@ -2454,8 +2308,8 @@ abstract protected ConditionValue getCValueRoleId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to - * GROUP_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255) : FK + * to GROUP_INFO} * * @param groupId The value of groupId as equal. */ @@ -2464,7 +2318,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2473,7 +2327,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2482,7 +2336,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2491,7 +2345,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2500,7 +2354,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2509,7 +2363,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2518,20 +2372,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param groupId The value of groupId as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setGroupId_LikeSearch( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2542,43 +2382,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param groupId The collection of groupId as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param groupIdList The collection of groupId as notInScope. */ - public void setGroupId_InScope( - String groupId, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), - "GROUP_ID", "GroupId", "groupId", inScopeOption); + public void setGroupId_NotInScope(Collection<String> groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param groupIdList The collection of groupId as notInScope. + * @param groupId The value of groupId as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setGroupId_NotInScope(Collection<String> groupIdList) { - regGroupId(CK_NINS, cTL(groupIdList)); + public void setGroupId_LikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(groupId), getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId", likeSearchOption); } /** - * @param groupInfoCBquery Query. - * @deprecated Please use inScopeGroupInfo(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param groupId The value of groupId as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setGroupId_InScopeSubQuery_GroupInfo( - GroupInfoCQ groupInfoCBquery) { - String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(groupInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupInfoCBquery, "GROUP_ID", "GROUP_ID", - subQueryPropertyName); + public void setGroupId_NotLikeSearch( + String groupId, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery<GroupInfoCB> subQuery) { @@ -2587,23 +2425,23 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", subQueryPropertyName); } - abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + public abstract String keepGroupId_InScopeSubQuery_GroupInfo( jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setGroupId_IsNull() { regGroupId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setGroupId_IsNotNull() { regGroupId(CK_ISNN, DUMMY_OBJECT); @@ -2622,8 +2460,145 @@ abstract protected ConditionValue getCValueGroupId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(1)} * + * @param status The value of status as equal. + */ + public void setStatus_Equal(String status) { + regStatus(CK_EQ, fRES(status)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as notEqual. + */ + public void setStatus_NotEqual(String status) { + regStatus(CK_NE, fRES(status)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterThan. + */ + public void setStatus_GreaterThan(String status) { + regStatus(CK_GT, fRES(status)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessThan. + */ + public void setStatus_LessThan(String status) { + regStatus(CK_LT, fRES(status)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as greaterEqual. + */ + public void setStatus_GreaterEqual(String status) { + regStatus(CK_GE, fRES(status)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as lessEqual. + */ + public void setStatus_LessEqual(String status) { + regStatus(CK_LE, fRES(status)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. + * + * @param status The value of status as prefixSearch. + */ + public void setStatus_PrefixSearch(String status) { + regStatus(CK_PS, fRES(status)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as inScope. + */ + public void setStatus_InScope(Collection<String> statusList) { + regStatus(CK_INS, cTL(statusList)); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param statusList The collection of status as notInScope. + */ + public void setStatus_NotInScope(Collection<String> statusList) { + regStatus(CK_NINS, cTL(statusList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setStatus_LikeSearch( + String status, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) + */ + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); + } + + /** + * IsNull(is null). And OnlyOnceRegistered. + */ + public void setStatus_IsNull() { + regStatus(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnlyOnceRegistered. + */ + public void setStatus_IsNotNull() { + regStatus(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStatus(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + protected void registerInlineStatus(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStatus(), "STATUS", "Status", + "status"); + } + + abstract protected ConditionValue getCValueStatus(); + + /** + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} + * * @param createdTime The value of createdTime as equal. */ public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { @@ -2631,7 +2606,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2640,7 +2615,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2649,7 +2624,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2658,7 +2633,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2667,7 +2642,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2677,7 +2652,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2695,7 +2670,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -2721,7 +2696,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -2731,7 +2706,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2740,7 +2715,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2749,7 +2724,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2758,7 +2733,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2767,7 +2742,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2776,7 +2751,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2785,20 +2760,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2809,27 +2770,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2845,7 +2820,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -2854,7 +2829,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2863,7 +2838,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2872,7 +2847,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2881,7 +2856,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2890,7 +2865,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2900,7 +2875,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2918,7 +2893,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -2944,7 +2919,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -2954,7 +2929,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2963,7 +2938,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2972,7 +2947,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2981,7 +2956,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2990,7 +2965,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2999,7 +2974,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3008,20 +2983,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3032,27 +2993,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3068,7 +3043,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3077,7 +3052,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3086,7 +3061,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3095,7 +3070,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3104,7 +3079,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3113,7 +3088,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3123,7 +3098,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3141,7 +3116,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -3155,14 +3130,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -3181,7 +3156,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -3190,7 +3165,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3199,7 +3174,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3208,7 +3183,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3217,7 +3192,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3226,7 +3201,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3235,7 +3210,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3244,20 +3219,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -3268,38 +3229,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection<String> deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -3318,7 +3293,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param versionno The value of versionno as equal. */ @@ -3327,7 +3302,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3336,7 +3311,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3345,7 +3320,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3354,7 +3329,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3363,7 +3338,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3403,6 +3378,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<UserInfoCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<UserInfoCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<UserInfoCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<UserInfoCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<UserInfoCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<UserInfoCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<UserInfoCB>(new SSQSetupper<UserInfoCB>() { + public void setup(String function, SubQuery<UserInfoCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<UserInfoCB> subQuery, String operand) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(UserInfoCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return UserInfoCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/AbstractBsWorkingTypeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsWorkingTypeCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * INTEGER} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -121,22 +121,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use inScopeMonthlyWorkingReportList(subQuery) method. - */ - public void setId_InScopeSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(monthlyWorkingReportCBquery, "ID", - "WORKING_TYPE_ID", subQueryPropertyName); - } - public void inScopeMonthlyWorkingReportList( SubQuery<MonthlyWorkingReportCB> subQuery) { assertObjectNotNull("subQuery<MonthlyWorkingReportCB>", subQuery); @@ -144,12 +128,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_InScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void notInScopeMonthlyWorkingReportList( @@ -159,31 +143,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotInScopeSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * @param monthlyWorkingReportCBquery Query. - * @deprecated Please use existsMonthlyWorkingReportList(subQuery) method. - */ - public void setId_ExistsSubQuery_MonthlyWorkingReportList( - MonthlyWorkingReportCQ monthlyWorkingReportCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(monthlyWorkingReportCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(monthlyWorkingReportCBquery, "ID", - "WORKING_TYPE_ID", subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select WORKING_TYPE_ID from * MONTHLY_WORKING_REPORT where ...)} * @@ -198,12 +166,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_ExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** @@ -221,38 +189,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "WORKING_TYPE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MonthlyWorkingReportList( + public abstract String keepId_NotExistsSubQuery_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); public void xderiveMonthlyWorkingReportList(String function, SubQuery<MonthlyWorkingReportCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<MonthlyWorkingReportCB>", subQuery); MonthlyWorkingReportCB cb = new MonthlyWorkingReportCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MonthlyWorkingReportList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "WORKING_TYPE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MonthlyWorkingReportList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "WORKING_TYPE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public abstract String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -269,7 +237,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param name The value of name as equal. @@ -279,7 +247,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -288,7 +256,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -297,7 +265,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -306,7 +274,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -315,7 +283,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -324,7 +292,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -333,20 +301,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param name The value of name as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setName_LikeSearch( - String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -357,27 +311,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param name The collection of name as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param nameList The collection of name as notInScope. */ - public void setName_InScope( + public void setName_NotInScope(Collection<String> nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param name The value of name as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setName_LikeSearch( String name, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param nameList The collection of name as notInScope. + * @param name The value of name as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setName_NotInScope(Collection<String> nameList) { - regName(CK_NINS, cTL(nameList)); + public void setName_NotLikeSearch( + String name, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -391,7 +359,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param value The value of value as equal. */ @@ -400,7 +368,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as notEqual. */ @@ -409,7 +377,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterThan. */ @@ -418,7 +386,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessThan. */ @@ -427,7 +395,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as greaterEqual. */ @@ -436,7 +404,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param value The value of value as lessEqual. */ @@ -476,7 +444,8 @@ abstract protected ConditionValue getCValueValue(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(10)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(10)} * * @param type The value of type as equal. */ @@ -485,7 +454,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -494,7 +463,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -503,7 +472,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -512,7 +481,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -521,7 +490,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -530,7 +499,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -539,20 +508,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param type The value of type as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setType_LikeSearch( - String type, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", - "Type", "type", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -563,27 +518,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param type The collection of type as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param typeList The collection of type as notInScope. */ - public void setType_InScope( + public void setType_NotInScope(Collection<String> typeList) { + regType(CK_NINS, cTL(typeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( String type, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param typeList The collection of type as notInScope. + * @param type The value of type as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setType_NotInScope(Collection<String> typeList) { - regType(CK_NINS, cTL(typeList)); + public void setType_NotLikeSearch( + String type, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -597,7 +566,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER : Default=[1]} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER : Default=[1]} * * @param parentId The value of parentId as equal. */ @@ -606,7 +575,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as notEqual. */ @@ -615,7 +584,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as greaterThan. */ @@ -624,7 +593,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as lessThan. */ @@ -633,7 +602,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as greaterEqual. */ @@ -642,7 +611,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param parentId The value of parentId as lessEqual. */ @@ -671,14 +640,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setParentId_IsNull() { regParentId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setParentId_IsNotNull() { regParentId(CK_ISNN, DUMMY_OBJECT); @@ -697,7 +666,7 @@ abstract protected ConditionValue getCValueParentId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -706,7 +675,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -715,7 +684,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -724,7 +693,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -733,7 +702,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -742,7 +711,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -752,7 +721,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -770,7 +739,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of createdTime. (Nullable) * @param toDate The to-date of createdTime. (Nullable) @@ -796,7 +765,7 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param createdBy The value of createdBy as equal. @@ -806,7 +775,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -815,7 +784,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -824,7 +793,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -833,7 +802,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -842,7 +811,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -851,7 +820,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -860,20 +829,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param createdBy The value of createdBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setCreatedBy_LikeSearch( - String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -884,27 +839,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param createdBy The collection of createdBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param createdByList The collection of createdBy as notInScope. */ - public void setCreatedBy_InScope( + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setCreatedBy_LikeSearch( String createdBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -920,7 +889,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param updatedTime The value of updatedTime as equal. */ @@ -929,7 +898,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -938,7 +907,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -947,7 +916,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -956,7 +925,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -965,7 +934,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -975,7 +944,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -993,7 +962,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {NotNull : TIMESTAMP} + * OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param fromDate The from-date of updatedTime. (Nullable) * @param toDate The to-date of updatedTime. (Nullable) @@ -1019,7 +988,7 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param updatedBy The value of updatedBy as equal. @@ -1029,7 +998,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1038,7 +1007,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1047,7 +1016,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1056,7 +1025,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1065,7 +1034,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1074,7 +1043,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1083,20 +1052,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param updatedBy The value of updatedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setUpdatedBy_LikeSearch( - String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1107,27 +1062,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param updatedBy The collection of updatedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param updatedByList The collection of updatedBy as notInScope. */ - public void setUpdatedBy_InScope( + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setUpdatedBy_LikeSearch( String updatedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1143,7 +1112,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1152,7 +1121,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1161,7 +1130,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1170,7 +1139,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1179,7 +1148,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1188,7 +1157,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1198,7 +1167,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1216,7 +1185,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of deletedTime. (Nullable) * @param toDate The to-date of deletedTime. (Nullable) @@ -1230,14 +1199,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNull() { regDeletedTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedTime_IsNotNull() { regDeletedTime(CK_ISNN, DUMMY_OBJECT); @@ -1256,7 +1225,7 @@ abstract protected ConditionValue getCValueDeletedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param deletedBy The value of deletedBy as equal. */ @@ -1265,7 +1234,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1274,7 +1243,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1283,7 +1252,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1292,7 +1261,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1301,7 +1270,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1310,7 +1279,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1319,20 +1288,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param deletedBy The value of deletedBy as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDeletedBy_LikeSearch( - String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1343,38 +1298,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param deletedBy The collection of deletedBy as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param deletedByList The collection of deletedBy as notInScope. */ - public void setDeletedBy_InScope( + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param deletedBy The value of deletedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDeletedBy_LikeSearch( String deletedBy, - jp.sf.pal.timecard.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param deletedByList The collection of deletedBy as notInScope. + * @param deletedBy The value of deletedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDeletedBy_NotInScope(Collection<String> deletedByList) { - regDeletedBy(CK_NINS, cTL(deletedByList)); + public void setDeletedBy_NotLikeSearch( + String deletedBy, + jp.sf.pal.timecard.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(deletedBy), getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNull() { regDeletedBy(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setDeletedBy_IsNotNull() { regDeletedBy(CK_ISNN, DUMMY_OBJECT); @@ -1393,7 +1362,7 @@ abstract protected ConditionValue getCValueDeletedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -1403,7 +1372,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1412,7 +1381,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1421,7 +1390,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1430,7 +1399,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1439,7 +1408,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1479,6 +1448,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<WorkingTypeCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<WorkingTypeCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<WorkingTypeCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<WorkingTypeCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<WorkingTypeCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<WorkingTypeCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<WorkingTypeCB>(new SSQSetupper<WorkingTypeCB>() { + public void setup(String function, SubQuery<WorkingTypeCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<WorkingTypeCB> subQuery, String operand) { + assertObjectNotNull("subQuery<WorkingTypeCB>", subQuery); + WorkingTypeCB cb = new WorkingTypeCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(WorkingTypeCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return WorkingTypeCB.class.getName(); Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsDailyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.ciq.DailyReportCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsDailyReportCQ extends AbstractBsDailyReportCQ { //========================================================================== @@ -60,7 +60,7 @@ public DailyReportCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } DailyReportCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -536,7 +536,6 @@ // ========= // Foreign Query // ============= - public MonthlyReportCQ queryMonthlyReport() { return getConditionQueryMonthlyReport(); } @@ -545,20 +544,13 @@ public MonthlyReportCQ getConditionQueryMonthlyReport() { if (_conditionQueryMonthlyReport == null) { - _conditionQueryMonthlyReport = createQueryMonthlyReport(); - setupOuterJoin_MonthlyReport(); + _conditionQueryMonthlyReport = xcreateQueryMonthlyReport(); + xsetupOuterJoinMonthlyReport(); } return _conditionQueryMonthlyReport; } - protected void setupOuterJoin_MonthlyReport() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), - getConditionQueryMonthlyReport().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMonthlyReport(), joinOnMap); - } - - protected MonthlyReportCQ createQueryMonthlyReport() { + protected MonthlyReportCQ xcreateQueryMonthlyReport() { String nrp = resolveNextRelationPath("DAILY_REPORT", "monthlyReport"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MonthlyReportCQ cq = new MonthlyReportCQ(this, getSqlClause(), jan, @@ -568,10 +560,42 @@ return cq; } + protected void xsetupOuterJoinMonthlyReport() { + MonthlyReportCQ cq = getConditionQueryMonthlyReport(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMonthlyReport() { return _conditionQueryMonthlyReport != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, DailyReportCQ> _scalarSubQueryMap; + + public Map<String, DailyReportCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(DailyReportCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return DailyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return DailyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsEmployeeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsEmployeeCQ extends AbstractBsEmployeeCQ { //========================================================================== @@ -61,7 +61,7 @@ public EmployeeCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } EmployeeCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -154,21 +154,21 @@ return "id_NotExistsSubQuery_MonthlyReportList." + key; } - protected Map<String, MonthlyReportCQ> _id_DeriveSubQuery_MonthlyReportListMap; + protected Map<String, MonthlyReportCQ> _id_DerivedReferrer_MonthlyReportListMap; - public Map<String, MonthlyReportCQ> getId_DeriveSubQuery_MonthlyReportList() { - return _id_DeriveSubQuery_MonthlyReportListMap; + public Map<String, MonthlyReportCQ> getId_DerivedReferrer_MonthlyReportList() { + return _id_DerivedReferrer_MonthlyReportListMap; } - public String keepId_DeriveSubQuery_MonthlyReportList( + public String keepId_DerivedReferrer_MonthlyReportList( MonthlyReportCQ subQuery) { - if (_id_DeriveSubQuery_MonthlyReportListMap == null) { - _id_DeriveSubQuery_MonthlyReportListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MonthlyReportListMap == null) { + _id_DerivedReferrer_MonthlyReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MonthlyReportListMap.size() + 1); - _id_DeriveSubQuery_MonthlyReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_MonthlyReportList." + key; + + (_id_DerivedReferrer_MonthlyReportListMap.size() + 1); + _id_DerivedReferrer_MonthlyReportListMap.put(key, subQuery); + return "id_DerivedReferrer_MonthlyReportList." + key; } public BsEmployeeCQ addOrderBy_Id_Asc() { @@ -483,7 +483,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfoByUsername() { return getConditionQueryUserInfoByUsername(); } @@ -492,21 +491,13 @@ public UserInfoCQ getConditionQueryUserInfoByUsername() { if (_conditionQueryUserInfoByUsername == null) { - _conditionQueryUserInfoByUsername = createQueryUserInfoByUsername(); - setupOuterJoin_UserInfoByUsername(); + _conditionQueryUserInfoByUsername = xcreateQueryUserInfoByUsername(); + xsetupOuterJoinUserInfoByUsername(); } return _conditionQueryUserInfoByUsername; } - protected void setupOuterJoin_UserInfoByUsername() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USERNAME"), - getConditionQueryUserInfoByUsername().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUsername(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUsername() { + protected UserInfoCQ xcreateQueryUserInfoByUsername() { String nrp = resolveNextRelationPath("EMPLOYEE", "userInfoByUsername"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -516,6 +507,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUsername() { + UserInfoCQ cq = getConditionQueryUserInfoByUsername(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USERNAME"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUsername() { return _conditionQueryUserInfoByUsername != null; } @@ -528,21 +527,13 @@ public UserInfoCQ getConditionQueryUserInfoByManager() { if (_conditionQueryUserInfoByManager == null) { - _conditionQueryUserInfoByManager = createQueryUserInfoByManager(); - setupOuterJoin_UserInfoByManager(); + _conditionQueryUserInfoByManager = xcreateQueryUserInfoByManager(); + xsetupOuterJoinUserInfoByManager(); } return _conditionQueryUserInfoByManager; } - protected void setupOuterJoin_UserInfoByManager() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MANAGER"), - getConditionQueryUserInfoByManager().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByManager(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByManager() { + protected UserInfoCQ xcreateQueryUserInfoByManager() { String nrp = resolveNextRelationPath("EMPLOYEE", "userInfoByManager"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -552,10 +543,42 @@ return cq; } + protected void xsetupOuterJoinUserInfoByManager() { + UserInfoCQ cq = getConditionQueryUserInfoByManager(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MANAGER"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByManager() { return _conditionQueryUserInfoByManager != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, EmployeeCQ> _scalarSubQueryMap; + + public Map<String, EmployeeCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(EmployeeCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EmployeeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EmployeeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupInfoCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -219,37 +219,37 @@ return "groupId_NotExistsSubQuery_UserInfoList." + key; } - protected Map<String, GroupMappingCQ> _groupId_DeriveSubQuery_GroupMappingListMap; + protected Map<String, GroupMappingCQ> _groupId_DerivedReferrer_GroupMappingListMap; - public Map<String, GroupMappingCQ> getGroupId_DeriveSubQuery_GroupMappingList() { - return _groupId_DeriveSubQuery_GroupMappingListMap; + public Map<String, GroupMappingCQ> getGroupId_DerivedReferrer_GroupMappingList() { + return _groupId_DerivedReferrer_GroupMappingListMap; } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { - _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_groupId_DerivedReferrer_GroupMappingListMap == null) { + _groupId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_GroupMappingList." + key; + + (_groupId_DerivedReferrer_GroupMappingListMap.size() + 1); + _groupId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "groupId_DerivedReferrer_GroupMappingList." + key; } - protected Map<String, UserInfoCQ> _groupId_DeriveSubQuery_UserInfoListMap; + protected Map<String, UserInfoCQ> _groupId_DerivedReferrer_UserInfoListMap; - public Map<String, UserInfoCQ> getGroupId_DeriveSubQuery_UserInfoList() { - return _groupId_DeriveSubQuery_UserInfoListMap; + public Map<String, UserInfoCQ> getGroupId_DerivedReferrer_UserInfoList() { + return _groupId_DerivedReferrer_UserInfoListMap; } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_groupId_DeriveSubQuery_UserInfoListMap == null) { - _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DerivedReferrer_UserInfoListMap == null) { + _groupId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); - _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "groupId_DeriveSubQuery_UserInfoList." + key; + + (_groupId_DerivedReferrer_UserInfoListMap.size() + 1); + _groupId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "groupId_DerivedReferrer_UserInfoList." + key; } public BsGroupInfoCQ addOrderBy_GroupId_Asc() { @@ -564,7 +564,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, GroupInfoCQ> _scalarSubQueryMap; + public Map<String, GroupInfoCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupMappingCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public GroupMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } GroupMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -219,20 +218,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, GroupMappingCQ> _scalarSubQueryMap; + + public Map<String, GroupMappingCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMonthlyReportCQ extends AbstractBsMonthlyReportCQ { //========================================================================== @@ -62,7 +62,7 @@ public MonthlyReportCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MonthlyReportCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -221,37 +221,37 @@ return "id_NotExistsSubQuery_MonthlyWorkingReportList." + key; } - protected Map<String, DailyReportCQ> _id_DeriveSubQuery_DailyReportListMap; + protected Map<String, DailyReportCQ> _id_DerivedReferrer_DailyReportListMap; - public Map<String, DailyReportCQ> getId_DeriveSubQuery_DailyReportList() { - return _id_DeriveSubQuery_DailyReportListMap; + public Map<String, DailyReportCQ> getId_DerivedReferrer_DailyReportList() { + return _id_DerivedReferrer_DailyReportListMap; } - public String keepId_DeriveSubQuery_DailyReportList(DailyReportCQ subQuery) { - if (_id_DeriveSubQuery_DailyReportListMap == null) { - _id_DeriveSubQuery_DailyReportListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_DailyReportList(DailyReportCQ subQuery) { + if (_id_DerivedReferrer_DailyReportListMap == null) { + _id_DerivedReferrer_DailyReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_DailyReportListMap.size() + 1); - _id_DeriveSubQuery_DailyReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_DailyReportList." + key; + + (_id_DerivedReferrer_DailyReportListMap.size() + 1); + _id_DerivedReferrer_DailyReportListMap.put(key, subQuery); + return "id_DerivedReferrer_DailyReportList." + key; } - protected Map<String, MonthlyWorkingReportCQ> _id_DeriveSubQuery_MonthlyWorkingReportListMap; + protected Map<String, MonthlyWorkingReportCQ> _id_DerivedReferrer_MonthlyWorkingReportListMap; - public Map<String, MonthlyWorkingReportCQ> getId_DeriveSubQuery_MonthlyWorkingReportList() { - return _id_DeriveSubQuery_MonthlyWorkingReportListMap; + public Map<String, MonthlyWorkingReportCQ> getId_DerivedReferrer_MonthlyWorkingReportList() { + return _id_DerivedReferrer_MonthlyWorkingReportListMap; } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { - if (_id_DeriveSubQuery_MonthlyWorkingReportListMap == null) { - _id_DeriveSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MonthlyWorkingReportListMap == null) { + _id_DerivedReferrer_MonthlyWorkingReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MonthlyWorkingReportListMap.size() + 1); - _id_DeriveSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_MonthlyWorkingReportList." + key; + + (_id_DerivedReferrer_MonthlyWorkingReportListMap.size() + 1); + _id_DerivedReferrer_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_DerivedReferrer_MonthlyWorkingReportList." + key; } public BsMonthlyReportCQ addOrderBy_Id_Asc() { @@ -680,7 +680,6 @@ // ========= // Foreign Query // ============= - public EmployeeCQ queryEmployee() { return getConditionQueryEmployee(); } @@ -689,20 +688,13 @@ public EmployeeCQ getConditionQueryEmployee() { if (_conditionQueryEmployee == null) { - _conditionQueryEmployee = createQueryEmployee(); - setupOuterJoin_Employee(); + _conditionQueryEmployee = xcreateQueryEmployee(); + xsetupOuterJoinEmployee(); } return _conditionQueryEmployee; } - protected void setupOuterJoin_Employee() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("EMPLOYEE_ID"), - getConditionQueryEmployee().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryEmployee(), joinOnMap); - } - - protected EmployeeCQ createQueryEmployee() { + protected EmployeeCQ xcreateQueryEmployee() { String nrp = resolveNextRelationPath("MONTHLY_REPORT", "employee"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); EmployeeCQ cq = new EmployeeCQ(this, getSqlClause(), jan, @@ -712,10 +704,42 @@ return cq; } + protected void xsetupOuterJoinEmployee() { + EmployeeCQ cq = getConditionQueryEmployee(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("EMPLOYEE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryEmployee() { return _conditionQueryEmployee != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, MonthlyReportCQ> _scalarSubQueryMap; + + public Map<String, MonthlyReportCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MonthlyReportCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsMonthlyWorkingReportCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMonthlyWorkingReportCQ extends AbstractBsMonthlyWorkingReportCQ { //========================================================================== @@ -61,7 +61,7 @@ public MonthlyWorkingReportCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MonthlyWorkingReportCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -239,7 +239,6 @@ // ========= // Foreign Query // ============= - public MonthlyReportCQ queryMonthlyReport() { return getConditionQueryMonthlyReport(); } @@ -248,20 +247,13 @@ public MonthlyReportCQ getConditionQueryMonthlyReport() { if (_conditionQueryMonthlyReport == null) { - _conditionQueryMonthlyReport = createQueryMonthlyReport(); - setupOuterJoin_MonthlyReport(); + _conditionQueryMonthlyReport = xcreateQueryMonthlyReport(); + xsetupOuterJoinMonthlyReport(); } return _conditionQueryMonthlyReport; } - protected void setupOuterJoin_MonthlyReport() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), - getConditionQueryMonthlyReport().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMonthlyReport(), joinOnMap); - } - - protected MonthlyReportCQ createQueryMonthlyReport() { + protected MonthlyReportCQ xcreateQueryMonthlyReport() { String nrp = resolveNextRelationPath("MONTHLY_WORKING_REPORT", "monthlyReport"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -272,6 +264,14 @@ return cq; } + protected void xsetupOuterJoinMonthlyReport() { + MonthlyReportCQ cq = getConditionQueryMonthlyReport(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MONTHLY_REPORT_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMonthlyReport() { return _conditionQueryMonthlyReport != null; } @@ -284,20 +284,13 @@ public WorkingTypeCQ getConditionQueryWorkingType() { if (_conditionQueryWorkingType == null) { - _conditionQueryWorkingType = createQueryWorkingType(); - setupOuterJoin_WorkingType(); + _conditionQueryWorkingType = xcreateQueryWorkingType(); + xsetupOuterJoinWorkingType(); } return _conditionQueryWorkingType; } - protected void setupOuterJoin_WorkingType() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("WORKING_TYPE_ID"), - getConditionQueryWorkingType().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryWorkingType(), joinOnMap); - } - - protected WorkingTypeCQ createQueryWorkingType() { + protected WorkingTypeCQ xcreateQueryWorkingType() { String nrp = resolveNextRelationPath("MONTHLY_WORKING_REPORT", "workingType"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -308,10 +301,42 @@ return cq; } + protected void xsetupOuterJoinWorkingType() { + WorkingTypeCQ cq = getConditionQueryWorkingType(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("WORKING_TYPE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryWorkingType() { return _conditionQueryWorkingType != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, MonthlyWorkingReportCQ> _scalarSubQueryMap; + + public Map<String, MonthlyWorkingReportCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MonthlyWorkingReportCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyWorkingReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyWorkingReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleInfoCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "roleId_NotExistsSubQuery_UserInfoList." + key; } - protected Map<String, RoleMappingCQ> _roleId_DeriveSubQuery_RoleMappingListMap; + protected Map<String, RoleMappingCQ> _roleId_DerivedReferrer_RoleMappingListMap; - public Map<String, RoleMappingCQ> getRoleId_DeriveSubQuery_RoleMappingList() { - return _roleId_DeriveSubQuery_RoleMappingListMap; + public Map<String, RoleMappingCQ> getRoleId_DerivedReferrer_RoleMappingList() { + return _roleId_DerivedReferrer_RoleMappingListMap; } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { - _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_roleId_DerivedReferrer_RoleMappingListMap == null) { + _roleId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_RoleMappingList." + key; + + (_roleId_DerivedReferrer_RoleMappingListMap.size() + 1); + _roleId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "roleId_DerivedReferrer_RoleMappingList." + key; } - protected Map<String, UserInfoCQ> _roleId_DeriveSubQuery_UserInfoListMap; + protected Map<String, UserInfoCQ> _roleId_DerivedReferrer_UserInfoListMap; - public Map<String, UserInfoCQ> getRoleId_DeriveSubQuery_UserInfoList() { - return _roleId_DeriveSubQuery_UserInfoListMap; + public Map<String, UserInfoCQ> getRoleId_DerivedReferrer_UserInfoList() { + return _roleId_DerivedReferrer_UserInfoListMap; } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { - if (_roleId_DeriveSubQuery_UserInfoListMap == null) { - _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DerivedReferrer_UserInfoListMap == null) { + _roleId_DerivedReferrer_UserInfoListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); - _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); - return "roleId_DeriveSubQuery_UserInfoList." + key; + + (_roleId_DerivedReferrer_UserInfoListMap.size() + 1); + _roleId_DerivedReferrer_UserInfoListMap.put(key, subQuery); + return "roleId_DerivedReferrer_UserInfoList." + key; } public BsRoleInfoCQ addOrderBy_RoleId_Asc() { @@ -563,7 +563,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, RoleInfoCQ> _scalarSubQueryMap; + public Map<String, RoleInfoCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -61,7 +61,7 @@ public RoleMappingCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } RoleMappingCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -210,7 +210,6 @@ // ========= // Foreign Query // ============= - public RoleInfoCQ queryRoleInfo() { return getConditionQueryRoleInfo(); } @@ -219,20 +218,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -242,6 +234,14 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } @@ -254,20 +254,13 @@ public UserInfoCQ getConditionQueryUserInfo() { if (_conditionQueryUserInfo == null) { - _conditionQueryUserInfo = createQueryUserInfo(); - setupOuterJoin_UserInfo(); + _conditionQueryUserInfo = xcreateQueryUserInfo(); + xsetupOuterJoinUserInfo(); } return _conditionQueryUserInfo; } - protected void setupOuterJoin_UserInfo() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("USER_ID"), getConditionQueryUserInfo() - .getRealColumnName("USER_ID")); - registerOuterJoin(getConditionQueryUserInfo(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfo() { + protected UserInfoCQ xcreateQueryUserInfo() { String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -277,10 +270,42 @@ return cq; } + protected void xsetupOuterJoinUserInfo() { + UserInfoCQ cq = getConditionQueryUserInfo(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("USER_ID"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfo() { return _conditionQueryUserInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, RoleMappingCQ> _scalarSubQueryMap; + + public Map<String, RoleMappingCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -64,7 +64,7 @@ public UserInfoCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } UserInfoCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -361,72 +361,72 @@ return "userId_NotExistsSubQuery_RoleMappingList." + key; } - protected Map<String, EmployeeCQ> _userId_DeriveSubQuery_EmployeeByUsernameListMap; + protected Map<String, EmployeeCQ> _userId_DerivedReferrer_EmployeeByUsernameListMap; - public Map<String, EmployeeCQ> getUserId_DeriveSubQuery_EmployeeByUsernameList() { - return _userId_DeriveSubQuery_EmployeeByUsernameListMap; + public Map<String, EmployeeCQ> getUserId_DerivedReferrer_EmployeeByUsernameList() { + return _userId_DerivedReferrer_EmployeeByUsernameListMap; } - public String keepUserId_DeriveSubQuery_EmployeeByUsernameList( + public String keepUserId_DerivedReferrer_EmployeeByUsernameList( EmployeeCQ subQuery) { - if (_userId_DeriveSubQuery_EmployeeByUsernameListMap == null) { - _userId_DeriveSubQuery_EmployeeByUsernameListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_EmployeeByUsernameListMap == null) { + _userId_DerivedReferrer_EmployeeByUsernameListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_EmployeeByUsernameListMap.size() + 1); - _userId_DeriveSubQuery_EmployeeByUsernameListMap.put(key, subQuery); - return "userId_DeriveSubQuery_EmployeeByUsernameList." + key; + + (_userId_DerivedReferrer_EmployeeByUsernameListMap.size() + 1); + _userId_DerivedReferrer_EmployeeByUsernameListMap.put(key, subQuery); + return "userId_DerivedReferrer_EmployeeByUsernameList." + key; } - protected Map<String, EmployeeCQ> _userId_DeriveSubQuery_EmployeeByManagerListMap; + protected Map<String, EmployeeCQ> _userId_DerivedReferrer_EmployeeByManagerListMap; - public Map<String, EmployeeCQ> getUserId_DeriveSubQuery_EmployeeByManagerList() { - return _userId_DeriveSubQuery_EmployeeByManagerListMap; + public Map<String, EmployeeCQ> getUserId_DerivedReferrer_EmployeeByManagerList() { + return _userId_DerivedReferrer_EmployeeByManagerListMap; } - public String keepUserId_DeriveSubQuery_EmployeeByManagerList( + public String keepUserId_DerivedReferrer_EmployeeByManagerList( EmployeeCQ subQuery) { - if (_userId_DeriveSubQuery_EmployeeByManagerListMap == null) { - _userId_DeriveSubQuery_EmployeeByManagerListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_EmployeeByManagerListMap == null) { + _userId_DerivedReferrer_EmployeeByManagerListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_EmployeeByManagerListMap.size() + 1); - _userId_DeriveSubQuery_EmployeeByManagerListMap.put(key, subQuery); - return "userId_DeriveSubQuery_EmployeeByManagerList." + key; + + (_userId_DerivedReferrer_EmployeeByManagerListMap.size() + 1); + _userId_DerivedReferrer_EmployeeByManagerListMap.put(key, subQuery); + return "userId_DerivedReferrer_EmployeeByManagerList." + key; } - protected Map<String, GroupMappingCQ> _userId_DeriveSubQuery_GroupMappingListMap; + protected Map<String, GroupMappingCQ> _userId_DerivedReferrer_GroupMappingListMap; - public Map<String, GroupMappingCQ> getUserId_DeriveSubQuery_GroupMappingList() { - return _userId_DeriveSubQuery_GroupMappingListMap; + public Map<String, GroupMappingCQ> getUserId_DerivedReferrer_GroupMappingList() { + return _userId_DerivedReferrer_GroupMappingListMap; } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { - if (_userId_DeriveSubQuery_GroupMappingListMap == null) { - _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_GroupMappingListMap == null) { + _userId_DerivedReferrer_GroupMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); - _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_GroupMappingList." + key; + + (_userId_DerivedReferrer_GroupMappingListMap.size() + 1); + _userId_DerivedReferrer_GroupMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_GroupMappingList." + key; } - protected Map<String, RoleMappingCQ> _userId_DeriveSubQuery_RoleMappingListMap; + protected Map<String, RoleMappingCQ> _userId_DerivedReferrer_RoleMappingListMap; - public Map<String, RoleMappingCQ> getUserId_DeriveSubQuery_RoleMappingList() { - return _userId_DeriveSubQuery_RoleMappingListMap; + public Map<String, RoleMappingCQ> getUserId_DerivedReferrer_RoleMappingList() { + return _userId_DerivedReferrer_RoleMappingListMap; } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { - if (_userId_DeriveSubQuery_RoleMappingListMap == null) { - _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_RoleMappingListMap == null) { + _userId_DerivedReferrer_RoleMappingListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); - _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); - return "userId_DeriveSubQuery_RoleMappingList." + key; + + (_userId_DerivedReferrer_RoleMappingListMap.size() + 1); + _userId_DerivedReferrer_RoleMappingListMap.put(key, subQuery); + return "userId_DerivedReferrer_RoleMappingList." + key; } public BsUserInfoCQ addOrderBy_UserId_Asc() { @@ -793,6 +793,29 @@ return this; } + protected ConditionValue _status; + + public ConditionValue getStatus() { + if (_status == null) { + _status = new ConditionValue(); + } + return _status; + } + + protected ConditionValue getCValueStatus() { + return getStatus(); + } + + public BsUserInfoCQ addOrderBy_Status_Asc() { + regOBA("STATUS"); + return this; + } + + public BsUserInfoCQ addOrderBy_Status_Desc() { + regOBD("STATUS"); + return this; + } + protected ConditionValue _createdTime; public ConditionValue getCreatedTime() { @@ -990,7 +1013,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -999,20 +1021,13 @@ public GroupInfoCQ getConditionQueryGroupInfo() { if (_conditionQueryGroupInfo == null) { - _conditionQueryGroupInfo = createQueryGroupInfo(); - setupOuterJoin_GroupInfo(); + _conditionQueryGroupInfo = xcreateQueryGroupInfo(); + xsetupOuterJoinGroupInfo(); } return _conditionQueryGroupInfo; } - protected void setupOuterJoin_GroupInfo() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("GROUP_ID"), - getConditionQueryGroupInfo().getRealColumnName("GROUP_ID")); - registerOuterJoin(getConditionQueryGroupInfo(), joinOnMap); - } - - protected GroupInfoCQ createQueryGroupInfo() { + protected GroupInfoCQ xcreateQueryGroupInfo() { String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, @@ -1022,6 +1037,14 @@ return cq; } + protected void xsetupOuterJoinGroupInfo() { + GroupInfoCQ cq = getConditionQueryGroupInfo(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("GROUP_ID"), cq + .getRealColumnName("GROUP_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryGroupInfo() { return _conditionQueryGroupInfo != null; } @@ -1034,20 +1057,13 @@ public RoleInfoCQ getConditionQueryRoleInfo() { if (_conditionQueryRoleInfo == null) { - _conditionQueryRoleInfo = createQueryRoleInfo(); - setupOuterJoin_RoleInfo(); + _conditionQueryRoleInfo = xcreateQueryRoleInfo(); + xsetupOuterJoinRoleInfo(); } return _conditionQueryRoleInfo; } - protected void setupOuterJoin_RoleInfo() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ROLE_ID"), getConditionQueryRoleInfo() - .getRealColumnName("ROLE_ID")); - registerOuterJoin(getConditionQueryRoleInfo(), joinOnMap); - } - - protected RoleInfoCQ createQueryRoleInfo() { + protected RoleInfoCQ xcreateQueryRoleInfo() { String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, @@ -1057,10 +1073,42 @@ return cq; } + protected void xsetupOuterJoinRoleInfo() { + RoleInfoCQ cq = getConditionQueryRoleInfo(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ROLE_ID"), cq + .getRealColumnName("ROLE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryRoleInfo() { return _conditionQueryRoleInfo != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, UserInfoCQ> _scalarSubQueryMap; + + public Map<String, UserInfoCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(UserInfoCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/bs/BsWorkingTypeCQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; import jp.sf.pal.timecard.db.cbean.cq.ciq.WorkingTypeCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsWorkingTypeCQ extends AbstractBsWorkingTypeCQ { //========================================================================== @@ -60,7 +60,7 @@ public WorkingTypeCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } WorkingTypeCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -153,21 +153,21 @@ return "id_NotExistsSubQuery_MonthlyWorkingReportList." + key; } - protected Map<String, MonthlyWorkingReportCQ> _id_DeriveSubQuery_MonthlyWorkingReportListMap; + protected Map<String, MonthlyWorkingReportCQ> _id_DerivedReferrer_MonthlyWorkingReportListMap; - public Map<String, MonthlyWorkingReportCQ> getId_DeriveSubQuery_MonthlyWorkingReportList() { - return _id_DeriveSubQuery_MonthlyWorkingReportListMap; + public Map<String, MonthlyWorkingReportCQ> getId_DerivedReferrer_MonthlyWorkingReportList() { + return _id_DerivedReferrer_MonthlyWorkingReportListMap; } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { - if (_id_DeriveSubQuery_MonthlyWorkingReportListMap == null) { - _id_DeriveSubQuery_MonthlyWorkingReportListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MonthlyWorkingReportListMap == null) { + _id_DerivedReferrer_MonthlyWorkingReportListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MonthlyWorkingReportListMap.size() + 1); - _id_DeriveSubQuery_MonthlyWorkingReportListMap.put(key, subQuery); - return "id_DeriveSubQuery_MonthlyWorkingReportList." + key; + + (_id_DerivedReferrer_MonthlyWorkingReportListMap.size() + 1); + _id_DerivedReferrer_MonthlyWorkingReportListMap.put(key, subQuery); + return "id_DerivedReferrer_MonthlyWorkingReportList." + key; } public BsWorkingTypeCQ addOrderBy_Id_Asc() { @@ -459,7 +459,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, WorkingTypeCQ> _scalarSubQueryMap; + public Map<String, WorkingTypeCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(WorkingTypeCQ subQuery) { + if (_scalarSubQueryMap == null) { + _scalarSubQueryMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + (_scalarSubQueryMap.size() + 1); + _scalarSubQueryMap.put(key, subQuery); + return "scalarSubQuery." + key; + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return WorkingTypeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return WorkingTypeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/DailyReportCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.DailyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsDailyReportCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class DailyReportCIQ extends AbstractBsDailyReportCQ { //========================================================================== @@ -169,6 +169,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(DailyReportCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return DailyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return DailyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/EmployeeCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.EmployeeCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class EmployeeCIQ extends AbstractBsEmployeeCQ { //========================================================================== @@ -118,10 +118,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MonthlyReportList( + public String keepId_DerivedReferrer_MonthlyReportList( MonthlyReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueUsername() { @@ -174,6 +174,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(EmployeeCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return EmployeeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return EmployeeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupInfoCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { //========================================================================== @@ -137,15 +137,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_GroupMappingList( + public String keepGroupId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepGroupId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -196,6 +196,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.GroupMappingCB; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return GroupMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyReportCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyReportCB; import jp.sf.pal.timecard.db.cbean.cq.DailyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MonthlyReportCIQ extends AbstractBsMonthlyReportCQ { //========================================================================== @@ -140,15 +140,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_DailyReportList(DailyReportCQ subQuery) { + public String keepId_DerivedReferrer_DailyReportList(DailyReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueYear() { @@ -219,6 +219,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MonthlyReportCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/MonthlyWorkingReportCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.MonthlyWorkingReportCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyReportCQ; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MonthlyWorkingReportCIQ extends AbstractBsMonthlyWorkingReportCQ { //========================================================================== @@ -120,6 +120,20 @@ return _myCQ.keepWorkingTypeId_InScopeSubQuery_WorkingType(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MonthlyWorkingReportCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MonthlyWorkingReportCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MonthlyWorkingReportCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleInfoCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_RoleMappingList( + public String keepRoleId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + public String keepRoleId_DerivedReferrer_UserInfoList(UserInfoCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -195,6 +195,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.RoleMappingCB; import jp.sf.pal.timecard.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.timecard.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { //========================================================================== @@ -112,6 +112,20 @@ return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return RoleMappingCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.UserInfoCB; import jp.sf.pal.timecard.db.cbean.cq.EmployeeCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.timecard.db.cbean.cq.GroupMappingCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -190,28 +190,28 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_EmployeeByUsernameList( + public String keepUserId_DerivedReferrer_EmployeeByUsernameList( EmployeeCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_EmployeeByManagerList( + public String keepUserId_DerivedReferrer_EmployeeByManagerList( EmployeeCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_GroupMappingList( + public String keepUserId_DerivedReferrer_GroupMappingList( GroupMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_RoleMappingList( + public String keepUserId_DerivedReferrer_RoleMappingList( RoleMappingCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueGivenName() { @@ -278,6 +278,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -306,6 +310,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return UserInfoCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/cq/ciq/WorkingTypeCIQ.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,6 +5,7 @@ import jp.sf.pal.timecard.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.timecard.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.timecard.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.timecard.db.cbean.WorkingTypeCB; import jp.sf.pal.timecard.db.cbean.cq.MonthlyWorkingReportCQ; import jp.sf.pal.timecard.db.cbean.cq.WorkingTypeCQ; import jp.sf.pal.timecard.db.cbean.cq.bs.AbstractBsWorkingTypeCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class WorkingTypeCIQ extends AbstractBsWorkingTypeCQ { //========================================================================== @@ -118,10 +118,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MonthlyWorkingReportList( + public String keepId_DerivedReferrer_MonthlyWorkingReportList( MonthlyWorkingReportCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -168,6 +168,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(WorkingTypeCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return WorkingTypeCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return WorkingTypeCQ.class.getName(); } Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/DailyReportNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class DailyReportNss { protected DailyReportCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/EmployeeNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class EmployeeNss { protected EmployeeCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyReportNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MonthlyReportNss { protected MonthlyReportCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/MonthlyWorkingReportNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MonthlyWorkingReportNss { protected MonthlyWorkingReportCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/UserInfoNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java =================================================================== --- timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/java/jp/sf/pal/timecard/db/cbean/nss/WorkingTypeNss.java 2008-12-27 22:20:25 UTC (rev 1631) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class WorkingTypeNss { protected WorkingTypeCQ _query; Modified: timecard/trunk/src/main/resources/dbflute.dicon =================================================================== --- timecard/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:18:30 UTC (rev 1630) +++ timecard/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:20:25 UTC (rev 1631) @@ -5,101 +5,42 @@ <components namespace="dbflute"> <include path="j2ee.dicon"/> - <!-- S2Dao component. --> - <component class="jp.sf.pal.timecard.db.allcommon.s2dao.S2DaoMetaDataFactoryImpl"> - <property name="sqlFileEncoding">"UTF-8"</property> + <!-- The core component of DBFlute. (Basically internal components except for behaviorSelector) --> + <component name="behaviorInitializer" class="jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorInitializer"/> + <component name="behaviorCommandInvoker" class="jp.sf.pal.timecard.db.allcommon.bhv.core.BehaviorCommandInvoker"/> + <component name="commonColumnAutoSetupper" class="jp.sf.pal.timecard.db.allcommon.CommonColumnBasicAutoSetupper"/> + <component name="behaviorSelector" class="jp.sf.pal.timecard.db.allcommon.CacheBehaviorSelector"> + <destroyMethod name="destroy"/> </component> - <component name="interceptor" class="jp.sf.pal.timecard.db.allcommon.s2dao.S2DaoInterceptor"/> + + <!-- The component of S2Dao. --> + <component class="jp.sf.pal.timecard.db.allcommon.s2dao.BeanMetaDataFactoryExtension"/> + <component class="jp.sf.pal.timecard.db.allcommon.s2dao.PropertyTypeFactoryBuilderExtension"/> + <component class="jp.sf.pal.timecard.db.allcommon.s2dao.SqlLogRegistryLatestSqlProvider"/> <component class="org.seasar.dao.impl.AnnotationReaderFactoryImpl"/> <component class="org.seasar.dao.impl.ValueTypeFactoryImpl"/> - <component class="jp.sf.pal.timecard.db.allcommon.s2dao.S2BeanMetaDataFactoryImpl"/> <component class="org.seasar.dao.impl.DaoNamingConventionImpl"/> <component class="org.seasar.dao.impl.NullBeanEnhancer"/> - <component class="jp.sf.pal.timecard.db.allcommon.s2dao.S2DaoMetaDataExtension$ResultSetHandlerFactoryExtension"/> <component class="org.seasar.dao.impl.DtoMetaDataFactoryImpl"/> - <component class="jp.sf.pal.timecard.db.allcommon.s2dao.S2DaoPropertyTypeFactoryBuilderExtension"/> <component class="org.seasar.dao.impl.RelationPropertyTypeFactoryBuilderImpl"/> <component class="org.seasar.dao.impl.DefaultTableNaming"/> <component class="org.seasar.dao.impl.DefaultColumnNaming"/> <component class="org.seasar.dao.impl.ProcedureMetaDataFactoryImpl"/> - <component class="jp.sf.pal.timecard.db.allcommon.s2dao.S2DaoLatestSqlProvider"/> + + <!-- The special value type. --> <component name="dbfluteStringClobType" class="org.seasar.extension.jdbc.types.StringClobType" /> <component name="dbfluteBytesOidType" class="jp.sf.pal.timecard.db.allcommon.s2dao.internal.valuetype.InternalBytesOidType" /> - <!-- The selector of behavior. --> - <component name="behaviorSelector" class="jp.sf.pal.timecard.db.allcommon.CacheBehaviorSelector"> - <destroyMethod name="destroy"/> - </component> - <!-- The selector of DAO. --> - <component name="daoSelector" class="jp.sf.pal.timecard.db.allcommon.CacheDaoSelector"> - <destroyMethod name="destroy"/> - </component> - - <!-- The dao of outsideSql. --> - <component class="jp.sf.pal.timecard.db.allcommon.cbean.outsidesql.OutsideSqlDao"> - <aspect>dbflute.interceptor</aspect> - </component> - - - <!-- DAILY_REPORT --> - <component name="dailyReportDao" class="jp.sf.pal.timecard.db.exdao.DailyReportDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="dailyReportBhv" class="jp.sf.pal.timecard.db.exbhv.DailyReportBhv"/> - - <!-- EMPLOYEE --> - <component name="employeeDao" class="jp.sf.pal.timecard.db.exdao.EmployeeDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="employeeBhv" class="jp.sf.pal.timecard.db.exbhv.EmployeeBhv"/> - - <!-- GROUP_INFO --> - <component name="groupInfoDao" class="jp.sf.pal.timecard.db.exdao.GroupInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="groupInfoBhv" class="jp.sf.pal.timecard.db.exbhv.GroupInfoBhv"/> - - <!-- GROUP_MAPPING --> - <component name="groupMappingDao" class="jp.sf.pal.timecard.db.exdao.GroupMappingDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="groupMappingBhv" class="jp.sf.pal.timecard.db.exbhv.GroupMappingBhv"/> - - <!-- MONTHLY_REPORT --> - <component name="monthlyReportDao" class="jp.sf.pal.timecard.db.exdao.MonthlyReportDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="monthlyReportBhv" class="jp.sf.pal.timecard.db.exbhv.MonthlyReportBhv"/> - - <!-- MONTHLY_WORKING_REPORT --> - <component name="monthlyWorkingReportDao" class="jp.sf.pal.timecard.db.exdao.MonthlyWorkingReportDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="monthlyWorkingReportBhv" class="jp.sf.pal.timecard.db.exbhv.MonthlyWorkingReportBhv"/> - - <!-- ROLE_INFO --> - <component name="roleInfoDao" class="jp.sf.pal.timecard.db.exdao.RoleInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="roleInfoBhv" class="jp.sf.pal.timecard.db.exbhv.RoleInfoBhv"/> - - <!-- ROLE_MAPPING --> - <component name="roleMappingDao" class="jp.sf.pal.timecard.db.exdao.RoleMappingDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="roleMappingBhv" class="jp.sf.pal.timecard.db.exbhv.RoleMappingBhv"/> - - <!-- USER_INFO --> - <component name="userInfoDao" class="jp.sf.pal.timecard.db.exdao.UserInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="userInfoBhv" class="jp.sf.pal.timecard.db.exbhv.UserInfoBhv"/> - - <!-- WORKING_TYPE --> - <component name="workingTypeDao" class="jp.sf.pal.timecard.db.exdao.WorkingTypeDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="workingTypeBhv" class="jp.sf.pal.timecard.db.exbhv.WorkingTypeBhv"/> </components> Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.1.log.db =================================================================== (Binary files differ) Modified: timecard/trunk/src/main/webapp/WEB-INF/db/timecard.data.db =================================================================== (Binary files differ)