svnno****@sourc*****
svnno****@sourc*****
2008年 12月 28日 (日) 07:13:37 JST
Revision: 1628 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1628 Author: shinsuke Date: 2008-12-28 07:13:37 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- notepad/trunk/dbflute/_project.bat notepad/trunk/dbflute/_project.sh notepad/trunk/dbflute/build-notepad.properties notepad/trunk/mydbflute/README.txt notepad/trunk/src/main/config/erd/notepad.erd notepad/trunk/src/main/config/sql/notepad.ddl notepad/trunk/src/main/config/sql/notepad.dml notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java notepad/trunk/src/main/resources/dbflute.dicon notepad/trunk/src/main/webapp/WEB-INF/db/notepad.1.log.db notepad/trunk/src/main/webapp/WEB-INF/db/notepad.data.db Added Paths: ----------- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsdao/ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/exdao/ -------------- next part -------------- Modified: notepad/trunk/dbflute/_project.bat =================================================================== --- notepad/trunk/dbflute/_project.bat 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/dbflute/_project.bat 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=notepad -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: notepad/trunk/dbflute/_project.sh =================================================================== --- notepad/trunk/dbflute/_project.sh 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/dbflute/_project.sh 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=notepad -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: notepad/trunk/dbflute/build-notepad.properties =================================================================== --- notepad/trunk/dbflute/build-notepad.properties 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/dbflute/build-notepad.properties 2008-12-27 22:13:37 UTC (rev 1628) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: notepad/trunk/mydbflute/README.txt =================================================================== --- notepad/trunk/mydbflute/README.txt 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/mydbflute/README.txt 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/config/erd/notepad.erd =================================================================== --- notepad/trunk/src/main/config/erd/notepad.erd 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/config/erd/notepad.erd 2008-12-27 22:13:37 UTC (rev 1628) @@ -204,6 +204,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"> @@ -233,7 +249,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> @@ -255,7 +271,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> @@ -292,6 +308,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>441</x> <y>802</y> @@ -384,7 +405,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> @@ -406,7 +427,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> @@ -428,7 +449,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> @@ -450,7 +471,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> @@ -460,6 +481,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>1322</y> @@ -529,6 +555,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>44</x> <y>491</y> @@ -686,7 +717,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> @@ -708,7 +739,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> @@ -730,7 +761,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> @@ -752,7 +783,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> @@ -762,6 +793,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>620</x> <y>1322</y> @@ -826,6 +862,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>628</x> <y>491</y> @@ -1081,6 +1122,11 @@ </columns> </net.java.amateras.db.visual.model.IndexModel> </indices> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>456</x> <y>180</y> @@ -1265,6 +1311,11 @@ </columns> </net.java.amateras.db.visual.model.IndexModel> </indices> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>305</x> <y>491</y> @@ -1403,6 +1454,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>478</x> <y>40</y> Modified: notepad/trunk/src/main/config/sql/notepad.ddl =================================================================== --- notepad/trunk/src/main/config/sql/notepad.ddl 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/config/sql/notepad.ddl 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,9 +7,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), @@ -26,9 +26,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), @@ -45,9 +45,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), @@ -64,6 +64,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, @@ -75,9 +76,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_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, @@ -86,9 +87,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, @@ -97,9 +98,9 @@ FOREIGN KEY (role_id) REFERENCES role_info (role_id) ); -/********************************** -Table Name: Notepad Category -**********************************/ +/**********************************/ +/* Table Name: Notepad Category */ +/**********************************/ CREATE TABLE notepad_category( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -116,9 +117,9 @@ FOREIGN KEY (updated_by) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Notepad -**********************************/ +/**********************************/ +/* Table Name: Notepad */ +/**********************************/ CREATE TABLE notepad( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, title VARCHAR(100) NOT NULL, @@ -136,9 +137,9 @@ FOREIGN KEY (updated_by) REFERENCES user_info (user_id) ); -/********************************** -Table Name: Notepad Content -**********************************/ +/**********************************/ +/* Table Name: Notepad Content */ +/**********************************/ CREATE TABLE notepad_content( id BIGINT(20) NOT NULL PRIMARY KEY, content VARCHAR(4000), Modified: notepad/trunk/src/main/config/sql/notepad.dml =================================================================== --- notepad/trunk/src/main/config/sql/notepad.dml 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/config/sql/notepad.dml 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,3 +1,3 @@ -insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0); +insert into user_info (USER_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, VERSIONNO, STATUS) values ('admin', '2008-10-15 17:17:37', 'admin', '2008-10-15 17:17:37', 'admin', 0, 'A'); insert into NOTEPAD_CATEGORY (ID, NAME, CREATED_TIME, CREATED_BY, SORT_ORDER, UPDATED_TIME, UPDATED_BY, VERSIONNO, TYPE) values (1, '(Unclassified)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, 'P'); insert into NOTEPAD_CATEGORY (ID, NAME, CREATED_TIME, CREATED_BY, SORT_ORDER, UPDATED_TIME, UPDATED_BY, VERSIONNO, TYPE) values (2, '(Shared)', '2008-10-15 17:17:37', 'admin', 1, '2008-10-15 17:17:37', 'admin', 0, 'P'); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/BehaviorSelector.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,8 +1,8 @@ package jp.sf.pal.notepad.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.notepad.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,31 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,179 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/DBFluteConfig.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.notepad.db.allcommon.BehaviorSelector; -import jp.sf.pal.notepad.db.allcommon.DaoSelector; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.notepad.db.allcommon.cbean.PagingHandler; import jp.sf.pal.notepad.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.notepad.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.notepad.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.notepad.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.notepad.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.notepad.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.notepad.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.notepad.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.notepad.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.notepad.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.notepad.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.notepad.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.notepad.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.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,6 +1,5 @@ package jp.sf.pal.notepad.db.allcommon.bhv; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,6 +1,7 @@ package jp.sf.pal.notepad.db.allcommon.bhv; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.notepad.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.notepad.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.notepad.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.notepad.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,71 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,23 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,842 @@ +package jp.sf.pal.notepad.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.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.InternalMapContext; +import jp.sf.pal.notepad.db.allcommon.XLog; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.notepad.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.notepad.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.notepad.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,180 @@ +package jp.sf.pal.notepad.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.notepad.db.allcommon.DBDef; +import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.notepad.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("GROUP_INFO", + "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap + .put("NOTEPAD", + "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadDbm"); + tmpMap.put("NOTEPAD_CATEGORY", + "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadCategoryDbm"); + tmpMap.put("NOTEPAD_CONTENT", + "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadContentDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.notepad.db.bsentity.dbmeta.UserInfoDbm"); + _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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,9 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,9 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,261 @@ +package jp.sf.pal.notepad.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.notepad.db.allcommon.DBDef; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,182 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,182 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,93 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,175 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,122 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,51 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,46 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,51 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,51 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,86 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.notepad.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.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,152 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,128 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,77 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,96 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,151 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,140 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,65 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,103 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,162 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,112 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,55 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.command; + +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,25 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,77 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,225 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,168 @@ +package jp.sf.pal.notepad.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,5 +1,7 @@ package jp.sf.pal.notepad.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,10 +1,6 @@ package jp.sf.pal.notepad.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,5 @@ +package jp.sf.pal.notepad.db.allcommon.cbean; + +public interface ScalarQuery<CB extends ConditionBean> { + public void query(CB cb); +} Property changes on: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,104 @@ +package jp.sf.pal.notepad.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,5 +1,10 @@ package jp.sf.pal.notepad.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.notepad.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.notepad.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.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.notepad.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.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.notepad.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -6,9 +6,10 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,17 +1,21 @@ package jp.sf.pal.notepad.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.notepad.db.allcommon.DBFluteConfig; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.notepad.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ListResultBean; import jp.sf.pal.notepad.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.notepad.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.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,12 +1,14 @@ package jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.notepad.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.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.notepad.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.notepad.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.notepad.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.notepad.db.allcommon.cbean.ListResultBean; import jp.sf.pal.notepad.db.allcommon.cbean.PagingBean; import jp.sf.pal.notepad.db.allcommon.cbean.PagingHandler; import jp.sf.pal.notepad.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.notepad.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.notepad.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -17,23 +17,23 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.notepad.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,7 @@ import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.notepad.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.notepad.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.notepad.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.notepad.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,103 +1,85 @@ package jp.sf.pal.notepad.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.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.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("GROUP_INFO", - "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.notepad.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap - .put("NOTEPAD", - "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadDbm"); - tmpMap.put("NOTEPAD_CATEGORY", - "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadCategoryDbm"); - tmpMap.put("NOTEPAD_CONTENT", - "jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadContentDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.notepad.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.notepad.db.bsentity.dbmeta.UserInfoDbm"); + /** 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("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("NOTEPAD".toLowerCase(), "notepad"); - tmpMap.put("NOTEPAD_CATEGORY".toLowerCase(), "notepadCategory"); - tmpMap.put("NOTEPAD_CONTENT".toLowerCase(), "notepadContent"); - tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); - tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); - tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); - - _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("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("notepad".toLowerCase(), "NOTEPAD"); - tmpMap.put("notepadCategory".toLowerCase(), "NOTEPAD_CATEGORY"); - tmpMap.put("notepadContent".toLowerCase(), "NOTEPAD_CONTENT"); - tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); - tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); - tmpMap.put("userInfo".toLowerCase(), "USER_INFO"); - - _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() { @@ -130,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); @@ -192,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; @@ -215,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,13 +1,14 @@ package jp.sf.pal.notepad.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,17 +1,20 @@ package jp.sf.pal.notepad.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.notepad.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.notepad.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,201 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,233 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,213 @@ +package jp.sf.pal.notepad.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.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,215 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,21 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao; + +import jp.sf.pal.notepad.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.XLog; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.notepad.db.allcommon.Entity; +import jp.sf.pal.notepad.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.DBDef; +import jp.sf.pal.notepad.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.notepad.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.notepad.db.allcommon.CallbackContext; +import jp.sf.pal.notepad.db.allcommon.DBDef; import jp.sf.pal.notepad.db.allcommon.DBFluteConfig; import jp.sf.pal.notepad.db.allcommon.InternalMapContext; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,146 @@ +package jp.sf.pal.notepad.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.notepad.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,33 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,105 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,35 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,116 @@ +package jp.sf.pal.notepad.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,158 @@ +package jp.sf.pal.notepad.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.notepad.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.notepad.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,117 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,14 +1,20 @@ package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -0,0 +1,692 @@ +package jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.exbhv.GroupMappingBhv; import jp.sf.pal.notepad.db.exbhv.UserInfoBhv; -import jp.sf.pal.notepad.db.exdao.GroupInfoDao; import jp.sf.pal.notepad.db.exentity.GroupInfo; import jp.sf.pal.notepad.db.exentity.GroupMapping; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.notepad.db.cbean.GroupMappingCB; -import jp.sf.pal.notepad.db.exdao.GroupMappingDao; import jp.sf.pal.notepad.db.exentity.GroupInfo; import jp.sf.pal.notepad.db.exentity.GroupMapping; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,14 +15,13 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadDbm; import jp.sf.pal.notepad.db.cbean.NotepadCB; -import jp.sf.pal.notepad.db.exdao.NotepadDao; import jp.sf.pal.notepad.db.exentity.Notepad; import jp.sf.pal.notepad.db.exentity.NotepadCategory; import jp.sf.pal.notepad.db.exentity.NotepadContent; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of NOTEPAD. + * The behavior of NOTEPAD that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -68,12 +66,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected NotepadDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -85,39 +77,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return NotepadDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public NotepadDbm getMyDBMeta() { return NotepadDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public NotepadDao getMyDao() { - return _dao; - } - - public void setMyDao(NotepadDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -147,7 +118,7 @@ * @return The selected count. */ public int selectCount(NotepadCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -224,7 +195,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<Notepad> selectList(NotepadCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<Notepad>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -240,7 +211,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<Notepad> selectPage(final NotepadCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Notepad> invoker = new PagingInvoker<Notepad>( getTableDbName()); final PagingHandler<Notepad> handler = new PagingHandler<Notepad>() { @@ -261,6 +232,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * notepadBhv.scalarSelect(Date.class).max(new ScalarQuery(NotepadCB 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<NotepadCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + NotepadCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<NotepadCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -270,8 +267,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - NotepadCB cb, ValueLabelSetupper<Notepad> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(NotepadCB cb, + ValueLabelSetupper<Notepad> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -282,8 +279,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'NotepadCategory'. * @@ -642,11 +639,11 @@ */ public int queryUpdate(Notepad notepad, NotepadCB cb) { assertObjectNotNull("notepad", notepad); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(notepad); filterEntityOfUpdate(notepad); assertEntityOfUpdate(notepad); - return getMyDao().updateByQuery(cb, notepad); + return invoke(createQueryUpdateEntityCBCommand(notepad, cb)); } /** @@ -656,8 +653,8 @@ * @return The deleted count. */ public int queryDelete(NotepadCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -669,19 +666,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(NotepadCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((NotepadCB) cb); + } + protected List<Notepad> delegateSelectList(NotepadCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Notepad.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((NotepadCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -689,62 +694,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(Notepad 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(Notepad e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Notepad 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(Notepad e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<Notepad> ls) { - assertObjectNotNull("notepadList", 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<Notepad> ls) { - assertObjectNotNull("notepadList", 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<Notepad> ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<Notepad> ls) { - assertObjectNotNull("notepadList", 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<Notepad> ls) { - assertObjectNotNull("notepadList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadCategoryBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,13 +19,12 @@ import jp.sf.pal.notepad.db.cbean.NotepadCB; import jp.sf.pal.notepad.db.cbean.NotepadCategoryCB; import jp.sf.pal.notepad.db.exbhv.NotepadBhv; -import jp.sf.pal.notepad.db.exdao.NotepadCategoryDao; import jp.sf.pal.notepad.db.exentity.Notepad; import jp.sf.pal.notepad.db.exentity.NotepadCategory; import jp.sf.pal.notepad.db.exentity.UserInfo; /** - * The behavior of NOTEPAD_CATEGORY. + * The behavior of NOTEPAD_CATEGORY that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -71,12 +69,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected NotepadCategoryDao _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 NotepadCategoryDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public NotepadCategoryDbm getMyDBMeta() { return NotepadCategoryDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public NotepadCategoryDao getMyDao() { - return _dao; - } - - public void setMyDao(NotepadCategoryDao 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(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -231,7 +202,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<NotepadCategory> selectList(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<NotepadCategory>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -248,7 +219,7 @@ */ public PagingResultBean<NotepadCategory> selectPage( final NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<NotepadCategory> invoker = new PagingInvoker<NotepadCategory>( getTableDbName()); final PagingHandler<NotepadCategory> handler = new PagingHandler<NotepadCategory>() { @@ -269,6 +240,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * notepadCategoryBhv.scalarSelect(Date.class).max(new ScalarQuery(NotepadCategoryCB 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<NotepadCategoryCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + NotepadCategoryCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<NotepadCategoryCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -278,8 +275,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - NotepadCategoryCB cb, + public List<Map<String, Object>> selectValueLabelList(NotepadCategoryCB cb, ValueLabelSetupper<NotepadCategory> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -382,8 +378,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'UserInfo'. * @@ -719,11 +715,11 @@ */ public int queryUpdate(NotepadCategory notepadCategory, NotepadCategoryCB cb) { assertObjectNotNull("notepadCategory", notepadCategory); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(notepadCategory); filterEntityOfUpdate(notepadCategory); assertEntityOfUpdate(notepadCategory); - return getMyDao().updateByQuery(cb, notepadCategory); + return invoke(createQueryUpdateEntityCBCommand(notepadCategory, cb)); } /** @@ -733,8 +729,8 @@ * @return The deleted count. */ public int queryDelete(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -746,19 +742,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((NotepadCategoryCB) cb); + } + protected List<NotepadCategory> delegateSelectList(NotepadCategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, NotepadCategory.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((NotepadCategoryCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -766,62 +770,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(NotepadCategory 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(NotepadCategory e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(NotepadCategory 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(NotepadCategory e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<NotepadCategory> ls) { - assertObjectNotNull("notepadCategoryList", 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<NotepadCategory> ls) { - assertObjectNotNull("notepadCategoryList", 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<NotepadCategory> ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<NotepadCategory> ls) { - assertObjectNotNull("notepadCategoryList", 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<NotepadCategory> ls) { - assertObjectNotNull("notepadCategoryList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsNotepadContentBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.NotepadContentDbm; import jp.sf.pal.notepad.db.cbean.NotepadContentCB; -import jp.sf.pal.notepad.db.exdao.NotepadContentDao; import jp.sf.pal.notepad.db.exentity.Notepad; import jp.sf.pal.notepad.db.exentity.NotepadContent; /** - * The behavior of NOTEPAD_CONTENT. + * The behavior of NOTEPAD_CONTENT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -66,12 +64,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected NotepadContentDao _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 NotepadContentDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public NotepadContentDbm getMyDBMeta() { return NotepadContentDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public NotepadContentDao getMyDao() { - return _dao; - } - - public void setMyDao(NotepadContentDao 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(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -225,7 +196,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<NotepadContent> selectList(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<NotepadContent>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -241,7 +212,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<NotepadContent> selectPage(final NotepadContentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<NotepadContent> invoker = new PagingInvoker<NotepadContent>( getTableDbName()); final PagingHandler<NotepadContent> handler = new PagingHandler<NotepadContent>() { @@ -262,6 +233,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * notepadContentBhv.scalarSelect(Date.class).max(new ScalarQuery(NotepadContentCB 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<NotepadContentCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + NotepadContentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<NotepadContentCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -271,8 +268,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - NotepadContentCB cb, + public List<Map<String, Object>> selectValueLabelList(NotepadContentCB cb, ValueLabelSetupper<NotepadContent> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -284,8 +280,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Notepad'. * @@ -483,11 +479,11 @@ */ public int queryUpdate(NotepadContent notepadContent, NotepadContentCB cb) { assertObjectNotNull("notepadContent", notepadContent); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(notepadContent); filterEntityOfUpdate(notepadContent); assertEntityOfUpdate(notepadContent); - return getMyDao().updateByQuery(cb, notepadContent); + return invoke(createQueryUpdateEntityCBCommand(notepadContent, cb)); } /** @@ -497,8 +493,8 @@ * @return The deleted count. */ public int queryDelete(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -510,19 +506,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((NotepadContentCB) cb); + } + protected List<NotepadContent> delegateSelectList(NotepadContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, NotepadContent.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((NotepadContentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -530,38 +534,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(NotepadContent 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(NotepadContent 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<NotepadContent> ls) { - assertObjectNotNull("notepadContentList", 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<NotepadContent> ls) { - assertObjectNotNull("notepadContentList", 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<NotepadContent> ls) { - assertObjectNotNull("notepadContentList", 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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.exbhv.RoleMappingBhv; import jp.sf.pal.notepad.db.exbhv.UserInfoBhv; -import jp.sf.pal.notepad.db.exdao.RoleInfoDao; import jp.sf.pal.notepad.db.exentity.RoleInfo; import jp.sf.pal.notepad.db.exentity.RoleMapping; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.notepad.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.notepad.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.notepad.db.cbean.RoleMappingCB; -import jp.sf.pal.notepad.db.exdao.RoleMappingDao; import jp.sf.pal.notepad.db.exentity.RoleInfo; import jp.sf.pal.notepad.db.exentity.RoleMapping; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -1,9 +1,8 @@ package jp.sf.pal.notepad.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.notepad.db.allcommon.DaoReadable; -import jp.sf.pal.notepad.db.allcommon.DaoWritable; import jp.sf.pal.notepad.db.allcommon.Entity; import jp.sf.pal.notepad.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.notepad.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -26,7 +25,6 @@ import jp.sf.pal.notepad.db.exbhv.NotepadBhv; import jp.sf.pal.notepad.db.exbhv.NotepadCategoryBhv; import jp.sf.pal.notepad.db.exbhv.RoleMappingBhv; -import jp.sf.pal.notepad.db.exdao.UserInfoDao; import jp.sf.pal.notepad.db.exentity.GroupInfo; import jp.sf.pal.notepad.db.exentity.GroupMapping; import jp.sf.pal.notepad.db.exentity.Notepad; @@ -36,14 +34,14 @@ import jp.sf.pal.notepad.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] * @@ -81,12 +79,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected UserInfoDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -98,39 +90,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() { @@ -160,7 +131,7 @@ * @return The selected count. */ public int selectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -237,7 +208,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)); } @@ -253,7 +224,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>() { @@ -274,6 +245,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 // ============== /** @@ -283,8 +280,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); } @@ -842,8 +839,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -1168,11 +1165,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)); } /** @@ -1182,8 +1179,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -1195,19 +1192,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 // ------ @@ -1215,62 +1220,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsGroupMapping.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepad.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsNotepad implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadCategory.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsNotepadCategory implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsNotepadContent.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsNotepadContent implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsRoleMapping.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/BsUserInfo.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -22,7 +22,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] * @@ -48,7 +48,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -116,6 +115,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; @@ -529,6 +531,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()); @@ -880,6 +883,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadCategoryDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.NotepadCategory; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadCategoryDbm extends AbstractDBMeta { private static final NotepadCategoryDbm _instance = new NotepadCategoryDbm(); @@ -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<NotepadCategory>> _epsMap = newHashMap(); + protected Map<String, Eps<NotepadCategory>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadContentDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.NotepadContent; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadContentDbm extends AbstractDBMeta { private static final NotepadContentDbm _instance = new NotepadContentDbm(); @@ -61,40 +61,14 @@ return _columnContent; } - { - 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 @@ -250,7 +224,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<NotepadContent>> _epsMap = newHashMap(); + protected Map<String, Eps<NotepadContent>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsContent(), columnContent()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/NotepadDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.db.exentity.Notepad; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadDbm extends AbstractDBMeta { private static final NotepadDbm _instance = new NotepadDbm(); @@ -124,40 +124,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 @@ -342,7 +316,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<Notepad>> _epsMap = newHashMap(); + protected Map<String, Eps<Notepad>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsTitle(), columnTitle()); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,6 +8,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -9,6 +9,7 @@ import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.notepad.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.notepad.db.allcommon.helper.StringKeyMap; import jp.sf.pal.notepad.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 @@ -445,7 +426,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()); @@ -462,6 +444,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()); @@ -570,6 +553,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsNotepadCB extends AbstractConditionBean { //========================================================================== @@ -92,7 +91,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -142,22 +146,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<NotepadCB> unionQuery). - */ - public void union(NotepadCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<NotepadCB> unionQuery). - */ - public void unionAll(NotepadCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -166,7 +154,6 @@ // ========= // Setup Select // ============ - protected NotepadCategoryNss _nssNotepadCategory; public NotepadCategoryNss getNssNotepadCategory() { @@ -276,7 +263,7 @@ public NotepadCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -293,8 +280,10 @@ protected NotepadContentCB.Specification _notepadContentAsOne; public Specification(ConditionBean baseCB, SpQyCall<NotepadCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -362,7 +351,8 @@ public NotepadCategoryCB.Specification specifyNotepadCategory() { assertForeign("notepadCategory"); if (_notepadCategory == null) { - _notepadCategory = new NotepadCategoryCB.Specification(_baseCB, + _notepadCategory = new NotepadCategoryCB.Specification( + _baseCB, new SpQyCall<NotepadCategoryCQ>() { public boolean has() { return _myQyCall.has() @@ -374,7 +364,8 @@ public NotepadCategoryCQ qy() { return _myQyCall.qy().queryNotepadCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _notepadCategory; } @@ -382,7 +373,8 @@ public UserInfoCB.Specification specifyUserInfoByCreatedBy() { assertForeign("userInfoByCreatedBy"); if (_userInfoByCreatedBy == null) { - _userInfoByCreatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByCreatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall<UserInfoCQ>() { public boolean has() { return _myQyCall.has() @@ -395,7 +387,8 @@ return _myQyCall.qy() .queryUserInfoByCreatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByCreatedBy; } @@ -403,7 +396,8 @@ public UserInfoCB.Specification specifyUserInfoByUpdatedBy() { assertForeign("userInfoByUpdatedBy"); if (_userInfoByUpdatedBy == null) { - _userInfoByUpdatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByUpdatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall<UserInfoCQ>() { public boolean has() { return _myQyCall.has() @@ -416,7 +410,8 @@ return _myQyCall.qy() .queryUserInfoByUpdatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUpdatedBy; } @@ -425,7 +420,8 @@ assertForeign("notepadContentAsOne"); if (_notepadContentAsOne == null) { _notepadContentAsOne = new NotepadContentCB.Specification( - _baseCB, new SpQyCall<NotepadContentCQ>() { + _baseCB, + new SpQyCall<NotepadContentCQ>() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -437,7 +433,8 @@ return _myQyCall.qy() .queryNotepadContentAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _notepadContentAsOne; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadCategoryCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -19,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsNotepadCategoryCB 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,24 +141,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<NotepadCategoryCB> - * unionQuery). - */ - public void union(NotepadCategoryCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<NotepadCategoryCB> - * unionQuery). - */ - public void unionAll(NotepadCategoryCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -163,7 +149,6 @@ // ========= // Setup Select // ============ - protected UserInfoNss _nssUserInfoByCreatedBy; public UserInfoNss getNssUserInfoByCreatedBy() { @@ -228,7 +213,8 @@ public NotepadCategoryCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -242,8 +228,10 @@ protected UserInfoCB.Specification _userInfoByUpdatedBy; public Specification(ConditionBean baseCB, - SpQyCall<NotepadCategoryCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<NotepadCategoryCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -308,7 +296,8 @@ public UserInfoCB.Specification specifyUserInfoByCreatedBy() { assertForeign("userInfoByCreatedBy"); if (_userInfoByCreatedBy == null) { - _userInfoByCreatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByCreatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall<UserInfoCQ>() { public boolean has() { return _myQyCall.has() @@ -321,7 +310,8 @@ return _myQyCall.qy() .queryUserInfoByCreatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByCreatedBy; } @@ -329,7 +319,8 @@ public UserInfoCB.Specification specifyUserInfoByUpdatedBy() { assertForeign("userInfoByUpdatedBy"); if (_userInfoByUpdatedBy == null) { - _userInfoByUpdatedBy = new UserInfoCB.Specification(_baseCB, + _userInfoByUpdatedBy = new UserInfoCB.Specification( + _baseCB, new SpQyCall<UserInfoCQ>() { public boolean has() { return _myQyCall.has() @@ -342,7 +333,8 @@ return _myQyCall.qy() .queryUserInfoByUpdatedBy(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _userInfoByUpdatedBy; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsNotepadContentCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsNotepadContentCB 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<NotepadContentCB> - * unionQuery). - */ - public void union(NotepadContentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<NotepadContentCB> - * unionQuery). - */ - public void unionAll(NotepadContentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected NotepadNss _nssNotepad; public NotepadNss getNssNotepad() { @@ -202,7 +187,8 @@ public NotepadContentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected NotepadCB.Specification _notepad; public Specification(ConditionBean baseCB, - SpQyCall<NotepadContentCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<NotepadContentCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -251,7 +239,8 @@ public NotepadCQ qy() { return _myQyCall.qy().queryNotepad(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _notepad; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -25,7 +25,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsUserInfoCB extends AbstractConditionBean { //========================================================================== @@ -94,7 +93,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -144,23 +148,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(); } @@ -169,7 +156,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -230,7 +216,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -243,8 +230,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; } @@ -308,6 +297,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -364,7 +357,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -383,7 +377,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -11,16 +11,13 @@ import jp.sf.pal.notepad.db.cbean.GroupInfoCB; import jp.sf.pal.notepad.db.cbean.GroupMappingCB; import jp.sf.pal.notepad.db.cbean.UserInfoCB; -import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -15,14 +15,12 @@ import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; -import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of NOTEPAD. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsNotepadCQ extends AbstractConditionQuery { //========================================================================== @@ -52,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. */ @@ -61,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -70,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -79,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -88,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -97,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,33 +124,17 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param notepadContentCBquery Query. - * @deprecated Please use inScopeNotepadContentAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_NotepadContentAsOne( - NotepadContentCQ notepadContentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_NotepadContentAsOne(notepadContentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadContentCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeNotepadContentAsOne(SubQuery<NotepadContentCB> subQuery) { assertObjectNotNull("subQuery<NotepadContentCB>", subQuery); NotepadContentCB cb = new NotepadContentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_NotepadContentAsOne( + public abstract String keepId_InScopeSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); public void notInScopeNotepadContentAsOne( @@ -161,30 +144,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_NotepadContentAsOne( + public abstract String keepId_NotInScopeSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); /** - * @param notepadContentCBquery Query. - * @deprecated Please use existsNotepadContentAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_NotepadContentAsOne( - NotepadContentCQ notepadContentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_NotepadContentAsOne(notepadContentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadContentCBquery, "ID", "ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ID from NOTEPAD_CONTENT where * ...)} * @@ -197,11 +164,11 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_NotepadContentAsOne( + public abstract String keepId_ExistsSubQuery_NotepadContentAsOne( NotepadContentCQ subQuery); /** @@ -217,22 +184,22 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_NotepadContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_NotepadContentAsOne( + public abstract String keepId_NotExistsSubQuery_NotepadContentAsOne( NotepadContentCQ 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); @@ -249,7 +216,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param title The value of title as equal. @@ -259,7 +226,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as notEqual. */ @@ -268,7 +235,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterThan. */ @@ -277,7 +244,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessThan. */ @@ -286,7 +253,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterEqual. */ @@ -295,7 +262,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessEqual. */ @@ -304,7 +271,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as prefixSearch. */ @@ -313,20 +280,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param title The value of title as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setTitle_LikeSearch( - String title, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -337,27 +290,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param title The collection of title as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param titleList The collection of title as notInScope. */ - public void setTitle_InScope( + public void setTitle_NotInScope(Collection<String> titleList) { + regTitle(CK_NINS, cTL(titleList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param title The value of title as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setTitle_LikeSearch( String title, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(title), getCValueTitle(), "TITLE", "Title", "title", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param titleList The collection of title as notInScope. + * @param title The value of title as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setTitle_NotInScope(Collection<String> titleList) { - regTitle(CK_NINS, cTL(titleList)); + public void setTitle_NotLikeSearch( + String title, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(title), getCValueTitle(), "TITLE", "Title", + "title", likeSearchOption); } protected void regTitle(ConditionKey key, Object value) { @@ -372,7 +339,7 @@ abstract protected ConditionValue getCValueTitle(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -382,7 +349,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -391,7 +358,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -400,7 +367,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -409,7 +376,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -418,7 +385,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -459,8 +426,8 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER : Default=[0] : FK to - * NOTEPAD_CATEGORY} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER : Default=[0] : + * FK to NOTEPAD_CATEGORY} * * @param categoryId The value of categoryId as equal. */ @@ -469,7 +436,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -478,7 +445,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -487,7 +454,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -496,7 +463,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -505,7 +472,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -533,45 +500,29 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use inScopeNotepadCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_NotepadCategory( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_NotepadCategory(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCategoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeNotepadCategory(SubQuery<NotepadCategoryCB> subQuery) { assertObjectNotNull("subQuery<NotepadCategoryCB>", subQuery); NotepadCategoryCB cb = new NotepadCategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_NotepadCategory(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_NotepadCategory( + public abstract String keepCategoryId_InScopeSubQuery_NotepadCategory( NotepadCategoryCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setCategoryId_IsNull() { regCategoryId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setCategoryId_IsNotNull() { regCategoryId(CK_ISNN, DUMMY_OBJECT); @@ -590,7 +541,7 @@ abstract protected ConditionValue getCValueCategoryId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -599,7 +550,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -608,7 +559,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -617,7 +568,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -626,7 +577,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -635,7 +586,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -645,7 +596,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) @@ -663,7 +614,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) @@ -689,8 +640,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -699,7 +650,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -708,7 +659,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -717,7 +668,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -726,7 +677,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -735,7 +686,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -744,7 +695,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -753,20 +704,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.notepad.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. * @@ -777,43 +714,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( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByCreatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfoByCreatedBy(SubQuery<UserInfoCB> subQuery) { @@ -822,12 +757,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -843,7 +778,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. */ @@ -852,7 +787,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -861,7 +796,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -870,7 +805,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -879,7 +814,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -888,7 +823,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -898,7 +833,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) @@ -916,7 +851,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) @@ -942,8 +877,8 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param updatedBy The value of updatedBy as equal. */ @@ -952,7 +887,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -961,7 +896,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -970,7 +905,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -979,7 +914,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -988,7 +923,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -997,7 +932,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1006,20 +941,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.notepad.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. * @@ -1030,43 +951,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( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_LikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUpdatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "UPDATED_BY", "USER_ID", - subQueryPropertyName); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } public void inScopeUserInfoByUpdatedBy(SubQuery<UserInfoCB> subQuery) { @@ -1075,12 +994,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "UPDATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( + public abstract String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1096,7 +1015,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1105,7 +1024,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1114,7 +1033,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1123,7 +1042,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1132,7 +1051,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1141,7 +1060,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1151,7 +1070,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) @@ -1169,7 +1088,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) @@ -1183,14 +1102,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); @@ -1209,7 +1128,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. */ @@ -1218,7 +1137,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1227,7 +1146,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1236,7 +1155,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1245,7 +1164,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1254,7 +1173,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1263,7 +1182,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1272,20 +1191,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.notepad.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. * @@ -1296,38 +1201,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1346,7 +1265,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. @@ -1356,7 +1275,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1365,7 +1284,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1374,7 +1293,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1383,7 +1302,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1392,7 +1311,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1432,6 +1351,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<NotepadCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<NotepadCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<NotepadCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<NotepadCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<NotepadCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<NotepadCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<NotepadCB>(new SSQSetupper<NotepadCB>() { + public void setup(String function, SubQuery<NotepadCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<NotepadCB> subQuery, String operand) { + assertObjectNotNull("subQuery<NotepadCB>", subQuery); + NotepadCB cb = new NotepadCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(NotepadCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return NotepadCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadCategoryCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -13,14 +13,12 @@ import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; -import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; /** * The abstract condition-query of NOTEPAD_CATEGORY. * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsNotepadCategoryCQ extends AbstractConditionQuery { @@ -51,7 +49,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. */ @@ -60,7 +59,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +68,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +77,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +95,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -124,33 +123,18 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepadList(subQuery) method. - */ - public void setId_InScopeSubQuery_NotepadList(NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_NotepadList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeNotepadList(SubQuery<NotepadCB> subQuery) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_NotepadList(NotepadCQ subQuery); + public abstract String keepId_InScopeSubQuery_NotepadList(NotepadCQ subQuery); public void notInScopeNotepadList(SubQuery<NotepadCB> subQuery) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); @@ -158,30 +142,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_NotepadList( + public abstract String keepId_NotInScopeSubQuery_NotepadList( NotepadCQ subQuery); /** - * @param notepadCBquery Query. - * @deprecated Please use existsNotepadList(subQuery) method. - */ - public void setId_ExistsSubQuery_NotepadList(NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_NotepadList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from NOTEPAD where * ...)} * @@ -194,12 +163,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_NotepadList(NotepadCQ subQuery); + public abstract String keepId_ExistsSubQuery_NotepadList(NotepadCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select CATEGORY_ID from @@ -214,37 +183,37 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_NotepadList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_NotepadList( + public abstract String keepId_NotExistsSubQuery_NotepadList( NotepadCQ subQuery); public void xderiveNotepadList(String function, SubQuery<NotepadCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_NotepadList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_NotepadList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_NotepadList(NotepadCQ subQuery); + public abstract String keepId_DerivedReferrer_NotepadList(NotepadCQ 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); @@ -261,7 +230,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. @@ -271,7 +240,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -280,7 +249,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -289,7 +258,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -298,7 +267,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -307,7 +276,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -316,7 +285,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -325,20 +294,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -349,27 +304,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -383,8 +352,8 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[P]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[P]} * * @param type The value of type as equal. */ @@ -393,7 +362,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as notEqual. */ @@ -402,7 +371,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterThan. */ @@ -411,7 +380,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessThan. */ @@ -420,7 +389,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as greaterEqual. */ @@ -429,7 +398,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as lessEqual. */ @@ -438,7 +407,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param type The value of type as prefixSearch. */ @@ -447,20 +416,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", - "Type", "type", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -471,27 +426,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", - "Type", "type", inScopeOption); + jp.sf.pal.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(type), getCValueType(), "TYPE", "Type", "type", + likeSearchOption); } protected void regType(ConditionKey key, Object value) { @@ -505,7 +474,7 @@ abstract protected ConditionValue getCValueType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -515,7 +484,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -524,7 +493,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -533,7 +502,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -542,7 +511,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -551,7 +520,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -592,7 +561,7 @@ abstract protected ConditionValue getCValueSortOrder(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -601,7 +570,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -610,7 +579,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -619,7 +588,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -628,7 +597,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -637,7 +606,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -647,7 +616,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) @@ -665,7 +634,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) @@ -691,8 +660,8 @@ abstract protected ConditionValue getCValueCreatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param createdBy The value of createdBy as equal. */ @@ -701,7 +670,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -710,7 +679,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -719,7 +688,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -728,7 +697,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -737,7 +706,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -746,7 +715,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -755,20 +724,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.notepad.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. * @@ -779,43 +734,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( - String createdBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param createdByList The collection of createdBy as notInScope. + * @param createdBy The value of createdBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setCreatedBy_NotInScope(Collection<String> createdByList) { - regCreatedBy(CK_NINS, cTL(createdByList)); + public void setCreatedBy_LikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByCreatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param createdBy The value of createdBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "CREATED_BY", "USER_ID", - subQueryPropertyName); + public void setCreatedBy_NotLikeSearch( + String createdBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } public void inScopeUserInfoByCreatedBy(SubQuery<UserInfoCB> subQuery) { @@ -824,12 +777,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CREATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( + public abstract String keepCreatedBy_InScopeSubQuery_UserInfoByCreatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regCreatedBy(ConditionKey key, Object value) { @@ -845,7 +798,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. */ @@ -854,7 +807,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -863,7 +816,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -872,7 +825,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -881,7 +834,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -890,7 +843,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -900,7 +853,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) @@ -918,7 +871,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) @@ -944,8 +897,8 @@ abstract protected ConditionValue getCValueUpdatedTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) - * : FK to USER_INFO} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(255) : FK to USER_INFO} * * @param updatedBy The value of updatedBy as equal. */ @@ -954,7 +907,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -963,7 +916,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -972,7 +925,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -981,7 +934,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -990,7 +943,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -999,7 +952,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1008,20 +961,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.notepad.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. * @@ -1032,43 +971,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( - String updatedBy, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param updatedByList The collection of updatedBy as notInScope. + * @param updatedBy The value of updatedBy as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) */ - public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { - regUpdatedBy(CK_NINS, cTL(updatedByList)); + public void setUpdatedBy_LikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } /** - * @param userInfoCBquery Query. - * @deprecated Please use inScopeUserInfoByUpdatedBy(subQuery) method. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param updatedBy The value of updatedBy as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( - UserInfoCQ userInfoCBquery) { - String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(userInfoCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(userInfoCBquery, "UPDATED_BY", "USER_ID", - subQueryPropertyName); + public void setUpdatedBy_NotLikeSearch( + String updatedBy, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } public void inScopeUserInfoByUpdatedBy(SubQuery<UserInfoCB> subQuery) { @@ -1077,12 +1014,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "UPDATED_BY", "USER_ID", subQueryPropertyName); } - abstract public String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( + public abstract String keepUpdatedBy_InScopeSubQuery_UserInfoByUpdatedBy( jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ subQuery); protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1098,7 +1035,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1107,7 +1044,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1116,7 +1053,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1125,7 +1062,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1134,7 +1071,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1143,7 +1080,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1153,7 +1090,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) @@ -1171,7 +1108,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) @@ -1185,14 +1122,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); @@ -1211,7 +1148,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. */ @@ -1220,7 +1157,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1229,7 +1166,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1238,7 +1175,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1247,7 +1184,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1256,7 +1193,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1265,7 +1202,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1274,20 +1211,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.notepad.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. * @@ -1298,38 +1221,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1348,7 +1285,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. @@ -1358,7 +1295,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1367,7 +1304,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1376,7 +1313,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1385,7 +1322,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1394,7 +1331,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1434,6 +1371,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<NotepadCategoryCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<NotepadCategoryCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<NotepadCategoryCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<NotepadCategoryCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<NotepadCategoryCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<NotepadCategoryCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<NotepadCategoryCB>( + new SSQSetupper<NotepadCategoryCB>() { + public void setup(String function, + SubQuery<NotepadCategoryCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<NotepadCategoryCB> subQuery, String operand) { + assertObjectNotNull("subQuery<NotepadCategoryCB>", subQuery); + NotepadCategoryCB cb = new NotepadCategoryCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(NotepadCategoryCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return NotepadCategoryCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsNotepadContentCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsNotepadContentCQ extends AbstractConditionQuery { //========================================================================== @@ -48,8 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to - * NOTEPAD} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : BIGINT : + * FK to NOTEPAD} * * @param id The value of id as equal. */ @@ -58,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -67,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -76,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -85,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -94,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,27 +121,12 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepad(subQuery) method. - */ - public void setId_InScopeSubQuery_Notepad(NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_Notepad(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "ID", "ID", - subQueryPropertyName); - } - public void inScopeNotepad(SubQuery<NotepadCB> subQuery) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); - String subQueryPropertyName = keepId_InScopeSubQuery_Notepad(cb.query());// for + String subQueryPropertyName = keepId_InScopeSubQuery_Notepad(cb.query()); // for // saving // query // - @@ -151,17 +135,17 @@ registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_Notepad(NotepadCQ subQuery); + public abstract String keepId_InScopeSubQuery_Notepad(NotepadCQ 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); @@ -178,7 +162,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(4000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(4000)} * * @param content The value of content as equal. */ @@ -187,7 +171,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -196,7 +180,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -205,7 +189,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -214,7 +198,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -223,7 +207,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -232,7 +216,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -241,20 +225,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param content The value of content as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContent_LikeSearch( - String content, - jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -265,38 +235,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param content The collection of content as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentList The collection of content as notInScope. */ - public void setContent_InScope( + public void setContent_NotInScope(Collection<String> contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param content The value of content as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContent_LikeSearch( String content, - jp.sf.pal.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentList The collection of content as notInScope. + * @param content The value of content as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContent_NotInScope(Collection<String> contentList) { - regContent(CK_NINS, cTL(contentList)); + public void setContent_NotLikeSearch( + String content, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(content), getCValueContent(), "CONTENT", "Content", + "content", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContent_IsNull() { regContent(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContent_IsNotNull() { regContent(CK_ISNN, DUMMY_OBJECT); @@ -314,6 +298,53 @@ abstract protected ConditionValue getCValueContent(); + public SSQFunction<NotepadContentCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<NotepadContentCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<NotepadContentCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<NotepadContentCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<NotepadContentCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<NotepadContentCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<NotepadContentCB>( + new SSQSetupper<NotepadContentCB>() { + public void setup(String function, + SubQuery<NotepadContentCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<NotepadContentCB> subQuery, String operand) { + assertObjectNotNull("subQuery<NotepadContentCB>", subQuery); + NotepadContentCB cb = new NotepadContentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(NotepadContentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return NotepadContentCB.class.getName(); Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -11,16 +11,13 @@ import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.UserInfoCB; -import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -15,11 +15,9 @@ import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.UserInfoCB; -import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; -import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -28,7 +26,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -58,7 +55,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -68,7 +65,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -77,7 +74,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -86,7 +83,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -95,7 +92,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -104,7 +101,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -113,7 +110,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -122,20 +119,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.notepad.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. * @@ -146,43 +129,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.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } /** - * @param groupMappingCBquery Query. - * @deprecated Please use inScopeGroupMappingList(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_GroupMappingList( - GroupMappingCQ groupMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); + public void setUserId_NotLikeSearch( + String userId, + jp.sf.pal.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -191,91 +172,42 @@ 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 notepadCBquery Query. - * @deprecated Please use inScopeNotepadByCreatedByList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_NotepadByCreatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByCreatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - public void inScopeNotepadByCreatedByList(SubQuery<NotepadCB> subQuery) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); - /** - * @param notepadCBquery Query. - * @deprecated Please use inScopeNotepadByUpdatedByList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_NotepadByUpdatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByUpdatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - public void inScopeNotepadByUpdatedByList(SubQuery<NotepadCB> subQuery) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); - /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use inScopeNotepadCategoryByCreatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_NotepadCategoryByCreatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCategoryCBquery, "USER_ID", - "CREATED_BY", subQueryPropertyName); - } - public void inScopeNotepadCategoryByCreatedByList( SubQuery<NotepadCategoryCB> subQuery) { assertObjectNotNull("subQuery<NotepadCategoryCB>", subQuery); @@ -283,31 +215,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); - /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use inScopeNotepadCategoryByUpdatedByList(subQuery) - * method. - */ - public void setUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(notepadCategoryCBquery, "USER_ID", - "UPDATED_BY", subQueryPropertyName); - } - public void inScopeNotepadCategoryByUpdatedByList( SubQuery<NotepadCategoryCB> subQuery) { assertObjectNotNull("subQuery<NotepadCategoryCB>", subQuery); @@ -315,42 +230,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_InScopeSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ 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 notInScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -359,12 +258,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 notInScopeNotepadByCreatedByList(SubQuery<NotepadCB> subQuery) { @@ -373,12 +272,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); public void notInScopeNotepadByUpdatedByList(SubQuery<NotepadCB> subQuery) { @@ -387,12 +286,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); public void notInScopeNotepadCategoryByCreatedByList( @@ -402,12 +301,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); public void notInScopeNotepadCategoryByUpdatedByList( @@ -417,12 +316,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_NotInScopeSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); public void notInScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { @@ -431,31 +330,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 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 ...)} * @@ -468,31 +351,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 notepadCBquery Query. - * @deprecated Please use existsNotepadByCreatedByList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_NotepadByCreatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByCreatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from NOTEPAD where * ...)} * @@ -506,31 +373,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); /** - * @param notepadCBquery Query. - * @deprecated Please use existsNotepadByUpdatedByList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_NotepadByUpdatedByList( - NotepadCQ notepadCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByUpdatedByList(notepadCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select UPDATED_BY from NOTEPAD where * ...)} * @@ -544,32 +395,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use existsNotepadCategoryByCreatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_NotepadCategoryByCreatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCategoryCBquery, "USER_ID", "CREATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CREATED_BY from * NOTEPAD_CATEGORY where ...)} * @@ -584,32 +418,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); /** - * @param notepadCategoryCBquery Query. - * @deprecated Please use existsNotepadCategoryByUpdatedByList(subQuery) - * method. - */ - public void setUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList( - NotepadCategoryCQ notepadCategoryCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList(notepadCategoryCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(notepadCategoryCBquery, "USER_ID", "UPDATED_BY", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select UPDATED_BY from * NOTEPAD_CATEGORY where ...)} * @@ -624,31 +441,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_ExistsSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ 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 ...)} * @@ -661,12 +462,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); /** @@ -683,12 +484,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); /** @@ -705,12 +506,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadByCreatedByList( NotepadCQ subQuery); /** @@ -727,12 +528,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadByUpdatedByList( NotepadCQ subQuery); /** @@ -750,12 +551,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "CREATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); /** @@ -773,12 +574,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotExistsSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "USER_ID", "UPDATED_BY", subQueryPropertyName); } - abstract public String keepUserId_NotExistsSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_NotExistsSubQuery_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery); /** @@ -794,113 +595,113 @@ 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 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 xderiveNotepadByCreatedByList(String function, SubQuery<NotepadCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadByCreatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadByCreatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadByCreatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadByCreatedByList( NotepadCQ subQuery); public void xderiveNotepadByUpdatedByList(String function, SubQuery<NotepadCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<NotepadCB>", subQuery); NotepadCB cb = new NotepadCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadByUpdatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "UPDATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadByUpdatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "UPDATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadByUpdatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadByUpdatedByList( NotepadCQ subQuery); public void xderiveNotepadCategoryByCreatedByList(String function, SubQuery<NotepadCategoryCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<NotepadCategoryCB>", subQuery); NotepadCategoryCB cb = new NotepadCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "CREATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "CREATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery); public void xderiveNotepadCategoryByUpdatedByList(String function, SubQuery<NotepadCategoryCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<NotepadCategoryCB>", subQuery); NotepadCategoryCB cb = new NotepadCategoryCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "USER_ID", "UPDATED_BY", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "USER_ID", + "UPDATED_BY", subQueryPropertyName, aliasName); } - abstract public String keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList( + public abstract String keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList( NotepadCategoryCQ 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); @@ -919,7 +720,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. */ @@ -928,7 +729,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -937,7 +738,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -946,7 +747,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -955,7 +756,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -964,7 +765,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -973,7 +774,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -982,20 +783,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.notepad.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. * @@ -1006,38 +793,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1056,7 +857,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. */ @@ -1065,7 +866,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -1074,7 +875,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -1083,7 +884,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -1092,7 +893,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -1101,7 +902,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -1110,7 +911,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -1119,20 +920,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.notepad.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. * @@ -1143,38 +930,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1193,7 +994,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. */ @@ -1202,7 +1003,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -1211,7 +1012,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -1220,7 +1021,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -1229,7 +1030,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -1238,7 +1039,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -1247,7 +1048,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -1256,20 +1057,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.notepad.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. * @@ -1280,38 +1067,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1330,7 +1131,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. */ @@ -1339,7 +1140,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -1348,7 +1149,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -1357,7 +1158,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -1366,7 +1167,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -1375,7 +1176,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -1384,7 +1185,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -1393,21 +1194,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.notepad.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. * @@ -1418,39 +1204,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1469,7 +1270,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. */ @@ -1478,7 +1279,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -1487,7 +1288,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1496,7 +1297,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1505,7 +1306,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1514,7 +1315,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1523,7 +1324,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1532,21 +1333,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.notepad.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. * @@ -1557,40 +1343,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1609,7 +1410,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. */ @@ -1618,7 +1419,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1627,7 +1428,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1636,7 +1437,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1645,7 +1446,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1654,7 +1455,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1663,7 +1464,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1672,20 +1473,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1696,38 +1483,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1746,7 +1547,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. */ @@ -1755,7 +1556,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1764,7 +1565,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1773,7 +1574,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1782,7 +1583,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1791,7 +1592,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1800,7 +1601,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1809,20 +1610,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1833,38 +1620,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -1883,7 +1684,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1892,7 +1693,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1901,7 +1702,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1910,7 +1711,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1919,7 +1720,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1928,7 +1729,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1938,7 +1739,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) @@ -1954,7 +1755,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) @@ -1968,14 +1769,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); @@ -1994,7 +1795,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. */ @@ -2003,7 +1804,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -2012,7 +1813,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -2021,7 +1822,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -2030,7 +1831,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -2039,7 +1840,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -2048,7 +1849,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -2057,20 +1858,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2081,38 +1868,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -2130,7 +1931,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. */ @@ -2139,7 +1940,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -2148,7 +1949,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -2157,7 +1958,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -2166,7 +1967,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -2175,7 +1976,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -2184,7 +1985,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -2193,20 +1994,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2217,38 +2004,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -2265,7 +2066,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. */ @@ -2274,7 +2075,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -2283,7 +2084,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -2292,7 +2093,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -2301,7 +2102,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -2310,7 +2111,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -2319,7 +2120,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -2328,20 +2129,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2352,38 +2139,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -2402,7 +2203,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. */ @@ -2411,7 +2212,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -2420,7 +2221,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -2429,7 +2230,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -2438,7 +2239,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -2447,7 +2248,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -2456,7 +2257,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -2465,20 +2266,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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -2489,38 +2276,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -2539,8 +2340,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. */ @@ -2549,7 +2350,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2558,7 +2359,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2567,7 +2368,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2576,7 +2377,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2585,7 +2386,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2594,7 +2395,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2603,20 +2404,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.notepad.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. * @@ -2627,42 +2414,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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery<RoleInfoCB> subQuery) { @@ -2671,23 +2457,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.notepad.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); @@ -2706,8 +2492,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. */ @@ -2716,7 +2502,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2725,7 +2511,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2734,7 +2520,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2743,7 +2529,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2752,7 +2538,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2761,7 +2547,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2770,20 +2556,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.notepad.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. * @@ -2794,43 +2566,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.notepad.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.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery<GroupInfoCB> subQuery) { @@ -2839,23 +2609,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.notepad.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); @@ -2874,8 +2644,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.notepad.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.notepad.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) { @@ -2883,7 +2790,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2892,7 +2799,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2901,7 +2808,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2910,7 +2817,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2919,7 +2826,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2929,7 +2836,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) @@ -2947,7 +2854,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) @@ -2973,7 +2880,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. @@ -2983,7 +2890,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2992,7 +2899,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -3001,7 +2908,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -3010,7 +2917,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -3019,7 +2926,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -3028,7 +2935,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -3037,20 +2944,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.notepad.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. * @@ -3061,27 +2954,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -3097,7 +3004,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. */ @@ -3106,7 +3013,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -3115,7 +3022,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -3124,7 +3031,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -3133,7 +3040,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -3142,7 +3049,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -3152,7 +3059,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) @@ -3170,7 +3077,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) @@ -3196,7 +3103,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. @@ -3206,7 +3113,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -3215,7 +3122,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -3224,7 +3131,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -3233,7 +3140,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -3242,7 +3149,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -3251,7 +3158,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -3260,20 +3167,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.notepad.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. * @@ -3284,27 +3177,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -3320,7 +3227,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -3329,7 +3236,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -3338,7 +3245,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -3347,7 +3254,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -3356,7 +3263,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -3365,7 +3272,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -3375,7 +3282,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) @@ -3393,7 +3300,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) @@ -3407,14 +3314,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); @@ -3433,7 +3340,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. */ @@ -3442,7 +3349,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -3451,7 +3358,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -3460,7 +3367,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -3469,7 +3376,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -3478,7 +3385,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -3487,7 +3394,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3496,20 +3403,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.notepad.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. * @@ -3520,38 +3413,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.notepad.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.notepad.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.notepad.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); @@ -3570,7 +3477,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. */ @@ -3579,7 +3486,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3588,7 +3495,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3597,7 +3504,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3606,7 +3513,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3615,7 +3522,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3655,6 +3562,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupMappingCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsNotepadCQ extends AbstractBsNotepadCQ { //========================================================================== @@ -62,7 +62,7 @@ public NotepadCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } NotepadCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -494,7 +494,6 @@ // ========= // Foreign Query // ============= - public NotepadCategoryCQ queryNotepadCategory() { return getConditionQueryNotepadCategory(); } @@ -503,20 +502,13 @@ public NotepadCategoryCQ getConditionQueryNotepadCategory() { if (_conditionQueryNotepadCategory == null) { - _conditionQueryNotepadCategory = createQueryNotepadCategory(); - setupOuterJoin_NotepadCategory(); + _conditionQueryNotepadCategory = xcreateQueryNotepadCategory(); + xsetupOuterJoinNotepadCategory(); } return _conditionQueryNotepadCategory; } - protected void setupOuterJoin_NotepadCategory() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryNotepadCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryNotepadCategory(), joinOnMap); - } - - protected NotepadCategoryCQ createQueryNotepadCategory() { + protected NotepadCategoryCQ xcreateQueryNotepadCategory() { String nrp = resolveNextRelationPath("NOTEPAD", "notepadCategory"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); NotepadCategoryCQ cq = new NotepadCategoryCQ(this, getSqlClause(), jan, @@ -526,6 +518,14 @@ return cq; } + protected void xsetupOuterJoinNotepadCategory() { + NotepadCategoryCQ cq = getConditionQueryNotepadCategory(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryNotepadCategory() { return _conditionQueryNotepadCategory != null; } @@ -538,21 +538,13 @@ public UserInfoCQ getConditionQueryUserInfoByCreatedBy() { if (_conditionQueryUserInfoByCreatedBy == null) { - _conditionQueryUserInfoByCreatedBy = createQueryUserInfoByCreatedBy(); - setupOuterJoin_UserInfoByCreatedBy(); + _conditionQueryUserInfoByCreatedBy = xcreateQueryUserInfoByCreatedBy(); + xsetupOuterJoinUserInfoByCreatedBy(); } return _conditionQueryUserInfoByCreatedBy; } - protected void setupOuterJoin_UserInfoByCreatedBy() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfoByCreatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByCreatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByCreatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByCreatedBy() { String nrp = resolveNextRelationPath("NOTEPAD", "userInfoByCreatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -562,6 +554,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByCreatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByCreatedBy(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByCreatedBy() { return _conditionQueryUserInfoByCreatedBy != null; } @@ -574,21 +574,13 @@ public UserInfoCQ getConditionQueryUserInfoByUpdatedBy() { if (_conditionQueryUserInfoByUpdatedBy == null) { - _conditionQueryUserInfoByUpdatedBy = createQueryUserInfoByUpdatedBy(); - setupOuterJoin_UserInfoByUpdatedBy(); + _conditionQueryUserInfoByUpdatedBy = xcreateQueryUserInfoByUpdatedBy(); + xsetupOuterJoinUserInfoByUpdatedBy(); } return _conditionQueryUserInfoByUpdatedBy; } - protected void setupOuterJoin_UserInfoByUpdatedBy() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("UPDATED_BY"), - getConditionQueryUserInfoByUpdatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUpdatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUpdatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByUpdatedBy() { String nrp = resolveNextRelationPath("NOTEPAD", "userInfoByUpdatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, @@ -598,6 +590,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUpdatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByUpdatedBy(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("UPDATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUpdatedBy() { return _conditionQueryUserInfoByUpdatedBy != null; } @@ -610,20 +610,13 @@ public NotepadContentCQ getConditionQueryNotepadContentAsOne() { if (_conditionQueryNotepadContentAsOne == null) { - _conditionQueryNotepadContentAsOne = createQueryNotepadContentAsOne(); - setupOuterJoin_NotepadContentAsOne(); + _conditionQueryNotepadContentAsOne = xcreateQueryNotepadContentAsOne(); + xsetupOuterJoinNotepadContentAsOne(); } return _conditionQueryNotepadContentAsOne; } - protected void setupOuterJoin_NotepadContentAsOne() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), - getConditionQueryNotepadContentAsOne().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryNotepadContentAsOne(), joinOnMap); - } - - protected NotepadContentCQ createQueryNotepadContentAsOne() { + protected NotepadContentCQ xcreateQueryNotepadContentAsOne() { String nrp = resolveNextRelationPath("NOTEPAD", "notepadContentAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); NotepadContentCQ cq = new NotepadContentCQ(this, getSqlClause(), jan, @@ -633,10 +626,41 @@ return cq; } + protected void xsetupOuterJoinNotepadContentAsOne() { + NotepadContentCQ cq = getConditionQueryNotepadContentAsOne(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryNotepadContentAsOne() { return _conditionQueryNotepadContentAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, NotepadCQ> _scalarSubQueryMap; + + public Map<String, NotepadCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(NotepadCQ 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 NotepadCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadCategoryCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCategoryCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsNotepadCategoryCQ extends AbstractBsNotepadCategoryCQ { //========================================================================== @@ -61,7 +61,7 @@ public NotepadCategoryCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } NotepadCategoryCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -150,20 +150,20 @@ return "id_NotExistsSubQuery_NotepadList." + key; } - protected Map<String, NotepadCQ> _id_DeriveSubQuery_NotepadListMap; + protected Map<String, NotepadCQ> _id_DerivedReferrer_NotepadListMap; - public Map<String, NotepadCQ> getId_DeriveSubQuery_NotepadList() { - return _id_DeriveSubQuery_NotepadListMap; + public Map<String, NotepadCQ> getId_DerivedReferrer_NotepadList() { + return _id_DerivedReferrer_NotepadListMap; } - public String keepId_DeriveSubQuery_NotepadList(NotepadCQ subQuery) { - if (_id_DeriveSubQuery_NotepadListMap == null) { - _id_DeriveSubQuery_NotepadListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_NotepadList(NotepadCQ subQuery) { + if (_id_DerivedReferrer_NotepadListMap == null) { + _id_DerivedReferrer_NotepadListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_NotepadListMap.size() + 1); - _id_DeriveSubQuery_NotepadListMap.put(key, subQuery); - return "id_DeriveSubQuery_NotepadList." + key; + + (_id_DerivedReferrer_NotepadListMap.size() + 1); + _id_DerivedReferrer_NotepadListMap.put(key, subQuery); + return "id_DerivedReferrer_NotepadList." + key; } public BsNotepadCategoryCQ addOrderBy_Id_Asc() { @@ -478,7 +478,6 @@ // ========= // Foreign Query // ============= - public UserInfoCQ queryUserInfoByCreatedBy() { return getConditionQueryUserInfoByCreatedBy(); } @@ -487,21 +486,13 @@ public UserInfoCQ getConditionQueryUserInfoByCreatedBy() { if (_conditionQueryUserInfoByCreatedBy == null) { - _conditionQueryUserInfoByCreatedBy = createQueryUserInfoByCreatedBy(); - setupOuterJoin_UserInfoByCreatedBy(); + _conditionQueryUserInfoByCreatedBy = xcreateQueryUserInfoByCreatedBy(); + xsetupOuterJoinUserInfoByCreatedBy(); } return _conditionQueryUserInfoByCreatedBy; } - protected void setupOuterJoin_UserInfoByCreatedBy() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CREATED_BY"), - getConditionQueryUserInfoByCreatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByCreatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByCreatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByCreatedBy() { String nrp = resolveNextRelationPath("NOTEPAD_CATEGORY", "userInfoByCreatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -512,6 +503,14 @@ return cq; } + protected void xsetupOuterJoinUserInfoByCreatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByCreatedBy(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CREATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByCreatedBy() { return _conditionQueryUserInfoByCreatedBy != null; } @@ -524,21 +523,13 @@ public UserInfoCQ getConditionQueryUserInfoByUpdatedBy() { if (_conditionQueryUserInfoByUpdatedBy == null) { - _conditionQueryUserInfoByUpdatedBy = createQueryUserInfoByUpdatedBy(); - setupOuterJoin_UserInfoByUpdatedBy(); + _conditionQueryUserInfoByUpdatedBy = xcreateQueryUserInfoByUpdatedBy(); + xsetupOuterJoinUserInfoByUpdatedBy(); } return _conditionQueryUserInfoByUpdatedBy; } - protected void setupOuterJoin_UserInfoByUpdatedBy() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("UPDATED_BY"), - getConditionQueryUserInfoByUpdatedBy().getRealColumnName( - "USER_ID")); - registerOuterJoin(getConditionQueryUserInfoByUpdatedBy(), joinOnMap); - } - - protected UserInfoCQ createQueryUserInfoByUpdatedBy() { + protected UserInfoCQ xcreateQueryUserInfoByUpdatedBy() { String nrp = resolveNextRelationPath("NOTEPAD_CATEGORY", "userInfoByUpdatedBy"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); @@ -549,10 +540,42 @@ return cq; } + protected void xsetupOuterJoinUserInfoByUpdatedBy() { + UserInfoCQ cq = getConditionQueryUserInfoByUpdatedBy(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("UPDATED_BY"), cq + .getRealColumnName("USER_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryUserInfoByUpdatedBy() { return _conditionQueryUserInfoByUpdatedBy != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, NotepadCategoryCQ> _scalarSubQueryMap; + + public Map<String, NotepadCategoryCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(NotepadCategoryCQ 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 NotepadCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCategoryCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsNotepadContentCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadContentCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; import jp.sf.pal.notepad.db.cbean.cq.ciq.NotepadContentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsNotepadContentCQ extends AbstractBsNotepadContentCQ { //========================================================================== @@ -60,7 +60,7 @@ public NotepadContentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } NotepadContentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -166,7 +166,6 @@ // ========= // Foreign Query // ============= - public NotepadCQ queryNotepad() { return getConditionQueryNotepad(); } @@ -175,20 +174,13 @@ public NotepadCQ getConditionQueryNotepad() { if (_conditionQueryNotepad == null) { - _conditionQueryNotepad = createQueryNotepad(); - setupOuterJoin_Notepad(); + _conditionQueryNotepad = xcreateQueryNotepad(); + xsetupOuterJoinNotepad(); } return _conditionQueryNotepad; } - protected void setupOuterJoin_Notepad() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), getConditionQueryNotepad() - .getRealColumnName("ID")); - registerOuterJoin(getConditionQueryNotepad(), joinOnMap); - } - - protected NotepadCQ createQueryNotepad() { + protected NotepadCQ xcreateQueryNotepad() { String nrp = resolveNextRelationPath("NOTEPAD_CONTENT", "notepad"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); NotepadCQ cq = new NotepadCQ(this, getSqlClause(), jan, @@ -198,10 +190,41 @@ return cq; } + protected void xsetupOuterJoinNotepad() { + NotepadCQ cq = getConditionQueryNotepad(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq.getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryNotepad() { return _conditionQueryNotepad != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, NotepadContentCQ> _scalarSubQueryMap; + + public Map<String, NotepadContentCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(NotepadContentCQ 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 NotepadContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadContentCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; @@ -19,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -65,7 +65,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); @@ -516,110 +516,110 @@ return "userId_NotExistsSubQuery_RoleMappingList." + 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, NotepadCQ> _userId_DeriveSubQuery_NotepadByCreatedByListMap; + protected Map<String, NotepadCQ> _userId_DerivedReferrer_NotepadByCreatedByListMap; - public Map<String, NotepadCQ> getUserId_DeriveSubQuery_NotepadByCreatedByList() { - return _userId_DeriveSubQuery_NotepadByCreatedByListMap; + public Map<String, NotepadCQ> getUserId_DerivedReferrer_NotepadByCreatedByList() { + return _userId_DerivedReferrer_NotepadByCreatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadByCreatedByList( NotepadCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadByCreatedByListMap == null) { - _userId_DeriveSubQuery_NotepadByCreatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadByCreatedByListMap == null) { + _userId_DerivedReferrer_NotepadByCreatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadByCreatedByListMap.size() + 1); - _userId_DeriveSubQuery_NotepadByCreatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadByCreatedByList." + key; + + (_userId_DerivedReferrer_NotepadByCreatedByListMap.size() + 1); + _userId_DerivedReferrer_NotepadByCreatedByListMap.put(key, subQuery); + return "userId_DerivedReferrer_NotepadByCreatedByList." + key; } - protected Map<String, NotepadCQ> _userId_DeriveSubQuery_NotepadByUpdatedByListMap; + protected Map<String, NotepadCQ> _userId_DerivedReferrer_NotepadByUpdatedByListMap; - public Map<String, NotepadCQ> getUserId_DeriveSubQuery_NotepadByUpdatedByList() { - return _userId_DeriveSubQuery_NotepadByUpdatedByListMap; + public Map<String, NotepadCQ> getUserId_DerivedReferrer_NotepadByUpdatedByList() { + return _userId_DerivedReferrer_NotepadByUpdatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadByUpdatedByList( NotepadCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadByUpdatedByListMap == null) { - _userId_DeriveSubQuery_NotepadByUpdatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadByUpdatedByListMap == null) { + _userId_DerivedReferrer_NotepadByUpdatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadByUpdatedByListMap.size() + 1); - _userId_DeriveSubQuery_NotepadByUpdatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadByUpdatedByList." + key; + + (_userId_DerivedReferrer_NotepadByUpdatedByListMap.size() + 1); + _userId_DerivedReferrer_NotepadByUpdatedByListMap.put(key, subQuery); + return "userId_DerivedReferrer_NotepadByUpdatedByList." + key; } - protected Map<String, NotepadCategoryCQ> _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap; + protected Map<String, NotepadCategoryCQ> _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap; - public Map<String, NotepadCategoryCQ> getUserId_DeriveSubQuery_NotepadCategoryByCreatedByList() { - return _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap; + public Map<String, NotepadCategoryCQ> getUserId_DerivedReferrer_NotepadCategoryByCreatedByList() { + return _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap == null) { - _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadCategoryByCreatedByListMap == null) { + _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap + + (_userId_DerivedReferrer_NotepadCategoryByCreatedByListMap .size() + 1); - _userId_DeriveSubQuery_NotepadCategoryByCreatedByListMap.put(key, + _userId_DerivedReferrer_NotepadCategoryByCreatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadCategoryByCreatedByList." + key; + return "userId_DerivedReferrer_NotepadCategoryByCreatedByList." + key; } - protected Map<String, NotepadCategoryCQ> _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap; + protected Map<String, NotepadCategoryCQ> _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap; - public Map<String, NotepadCategoryCQ> getUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList() { - return _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap; + public Map<String, NotepadCategoryCQ> getUserId_DerivedReferrer_NotepadCategoryByUpdatedByList() { + return _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap; } - public String keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList( NotepadCategoryCQ subQuery) { - if (_userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap == null) { - _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap = newLinkedHashMap(); + if (_userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap == null) { + _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap + + (_userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap .size() + 1); - _userId_DeriveSubQuery_NotepadCategoryByUpdatedByListMap.put(key, + _userId_DerivedReferrer_NotepadCategoryByUpdatedByListMap.put(key, subQuery); - return "userId_DeriveSubQuery_NotepadCategoryByUpdatedByList." + key; + return "userId_DerivedReferrer_NotepadCategoryByUpdatedByList." + 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() { @@ -986,6 +986,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() { @@ -1183,7 +1206,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -1192,20 +1214,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, @@ -1215,6 +1230,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; } @@ -1227,20 +1250,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, @@ -1250,10 +1266,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.GroupMappingCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadCIQ extends AbstractBsNotepadCQ { //========================================================================== @@ -176,6 +176,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(NotepadCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadCategoryCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadCategoryCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCategoryCQ; import jp.sf.pal.notepad.db.cbean.cq.UserInfoCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadCategoryCIQ extends AbstractBsNotepadCategoryCQ { //========================================================================== @@ -114,9 +114,9 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_NotepadList(NotepadCQ subQuery) { + public String keepId_DerivedReferrer_NotepadList(NotepadCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -171,6 +171,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(NotepadCategoryCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadCategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadCategoryCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/NotepadContentCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.NotepadContentCB; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadContentCQ; import jp.sf.pal.notepad.db.cbean.cq.bs.AbstractBsNotepadContentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadContentCIQ extends AbstractBsNotepadContentCQ { //========================================================================== @@ -103,6 +103,20 @@ return _myCQ.getContent(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(NotepadContentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return NotepadContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return NotepadContentCQ.class.getName(); } Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleInfoCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.RoleMappingCB; import jp.sf.pal.notepad.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.notepad.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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,6 +5,7 @@ import jp.sf.pal.notepad.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.notepad.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.notepad.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.notepad.db.cbean.UserInfoCB; import jp.sf.pal.notepad.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.notepad.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.notepad.db.cbean.cq.NotepadCQ; @@ -20,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -240,40 +240,40 @@ "NotExistsSubQuery 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_NotepadByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadByCreatedByList( NotepadCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadByUpdatedByList( NotepadCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadCategoryByCreatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByCreatedByList( NotepadCategoryCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepUserId_DeriveSubQuery_NotepadCategoryByUpdatedByList( + public String keepUserId_DerivedReferrer_NotepadCategoryByUpdatedByList( NotepadCategoryCQ 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() { @@ -340,6 +340,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -368,6 +372,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: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadCategoryNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadCategoryNss { protected NotepadCategoryCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadContentNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadContentNss { protected NotepadContentCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/NotepadNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class NotepadNss { protected NotepadCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java =================================================================== --- notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/java/jp/sf/pal/notepad/db/cbean/nss/UserInfoNss.java 2008-12-27 22:13:37 UTC (rev 1628) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: notepad/trunk/src/main/resources/dbflute.dicon =================================================================== --- notepad/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:11:51 UTC (rev 1627) +++ notepad/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:13:37 UTC (rev 1628) @@ -5,89 +5,40 @@ <components namespace="dbflute"> <include path="j2ee.dicon"/> - <!-- S2Dao component. --> - <component class="jp.sf.pal.notepad.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.notepad.db.allcommon.bhv.core.BehaviorInitializer"/> + <component name="behaviorCommandInvoker" class="jp.sf.pal.notepad.db.allcommon.bhv.core.BehaviorCommandInvoker"/> + <component name="commonColumnAutoSetupper" class="jp.sf.pal.notepad.db.allcommon.CommonColumnBasicAutoSetupper"/> + <component name="behaviorSelector" class="jp.sf.pal.notepad.db.allcommon.CacheBehaviorSelector"> + <destroyMethod name="destroy"/> </component> - <component name="interceptor" class="jp.sf.pal.notepad.db.allcommon.s2dao.S2DaoInterceptor"/> + + <!-- The component of S2Dao. --> + <component class="jp.sf.pal.notepad.db.allcommon.s2dao.BeanMetaDataFactoryExtension"/> + <component class="jp.sf.pal.notepad.db.allcommon.s2dao.PropertyTypeFactoryBuilderExtension"/> + <component class="jp.sf.pal.notepad.db.allcommon.s2dao.SqlLogRegistryLatestSqlProvider"/> <component class="org.seasar.dao.impl.AnnotationReaderFactoryImpl"/> <component class="org.seasar.dao.impl.ValueTypeFactoryImpl"/> - <component class="jp.sf.pal.notepad.db.allcommon.s2dao.S2BeanMetaDataFactoryImpl"/> <component class="org.seasar.dao.impl.DaoNamingConventionImpl"/> <component class="org.seasar.dao.impl.NullBeanEnhancer"/> - <component class="jp.sf.pal.notepad.db.allcommon.s2dao.S2DaoMetaDataExtension$ResultSetHandlerFactoryExtension"/> <component class="org.seasar.dao.impl.DtoMetaDataFactoryImpl"/> - <component class="jp.sf.pal.notepad.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.notepad.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.notepad.db.allcommon.s2dao.internal.valuetype.InternalBytesOidType" /> - <!-- The selector of behavior. --> - <component name="behaviorSelector" class="jp.sf.pal.notepad.db.allcommon.CacheBehaviorSelector"> - <destroyMethod name="destroy"/> - </component> - <!-- The selector of DAO. --> - <component name="daoSelector" class="jp.sf.pal.notepad.db.allcommon.CacheDaoSelector"> - <destroyMethod name="destroy"/> - </component> - - <!-- The dao of outsideSql. --> - <component class="jp.sf.pal.notepad.db.allcommon.cbean.outsidesql.OutsideSqlDao"> - <aspect>dbflute.interceptor</aspect> - </component> - - - <!-- GROUP_INFO --> - <component name="groupInfoDao" class="jp.sf.pal.notepad.db.exdao.GroupInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="groupInfoBhv" class="jp.sf.pal.notepad.db.exbhv.GroupInfoBhv"/> - - <!-- GROUP_MAPPING --> - <component name="groupMappingDao" class="jp.sf.pal.notepad.db.exdao.GroupMappingDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="groupMappingBhv" class="jp.sf.pal.notepad.db.exbhv.GroupMappingBhv"/> - - <!-- NOTEPAD --> - <component name="notepadDao" class="jp.sf.pal.notepad.db.exdao.NotepadDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="notepadBhv" class="jp.sf.pal.notepad.db.exbhv.NotepadBhv"/> - - <!-- NOTEPAD_CATEGORY --> - <component name="notepadCategoryDao" class="jp.sf.pal.notepad.db.exdao.NotepadCategoryDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="notepadCategoryBhv" class="jp.sf.pal.notepad.db.exbhv.NotepadCategoryBhv"/> - - <!-- NOTEPAD_CONTENT --> - <component name="notepadContentDao" class="jp.sf.pal.notepad.db.exdao.NotepadContentDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="notepadContentBhv" class="jp.sf.pal.notepad.db.exbhv.NotepadContentBhv"/> - - <!-- ROLE_INFO --> - <component name="roleInfoDao" class="jp.sf.pal.notepad.db.exdao.RoleInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="roleInfoBhv" class="jp.sf.pal.notepad.db.exbhv.RoleInfoBhv"/> - - <!-- ROLE_MAPPING --> - <component name="roleMappingDao" class="jp.sf.pal.notepad.db.exdao.RoleMappingDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="roleMappingBhv" class="jp.sf.pal.notepad.db.exbhv.RoleMappingBhv"/> - - <!-- USER_INFO --> - <component name="userInfoDao" class="jp.sf.pal.notepad.db.exdao.UserInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="userInfoBhv" class="jp.sf.pal.notepad.db.exbhv.UserInfoBhv"/> </components> Modified: notepad/trunk/src/main/webapp/WEB-INF/db/notepad.1.log.db =================================================================== (Binary files differ) Modified: notepad/trunk/src/main/webapp/WEB-INF/db/notepad.data.db =================================================================== (Binary files differ)