svnno****@sourc*****
svnno****@sourc*****
2008年 12月 28日 (日) 07:09:08 JST
Revision: 1625 http://svn.sourceforge.jp/view?root=pal&view=rev&rev=1625 Author: shinsuke Date: 2008-12-28 07:09:08 +0900 (Sun, 28 Dec 2008) Log Message: ----------- added status column to userinfo table. replaced with dbflute 0.8.7. Modified Paths: -------------- board/trunk/dbflute/_project.bat board/trunk/dbflute/_project.sh board/trunk/dbflute/build-board.properties board/trunk/mydbflute/README.txt board/trunk/src/main/config/erd/board.erd board/trunk/src/main/config/sql/board.ddl board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java board/trunk/src/main/resources/dbflute.dicon board/trunk/src/main/webapp/WEB-INF/db/board.data.db Added Paths: ----------- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java Removed Paths: ------------- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java board/trunk/src/main/java/jp/sf/pal/board/db/bsdao/ board/trunk/src/main/java/jp/sf/pal/board/db/exdao/ -------------- next part -------------- Modified: board/trunk/dbflute/_project.bat =================================================================== --- board/trunk/dbflute/_project.bat 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/dbflute/_project.bat 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,4 +2,4 @@ set MY_PROJECT_NAME=board -set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.7 Modified: board/trunk/dbflute/_project.sh =================================================================== --- board/trunk/dbflute/_project.sh 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/dbflute/_project.sh 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,4 +2,4 @@ export MY_PROJECT_NAME=board -export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.7 Modified: board/trunk/dbflute/build-board.properties =================================================================== --- board/trunk/dbflute/build-board.properties 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/dbflute/build-board.properties 2008-12-27 22:09:08 UTC (rev 1625) @@ -157,5 +157,5 @@ torque.additionalForeignKeyMap = map:{ \ } -#torque.isDeleteOldTableClass = true +torque.isDeleteOldTableClass = true Modified: board/trunk/mydbflute/README.txt =================================================================== --- board/trunk/mydbflute/README.txt 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/mydbflute/README.txt 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/config/erd/board.erd =================================================================== --- board/trunk/src/main/config/erd/board.erd 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/config/erd/board.erd 2008-12-27 22:09:08 UTC (rev 1625) @@ -150,6 +150,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>452</x> <y>890</y> @@ -299,6 +304,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>305</x> <y>370</y> @@ -547,6 +557,11 @@ </columns> </net.java.amateras.db.visual.model.IndexModel> </indices> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>586</x> <y>370</y> @@ -672,6 +687,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>516</x> <y>40</y> @@ -852,6 +872,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>219</x> <y>40</y> @@ -965,6 +990,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>370</y> @@ -1077,6 +1107,11 @@ </columns> </net.java.amateras.db.visual.model.IndexModel> </indices> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>807</x> <y>40</y> @@ -1350,6 +1385,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"> @@ -1379,7 +1430,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> @@ -1401,7 +1452,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> @@ -1438,6 +1489,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>1239</x> <y>370</y> @@ -1530,7 +1586,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> @@ -1552,7 +1608,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> @@ -1574,7 +1630,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> @@ -1596,7 +1652,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> @@ -1606,6 +1662,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>1094</x> <y>890</y> @@ -1674,6 +1735,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>1098</x> <y>40</y> @@ -1832,7 +1898,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> @@ -1854,7 +1920,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> @@ -1876,7 +1942,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> @@ -1898,7 +1964,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> @@ -1908,6 +1974,11 @@ </net.java.amateras.db.visual.model.ColumnModel> </columns> <indices/> + <backgroundColor> + <red>255</red> + <green>255</green> + <blue>206</blue> + </backgroundColor> <constraint> <x>1418</x> <y>890</y> @@ -1971,6 +2042,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>1426</x> <y>40</y> Modified: board/trunk/src/main/config/sql/board.ddl =================================================================== --- board/trunk/src/main/config/sql/board.ddl 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/config/sql/board.ddl 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,9 +11,9 @@ DROP TABLE attachment; DROP TABLE category; -/********************************** -Table Name: Category -**********************************/ +/**********************************/ +/* Table Name: Category */ +/**********************************/ CREATE TABLE category( id INTEGER NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(100) NOT NULL, @@ -27,9 +27,9 @@ versionNo INTEGER DEFAULT 0 NOT NULL ); -/********************************** -Table Name: Attachment -**********************************/ +/**********************************/ +/* Table Name: Attachment */ +/**********************************/ CREATE TABLE attachment( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, data BLOB NOT NULL, @@ -40,9 +40,9 @@ created_by VARCHAR(255) NOT NULL ); -/********************************** -Table Name: Message -**********************************/ +/**********************************/ +/* Table Name: Message */ +/**********************************/ CREATE TABLE message( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, display_name VARCHAR(100) NOT NULL, @@ -62,9 +62,9 @@ FOREIGN KEY (category_id) REFERENCES category (id) ); -/********************************** -Table Name: Category Access -**********************************/ +/**********************************/ +/* Table Name: Category Access */ +/**********************************/ CREATE TABLE category_access( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(255) NOT NULL, @@ -78,9 +78,9 @@ FOREIGN KEY (category_id) REFERENCES category (id) ); -/********************************** -Table Name: Reply -**********************************/ +/**********************************/ +/* Table Name: Reply */ +/**********************************/ CREATE TABLE reply( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, display_name VARCHAR(100) NOT NULL, @@ -93,9 +93,9 @@ FOREIGN KEY (message_id) REFERENCES message (id) ); -/********************************** -Table Name: Message Attachment -**********************************/ +/**********************************/ +/* Table Name: Message Attachment */ +/**********************************/ CREATE TABLE message_attachment( id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, memo VARCHAR(100), @@ -113,18 +113,18 @@ FOREIGN KEY (attachment_id) REFERENCES attachment (id) ); -/********************************** -Table Name: Message Content -**********************************/ +/**********************************/ +/* Table Name: Message Content */ +/**********************************/ CREATE TABLE message_content( message_id BIGINT(20) NOT NULL PRIMARY KEY, content VARCHAR(4000), FOREIGN KEY (message_id) REFERENCES message (id) ); -/********************************** -Table Name: Group Information -**********************************/ +/**********************************/ +/* Table Name: Group Information */ +/**********************************/ CREATE TABLE group_info( group_id VARCHAR(255) NOT NULL PRIMARY KEY, name VARCHAR(100), @@ -141,9 +141,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), @@ -160,9 +160,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), @@ -179,6 +179,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, @@ -190,9 +191,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, @@ -201,9 +202,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, Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BFinder.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,110 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -import jp.sf.pal.board.db.allcommon.bhv.BehaviorReadable; - -/** - * The entry of DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - @ SuppressWarnings("unchecked") -public class BFinder { - - //========================================================================== - // ========= - // Definition - // ========== - protected static String _dbfluteDiconName = "dbflute.dicon"; - - //========================================================================== - // ========= - // Constructor - // =========== - private BFinder() { - } - - //========================================================================== - // ========= - // Finder - // ====== - public static <BEHAVIOR_TYPE extends BehaviorReadable> BEHAVIOR_TYPE find( - Class<BEHAVIOR_TYPE> behaviorType) { - assertObjectNotNull("behaviorType", behaviorType); - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - synchronized (BFinder.class) { - if (!org.seasar.framework.container.factory.SingletonS2ContainerFactory - .hasContainer()) { - final String configFile = _dbfluteDiconName; - if (org.seasar.framework.util.ResourceUtil - .isExist(configFile)) { - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .setConfigPath(configFile); - org.seasar.framework.container.factory.SingletonS2ContainerFactory - .init(); - } else { - String msg = "S2Container is not initialized! Confirm your initializer and your dicon files."; - throw new IllegalStateException(msg); - } - } - } - } - final org.seasar.framework.container.S2Container container = org.seasar.framework.container.factory.SingletonS2ContainerFactory - .getContainer(); - final BEHAVIOR_TYPE behavior = (BEHAVIOR_TYPE) container - .getComponent(behaviorType); - return behavior; - } - - //========================================================================== - // ========= - // Accessor - // ======== - public static void setDBFluteDiconName(String dbfluteDiconName) { - _dbfluteDiconName = dbfluteDiconName; - } - - //========================================================================== - // ========= - // General 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); - } - } - - // ---------------------------------------------------------------- - // Assert String - // ------------- - /** - * Assert that the entity is not null and not trimmed empty. - * - * @param variableName Variable name. (NotNull) - * @param value Value. (NotNull) - */ - protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, - String value) { - assertObjectNotNull("variableName", variableName); - assertObjectNotNull("value", value); - if (value.trim().length() == 0) { - String msg = "The value should not be empty: variableName=" - + variableName + " value=" + value; - throw new IllegalArgumentException(msg); - } - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/BehaviorSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheBehaviorSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,8 +1,8 @@ package jp.sf.pal.board.db.allcommon; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import jp.sf.pal.board.db.allcommon.bhv.BehaviorReadable; import jp.sf.pal.board.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(); Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CacheDaoSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,66 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; - -/** - * The implementation of DAO-selector. - * - * <pre> - * Long long ago this object have cache of DAO and behavior. - * But the cache cause wrong performance when this is initialized. - * So now this object don't have cache. - * </pre> - * - * @author DBFlute(AutoGenerator) - */ - @ SuppressWarnings("unchecked") -public class CacheDaoSelector extends CacheAbstractSelector implements - DaoSelector { - - //========================================================================== - // ========= - // Selector - // ======== - /** - * Select DAO. - * - * @param <DAO> The type of DAO. - * @param daoType DAO type. (NotNull) - * @return DAO. (NotNull) - */ - public <DAO extends DaoReadable> DAO select(Class<DAO> daoType) { - return (DAO) getComponent(daoType); - } - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName) { - assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", - tableFlexibleName); - final DBMeta dbmeta = DBMetaInstanceHandler - .findDBMeta(tableFlexibleName); - return select(getDaoType(dbmeta)); - } - - protected Class<DaoReadable> getDaoType(DBMeta dbmeta) { - final String daoTypeName = dbmeta.getDaoTypeName(); - if (daoTypeName == null) { - String msg = "The dbmeta.getDaoTypeName() should not return null: dbmeta=" - + dbmeta; - throw new IllegalStateException(msg); - } - final Class<DaoReadable> daoType; - try { - daoType = (Class<DaoReadable>) Class.forName(daoTypeName); - } catch (ClassNotFoundException e) { - throw new RuntimeException("The class does not exist: " - + daoTypeName, e); - } - return daoType; - } -} Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,31 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/CommonColumnBasicAutoSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,179 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBDef.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DBFluteConfig.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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; Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoReadable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,11 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -/** - * The interface of dao-readable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoReadable { - public void initializeDaoMetaData(String methodName);// Very Internal - // Method! -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoSelector.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,26 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -/** - * The interface of DAO-selector. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoSelector { - - /** - * Select DAO. - * - * @param <DAO> The type of DAO. - * @param daoType DAO type. (NotNull) - * @return Dao. (NotNull) - */ - public <DAO extends DaoReadable> DAO select(Class<DAO> daoType); - - /** - * Select DAO-readable by name. - * - * @param tableFlexibleName Table flexible name. (NotNull) - * @return DAO-readable. (NotNull) - */ - public DaoReadable byName(String tableFlexibleName); -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/DaoWritable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,70 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -import java.util.List; - -/** - * The interface of dao-writable. - * - * @author DBFlute(AutoGenerator) - */ -public interface DaoWritable extends DaoReadable { - - /** - * Insert one entity that the type is entity-interface. - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Inserted count. - */ - public int create(Entity entity); - - /** - * Update one entity that the type is entity-interface. - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Updated count. - */ - public int modify(Entity entity); - - /** - * Update one entity that the type is entity-interface. (modified only) - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Updated count. - */ - public int modifyModifiedOnly(Entity entity); - - /** - * Delete one entity that the type is entity-interface. - * - * @param entity Entity that the type is entity-interface. (NotNull) - * @return Deleted count. - */ - public int remove(Entity entity); - - /** - * Insert several entities that the type is entity-interface. - * - * @param entityList Entity-list that the type is entity-interface. - * (NotNull) - * @return The array of inserted count. - */ - public int[] createList(List<Entity> entityList); - - /** - * Update several entities that the type is entity-interface. - * - * @param entityList Entity-list that the type is entity-interface. - * (NotNull) - * @return The array of updated count. - */ - public int[] modifyList(List<Entity> entityList); - - /** - * Delete several entities that the type is entity-interface. - * - * @param entityList Entity-list that the type is entity-interface. - * (NotNull) - * @return The array of deleted count. - */ - public int[] removeList(List<Entity> entityList); -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/EntityDefinedCommonColumn.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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(); Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/GenMetaData.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,258 +0,0 @@ -package jp.sf.pal.board.db.allcommon; - -/** - * The sigleton class that has generate-meta-data(GenMetaData). - * - * @author DBFlute(AutoGenerator) - */ -public class GenMetaData { - - /** Singleton instance. */ - private static final GenMetaData _instance = new GenMetaData(); - - /** - * Constructor. - */ - private GenMetaData() { - } - - /** - * Get instance. - * - * @return Singleton instance. - */ - public static GenMetaData getInstance() { - return _instance; - } - - //========================================================================== - // ========= - // Basic - // ===== - /** - * Get the property-value of targetLanguage. - * - * @return The property-value. - */ - public String getTargetLanguage() { - return "java"; - } - - /** - * Get the property-value of templateFileExtension. - * - * @return The property-value. - */ - public String getTemplateFileExtension() { - return "vm"; - } - - /** - * Get the property-value of classFileExtension. - * - * @return The property-value. - */ - public String getClassFileExtension() { - return "java"; - } - - /** - * Get the property-value of templateFileEncoding. - * - * @return The property-value. - */ - public String getTemplateEncoding() { - return "UTF-8"; - } - - /** - * Get the property-value of classAuthor. - * - * @return The property-value. - */ - public String getClassAuthor() { - return "DBFlute(AutoGenerator)"; - } - - //========================================================================== - // ========= - // Naming - // ====== - /** - * Is java name of table same as db name? Answer is false! - * - * @return The property-value. - */ - public boolean isJavaNameOfTableSameAsDbName() { - return false; - } - - /** - * Is java name of column same as db name? Answer is false! - * - * @return The property-value. - */ - public boolean isJavaNameOfColumnSameAsDbName() { - return false; - } - - //========================================================================== - // ========= - // Prefix - // ====== - /** - * Get the property-value of projectPrefix. - * - * @return The property-value. - */ - public String getProjectPrefix() { - return ""; - } - - /** - * Get the property-value of basePrefix. - * - * @return The property-value. - */ - public String getBasePrefix() { - return "Bs"; - } - - //========================================================================== - // ========= - // Package - // ======= - /** - * Get the property-value of baseCommonPackage. - * - * @return The property-value. - */ - public String getBaseCommonPackage() { - return "jp.sf.pal.board.db.allcommon"; - } - - /** - * Get the property-value of baseBehaviorPackage. - * - * @return The property-value. - */ - public String getBaseBehaviorPackage() { - return "jp.sf.pal.board.db.bsbhv"; - } - - /** - * Get the property-value of baseDaoPackage. - * - * @return The property-value. - */ - public String getBaseDaoPackage() { - return "jp.sf.pal.board.db.bsdao"; - } - - /** - * Get the property-value of baseEntityPackage. - * - * @return The property-value. - */ - public String getBaseEntityPackage() { - return "jp.sf.pal.board.db.bsentity"; - } - - /** - * Get the property-value of conditionBeanPackage. - * - * @return The property-value. - */ - public String getConditionBeanPackage() { - return "jp.sf.pal.board.db.cbean"; - } - - /** - * Get the property-value of extendedDaoPackage. - * - * @return The property-value. - */ - public String getExtendedDaoPackage() { - return "jp.sf.pal.board.db.exdao"; - } - - /** - * Get the property-value of extendedBehaviorPackage. - * - * @return The property-value. - */ - public String getExtendedBehaviorPackage() { - return "jp.sf.pal.board.db.exbhv"; - } - - /** - * Get the property-value of extendedEntityPackage. - * - * @return The property-value. - */ - public String getExtendedEntityPackage() { - return "jp.sf.pal.board.db.exentity"; - } - - //========================================================================== - // ========= - // Optimistic Lock - // =============== - /** - * Get the property-value of updateDateFieldName. - * - * @return The property-value. - */ - public String getUpdateDateFieldName() { - return ""; - } - - /** - * Get the property-value of versionNoFieldName. - * - * @return The property-value. - */ - public String getVersionNoFieldName() { - return ""; - } - - //========================================================================== - // ========= - // Extract - // ======= - /** - * Get the value of 'extractAcceptStartBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptStartBrace() { - return "@{"; - } - - /** - * Get the value of 'extractAcceptEndBrace'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEndBrace() { - return "@}"; - } - - /** - * Get the value of 'extractAcceptDelimiter'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptDelimiter() { - return "@;"; - } - - /** - * Get the value of 'extractAcceptEqual'. - * - * @return The property-value. (NotNull) - */ - public String getExtractAcceptEqual() { - return "@="; - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/annotation/OutsideSql.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,18 +0,0 @@ -package jp.sf.pal.board.db.allcommon.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - - @ Inherited - @ Retention(RetentionPolicy.RUNTIME) - @ Target(ElementType.METHOD) -public @interface OutsideSql { - boolean dynamicBinding() default false; - - boolean offsetByCursor() default false; - - boolean limitByCursor() default false; -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,10 +11,16 @@ import java.util.Set; import jp.sf.pal.board.db.allcommon.BehaviorSelector; -import jp.sf.pal.board.db.allcommon.DaoSelector; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileOutputOption; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractBehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectCountCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectListCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectNextValCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.SelectScalarCBCommand; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelBox; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; @@ -25,8 +31,9 @@ import jp.sf.pal.board.db.allcommon.cbean.PagingHandler; import jp.sf.pal.board.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.board.db.allcommon.cbean.PagingResultBean; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.board.db.allcommon.cbean.ScalarQuery; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.helper.token.file.FileMakingHeaderInfo; import jp.sf.pal.board.db.allcommon.helper.token.file.FileMakingOption; @@ -35,11 +42,10 @@ import jp.sf.pal.board.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.board.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.board.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted. */ - protected void assertEntityNotDeleted( - jp.sf.pal.board.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.board.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.board.db.allcommon.exception.EntityAlreadyDeletedException * @exception jp.sf.pal.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -4,10 +4,25 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.board.db.allcommon.CommonColumnAutoSetupper; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileReflectionFailure; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileReflectionOption; import jp.sf.pal.board.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractListEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchDeleteEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchDeleteNonstrictEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchInsertEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchUpdateEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.BatchUpdateNonstrictEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.DeleteEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.DeleteNonstrictEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.InsertEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.QueryDeleteCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.QueryUpdateEntityCBCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.UpdateEntityCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.UpdateNonstrictEntityCommand; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.allcommon.helper.MapStringBuilder; @@ -20,7 +35,7 @@ import jp.sf.pal.board.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.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorReadable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,6 +1,5 @@ package jp.sf.pal.board.db.allcommon.bhv; -import jp.sf.pal.board.db.allcommon.DaoReadable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/BehaviorWritable.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,6 +1,7 @@ package jp.sf.pal.board.db.allcommon.bhv; -import jp.sf.pal.board.db.allcommon.DaoWritable; +import java.util.List; + import jp.sf.pal.board.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.board.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -132,12 +126,12 @@ * @exception jp.sf.pal.board.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.board.db.allcommon.exception.EntityAlreadyUpdatedException * When the entity has already been updated. And Only when @@ -145,5 +139,5 @@ * @exception jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,71 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,23 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandComponentSetup.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,842 @@ +package jp.sf.pal.board.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.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.InternalMapContext; +import jp.sf.pal.board.db.allcommon.XLog; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.board.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalStatementFactory; +import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.board.db.allcommon.util.SimpleTypeUtil; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorCommandInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,186 @@ +package jp.sf.pal.board.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.board.db.allcommon.DBDef; +import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.board.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("ATTACHMENT", + "jp.sf.pal.board.db.bsentity.dbmeta.AttachmentDbm"); + tmpMap + .put("CATEGORY", + "jp.sf.pal.board.db.bsentity.dbmeta.CategoryDbm"); + tmpMap.put("CATEGORY_ACCESS", + "jp.sf.pal.board.db.bsentity.dbmeta.CategoryAccessDbm"); + tmpMap.put("GROUP_INFO", + "jp.sf.pal.board.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.board.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("MESSAGE", "jp.sf.pal.board.db.bsentity.dbmeta.MessageDbm"); + tmpMap.put("MESSAGE_ATTACHMENT", + "jp.sf.pal.board.db.bsentity.dbmeta.MessageAttachmentDbm"); + tmpMap.put("MESSAGE_CONTENT", + "jp.sf.pal.board.db.bsentity.dbmeta.MessageContentDbm"); + tmpMap.put("REPLY", "jp.sf.pal.board.db.bsentity.dbmeta.ReplyDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.board.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.board.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/BehaviorInitializer.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,9 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecution { + + public Object execute(Object[] args); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,9 @@ +package jp.sf.pal.board.db.allcommon.bhv.core; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface SqlExecutionCreator { + + SqlExecution createSqlExecution(); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/SqlExecutionCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,261 @@ +package jp.sf.pal.board.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.board.db.allcommon.DBDef; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandComponentSetup; +import jp.sf.pal.board.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractBehaviorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,182 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,182 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractListEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,93 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,175 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.bhv.core.execution.OutsideSqlSelectExecution; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractOutsideSqlSelectCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,122 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.execution.SelectCBExecution; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/AbstractSelectCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,51 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchDeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,46 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchInsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,51 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/BatchUpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,51 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/DeleteNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,86 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.board.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.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/InsertEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,152 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlCallCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,128 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlExecuteCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,77 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.sql.ResultSet; +import java.sql.SQLException; + +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectCursorCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,96 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/OutsideSqlSelectListCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,151 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryDeleteCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,140 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/QueryUpdateEntityCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,65 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectCountCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,103 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectListCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,162 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.bhv.core.execution.BasicSelectExecution; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectNextValCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,112 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/SelectScalarCBCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,55 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.command; + +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecutionCreator; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,25 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/command/UpdateNonstrictEntityCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,77 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.execution; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/BasicSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,225 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/OutsideSqlSelectExecution.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,168 @@ +package jp.sf.pal.board.db.allcommon.bhv.core.execution; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/core/execution/SelectCBExecution.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/bhv/load/LoadRefererOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,78 +0,0 @@ -package jp.sf.pal.board.db.allcommon.bhv.load; - -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; -import jp.sf.pal.board.db.allcommon.bhv.setup.EntityListSetupper; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; - -/** - * The class of load referrer option. - * - * @param <REFERRER_CONDITION_BEAN> The type of referrer condition-bean. - * @param <REFERRER_ENTITY> The type of referrer entity. - * @author DBFlute(AutoGenerator) - */ -public class LoadRefererOption<REFERRER_CONDITION_BEAN extends ConditionBean, REFERRER_ENTITY extends Entity> - extends LoadReferrerOption<REFERRER_CONDITION_BEAN, REFERRER_ENTITY> { - - //========================================================================== - // ========= - // Constructor - // =========== - public LoadRefererOption() { - } - - public LoadRefererOption( - ConditionBeanSetupper<REFERRER_CONDITION_BEAN> conditionBeanSetupper) { - super(conditionBeanSetupper); - } - - public LoadRefererOption( - ConditionBeanSetupper<REFERRER_CONDITION_BEAN> conditionBeanSetupper, - EntityListSetupper<REFERRER_ENTITY> entityListSetupper) { - super(conditionBeanSetupper, entityListSetupper); - } - - public LoadRefererOption( - LoadReferrerOption<REFERRER_CONDITION_BEAN, REFERRER_ENTITY> option) { - super(option); - } - - //========================================================================== - // ========= - // Accessor - // ======== - /** - * @return The condition-bean of referrer. - * @deprecated Sorry! This methid have typo! Please use - * getRefererConditionBean(). - */ - public REFERRER_CONDITION_BEAN getReffererConditionBean() { - return super.getReferrerConditionBean(); - } - - /** - * @param referrerConditionBean The condition-bean of referrer. - * @deprecated Sorry! This methid have typo! Please use - * setReferrerConditionBean(). - */ - public void setReffererConditionBean( - REFERRER_CONDITION_BEAN referrerConditionBean) { - super.setReferrerConditionBean(referrerConditionBean); - } - - /** - * @return The condition-bean of referrer. - */ - public REFERRER_CONDITION_BEAN getRefererConditionBean() { - return super.getReferrerConditionBean(); - } - - /** - * @param referrerConditionBean The condition-bean of referrer. - */ - public void setRefererConditionBean( - REFERRER_CONDITION_BEAN referrerConditionBean) { - super.setReferrerConditionBean(referrerConditionBean); - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionBean.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/AbstractConditionQuery.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBean.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,5 +1,7 @@ package jp.sf.pal.board.db.allcommon.cbean; +import java.util.Map; + import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionBeanContext.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,10 +1,6 @@ package jp.sf.pal.board.db.allcommon.cbean; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.Map; - -import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClauseDb2; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ConditionQuery.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface ConditionQuery { //========================================================================== Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,5 @@ +package jp.sf.pal.board.db.allcommon.cbean; + +public interface ScalarQuery<CB extends ConditionBean> { + public void query(CB cb); +} Property changes on: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ScalarQuery.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/SimpleOrderByBean.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,165 +0,0 @@ -package jp.sf.pal.board.db.allcommon.cbean; - -import jp.sf.pal.board.db.allcommon.cbean.sqlclause.OrderByClause; -import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; - -/** - * @deprecated - */ -public class SimpleOrderByBean implements OrderByBean { - - //========================================================================== - // ========= - // Attribute - // ========= - /** SQL clause instance. */ - protected final SqlClause _sqlClause; - { - _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); - } - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public SimpleOrderByBean() { - } - - //========================================================================== - // ========= - // SqlClause - // ========= - /** - * Get sql-clause. - * - * @return Sql clause. (NotNull) - */ - protected SqlClause getSqlClause() { - return _sqlClause; - } - - //========================================================================== - // ========= - // Select Resource - // =============== - /** - * Check safety result. - * - * @param safetyMaxResultSize Safety max result size. (If zero or minus, - * ignore checking) - */ - public void checkSafetyResult(int safetyMaxResultSize) { - throw new UnsupportedOperationException(); - } - - //========================================================================== - // ========= - // OrderBy - // ======= - /** - * The implementation. - * - * @return Sql component of order-by clause. (NotNull) - */ - public OrderByClause getSqlComponentOfOrderByClause() { - return getSqlClause().getSqlComponentOfOrderByClause(); - } - - /** - * The implementation. - * - * @return Order-by clause. (NotNull) - */ - public String getOrderByClause() { - return getSqlClause().getOrderByClause(); - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean clearOrderBy() { - getSqlClause().clearOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean ignoreOrderBy() { - getSqlClause().ignoreOrderBy(); - return this; - } - - /** - * The implementation. - * - * @return this. (NotNull) - */ - public OrderByBean makeOrderByEffective() { - getSqlClause().makeOrderByEffective(); - return this; - } - - /** - * Register order-by-asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByAsc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, true); - return this; - } - - /** - * Register order-by-desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean registerOrderByDesc(String orderByProperty) { - getSqlClause().registerOrderBy(orderByProperty, orderByProperty, false); - return this; - } - - /** - * Reverse order-by or Override order-by asc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByAsc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, true); - return this; - } - - /** - * Reverse order-by or Override order-by desc. - * - * @param orderByProperty Order-by-property. - * 'aliasName.columnName/aliasName.columnName/...' (NotNull) - * @return this. (NotNull) - * @deprecated - */ - public OrderByBean reverseOrderBy_Or_OverrideOrderByDesc( - String orderByProperty) { - getSqlClause().reverseOrderBy_Or_OverrideOrderBy(orderByProperty, - orderByProperty, false); - return this; - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKey.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,104 @@ +package jp.sf.pal.board.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/ckey/ConditionKeyNotLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/FromToOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,5 +1,10 @@ package jp.sf.pal.board.db.allcommon.cbean.coption; +import java.util.Calendar; +import java.util.Date; + +import jp.sf.pal.board.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.board.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.board.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + return ConditionKey.CK_GREATER_EQUAL; } if (_fromDateGreaterThan) { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default - // ! + return ConditionKey.CK_GREATER_THAN;// Default! } else { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default - // ! + return ConditionKey.CK_GREATER_EQUAL;// Default! } } - public jp.sf.pal.board.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.board.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + return ConditionKey.CK_LESS_THAN; } if (_toDateLessThan) { - return jp.sf.pal.board.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default - // ! + return ConditionKey.CK_LESS_THAN;// Default! } else { - return jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/coption/LikeSearchOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -4,6 +4,7 @@ import java.util.Iterator; import java.util.List; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/cvalue/ConditionValue.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -6,9 +6,10 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption; import jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,17 +1,21 @@ package jp.sf.pal.board.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.board.db.allcommon.DBFluteConfig; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.board.db.allcommon.util.SimpleResourceUtil; import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.board.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; + } } Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,37 +0,0 @@ -package jp.sf.pal.board.db.allcommon.cbean.outsidesql; - -import java.util.List; - -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; - -/** - * The dao of outside-sql. - * - * @author DBFlute(AutoGenerator) - */ -public interface OutsideSqlDao extends DaoReadable { - - //========================================================================== - // ========= - // Select - // ====== - <ENTITY> List<ENTITY> selectList(String path, Object pmb, - OutsideSqlOption option, Class<ENTITY> entityType); - - <ENTITY> Object selectCursor(String path, Object pmb, - OutsideSqlOption option, CursorHandler handler); - - //========================================================================== - // ========= - // Execute - // ======= - int execute(String path, Object pmb, OutsideSqlOption option); - - // [DBFlute-0.7.5] - //========================================================================== - // ========= - // Call - // ==== - void call(String path, Object pmb, OutsideSqlOption option); -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,15 +2,20 @@ import java.util.List; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.AbstractOutsideSqlCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlCallCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlExecuteCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.board.db.allcommon.cbean.ListResultBean; import jp.sf.pal.board.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.ProcedurePmb; import jp.sf.pal.board.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.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,12 +1,14 @@ package jp.sf.pal.board.db.allcommon.cbean.outsidesql.executor; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectCursorCommand; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; import jp.sf.pal.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,14 +2,16 @@ import java.util.List; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; import jp.sf.pal.board.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.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.board.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.board.db.allcommon.exception.OutsideSqlNotFoundException - * When the outside-sql is not found. + * When the outside-SQL is not found. * @exception jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException * When the entity has already been deleted(not found). * @exception jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,18 +3,20 @@ import java.util.List; import jp.sf.pal.board.db.allcommon.DBFluteConfig; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommand; +import jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker; +import jp.sf.pal.board.db.allcommon.bhv.core.command.OutsideSqlSelectListCommand; import jp.sf.pal.board.db.allcommon.cbean.ListResultBean; import jp.sf.pal.board.db.allcommon.cbean.PagingBean; import jp.sf.pal.board.db.allcommon.cbean.PagingHandler; import jp.sf.pal.board.db.allcommon.cbean.PagingInvoker; import jp.sf.pal.board.db.allcommon.cbean.PagingResultBean; import jp.sf.pal.board.db.allcommon.cbean.ResultBeanBuilder; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; import jp.sf.pal.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,23 +17,23 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; -import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; import jp.sf.pal.board.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClause.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,7 @@ import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/AbstractDBMeta.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; @@ -22,6 +21,7 @@ import jp.sf.pal.board.db.allcommon.helper.MapListStringImpl; import jp.sf.pal.board.db.allcommon.helper.MapStringBuilder; import jp.sf.pal.board.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.allcommon.util.SimpleAssertUtil; import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMeta.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,117 +1,85 @@ package jp.sf.pal.board.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.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.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("ATTACHMENT", - "jp.sf.pal.board.db.bsentity.dbmeta.AttachmentDbm"); - tmpMap - .put("CATEGORY", - "jp.sf.pal.board.db.bsentity.dbmeta.CategoryDbm"); - tmpMap.put("CATEGORY_ACCESS", - "jp.sf.pal.board.db.bsentity.dbmeta.CategoryAccessDbm"); - tmpMap.put("GROUP_INFO", - "jp.sf.pal.board.db.bsentity.dbmeta.GroupInfoDbm"); - tmpMap.put("GROUP_MAPPING", - "jp.sf.pal.board.db.bsentity.dbmeta.GroupMappingDbm"); - tmpMap.put("MESSAGE", "jp.sf.pal.board.db.bsentity.dbmeta.MessageDbm"); - tmpMap.put("MESSAGE_ATTACHMENT", - "jp.sf.pal.board.db.bsentity.dbmeta.MessageAttachmentDbm"); - tmpMap.put("MESSAGE_CONTENT", - "jp.sf.pal.board.db.bsentity.dbmeta.MessageContentDbm"); - tmpMap.put("REPLY", "jp.sf.pal.board.db.bsentity.dbmeta.ReplyDbm"); - tmpMap.put("ROLE_INFO", - "jp.sf.pal.board.db.bsentity.dbmeta.RoleInfoDbm"); - tmpMap.put("ROLE_MAPPING", - "jp.sf.pal.board.db.bsentity.dbmeta.RoleMappingDbm"); - tmpMap.put("USER_INFO", - "jp.sf.pal.board.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("ATTACHMENT".toLowerCase(), "attachment"); - tmpMap.put("CATEGORY".toLowerCase(), "category"); - tmpMap.put("CATEGORY_ACCESS".toLowerCase(), "categoryAccess"); - tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); - tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); - tmpMap.put("MESSAGE".toLowerCase(), "message"); - tmpMap.put("MESSAGE_ATTACHMENT".toLowerCase(), "messageAttachment"); - tmpMap.put("MESSAGE_CONTENT".toLowerCase(), "messageContent"); - tmpMap.put("REPLY".toLowerCase(), "reply"); - 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("attachment".toLowerCase(), "ATTACHMENT"); - tmpMap.put("category".toLowerCase(), "CATEGORY"); - tmpMap.put("categoryAccess".toLowerCase(), "CATEGORY_ACCESS"); - tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); - tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); - tmpMap.put("message".toLowerCase(), "MESSAGE"); - tmpMap.put("messageAttachment".toLowerCase(), "MESSAGE_ATTACHMENT"); - tmpMap.put("messageContent".toLowerCase(), "MESSAGE_CONTENT"); - tmpMap.put("reply".toLowerCase(), "REPLY"); - 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() { @@ -144,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); @@ -206,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; @@ -229,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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,7 +9,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class HierarchyRequestElement { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceColumn { public String getColumnName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceIterator { public boolean hasNext(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -3,7 +3,6 @@ /** * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public interface HierarchySourceRow { public Object extractColumnValue(HierarchySourceColumn columnInfo); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/ColumnInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class ColumnInfo { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/dbmeta/info/RelationInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,13 +1,14 @@ package jp.sf.pal.board.db.allcommon.dbmeta.info; +import java.util.Map; + import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/MapStringBuilderImpl.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,17 +1,20 @@ package jp.sf.pal.board.db.allcommon.helper; +import java.util.Arrays; +import java.util.List; + import jp.sf.pal.board.db.allcommon.helper.token.line.LineToken; import jp.sf.pal.board.db.allcommon.helper.token.line.LineTokenizingOption; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,201 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringKeyMap.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,233 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/helper/StringSet.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,213 @@ +package jp.sf.pal.board.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.board.db.allcommon.Entity; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/BeanMetaDataFactoryExtension.java ___________________________________________________________________ Name: svn:eol-style + native Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,125 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; - -import org.seasar.extension.jdbc.ResultSetFactory; - -/** - * This is unused in DBFlute so this is very NORMAL result-set-factory for - * S2Dao. - * - * @author DBFlute(AutoGenerator) - */ -public class FetchNarrowingResultSetFactory implements ResultSetFactory { - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - */ - public FetchNarrowingResultSetFactory() { - } - - //========================================================================== - // ========= - // Main - // ==== - /** - * Get result set. - * - * @param statement Statement. (NotNull) - * @return Result set for procedure executing of s2dao. (NotNull) - */ - public ResultSet getResultSet(Statement statement) { // Unused in DBFlute - return doGetResultSet(statement); - } - - /** - * Create result set. - * - * @param ps Prepared statement. (NotNull) - * @return Result set. (NotNull) - */ - public ResultSet createResultSet(PreparedStatement ps) { // Unused in - // DBFlute - return executeQuery(ps); - - // *Move to InternalBasicSelectHandler - // if (!FetchNarrowingBeanContext.isExistFetchNarrowingBeanOnThread()) { - // return resultSet; - // } - // final FetchNarrowingBean cb = - // FetchNarrowingBeanContext.getFetchNarrowingBeanOnThread(); - // if (!isUseFetchNarrowingResultSetWrapper(cb)) { - // return resultSet; - // } - // final FetchNarrowingResultSetWrapper wrapper; - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, - // outsideSqlContext.isOffsetByCursorForcedly(), - // outsideSqlContext.isLimitByCursorForcedly()); - // } else { - // wrapper = new FetchNarrowingResultSetWrapper(resultSet, cb, false, - // false); - // } - // return wrapper; - } - - // protected boolean isUseFetchNarrowingResultSetWrapper(FetchNarrowingBean - // cb) { - // if (cb.getSafetyMaxResultSize() > 0) { - // return true; - // } - // if (!cb.isFetchNarrowingEffective()) { - // return false;// It is not necessary to control. - // } - // if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - // final OutsideSqlContext outsideSqlContext = - // OutsideSqlContext.getOutsideSqlContextOnThread(); - // if (outsideSqlContext.isOffsetByCursorForcedly() || - // outsideSqlContext.isLimitByCursorForcedly()) { - // return true; - // } - // } - // if (cb.isFetchNarrowingSkipStartIndexEffective() || - // cb.isFetchNarrowingLoopCountEffective()) { - // return true; - // } - // return false; - // } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected ResultSet doGetResultSet(Statement statement) { - try { - return statement.getResultSet(); - } catch (SQLException e) { - handleSQLException(e, statement); - return null;// Unreachable! - } - } - - protected ResultSet executeQuery(PreparedStatement ps) { - try { - return ps.executeQuery(); - } catch (SQLException e) { - handleSQLException(e, ps); - return null;// Unreachable! - } - } - - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } -} Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -4,6 +4,7 @@ import java.sql.SQLException; import java.sql.Statement; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBean; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/PropertyTypeFactoryBuilderExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,215 @@ +package jp.sf.pal.board.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.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; + } +} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,116 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import jp.sf.pal.board.db.allcommon.Entity; - -import org.seasar.dao.BeanMetaData; -import org.seasar.dao.impl.BeanMetaDataFactoryImpl; -import org.seasar.dao.impl.BeanMetaDataImpl; - -/** - * BeanMetaDataFactoryImpl for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - @ SuppressWarnings("unchecked") -public class S2BeanMetaDataFactoryImpl extends BeanMetaDataFactoryImpl { - - protected Map<Class<? extends Entity>, BeanMetaData> _metaMap = Collections - .synchronizedMap(new HashMap<Class<? extends Entity>, BeanMetaData>()); - - @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; - } - - @Override - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - @Override - public void initialize() { - final Class myBeanClass = getBeanClass(); - if (isDBFluteEntity(myBeanClass)) { - final BeanMetaData cachedMeta = getMetaFromCache(myBeanClass); - if (cachedMeta == null) { - _metaMap.put(myBeanClass, this); - } - } - super.initialize(); - } - }; - } - - protected boolean isDBFluteEntity(Class beanClass) { - return Entity.class.isAssignableFrom(beanClass); - } - - protected BeanMetaData getMetaFromCache(Class beanClass) { - return _metaMap.get(beanClass); - } - - /** - * 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 - } -} \ No newline at end of file Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoInterceptor.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,1027 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.Arrays; -import java.util.List; - -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.InternalMapContext; -import jp.sf.pal.board.db.allcommon.XLog; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBean; -import jp.sf.pal.board.db.allcommon.cbean.FetchNarrowingBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlOption; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMetaInstanceHandler; -import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException; -import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; -import jp.sf.pal.board.db.allcommon.helper.stacktrace.InvokeNameResult; -import jp.sf.pal.board.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; -import jp.sf.pal.board.db.allcommon.util.TraceViewUtil; - -import org.aopalliance.intercept.MethodInvocation; -import org.seasar.dao.DaoMetaData; -import org.seasar.dao.DaoMetaDataFactory; -import org.seasar.dao.NotSingleRowUpdatedRuntimeException; -import org.seasar.dao.SqlCommand; -import org.seasar.framework.beans.MethodNotFoundRuntimeException; - -/** - * The interceptor of S2Dao for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoInterceptor extends - org.seasar.framework.aop.interceptors.AbstractInterceptor { - - //========================================================================== - // ========= - // Definition - // ========== - /** Serial version UID. (Default) */ - private static final long serialVersionUID = 1L; - - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(S2DaoInterceptor.class); - - //========================================================================== - // ========= - // Attribute - // ========= - /** The factory of DAO meta data. */ - protected DaoMetaDataFactory _daoMetaDataFactory; - - //========================================================================== - // ========= - // Constructor - // =========== - /** - * Constructor. - * - * @param daoMetaDataFactory The factory of DAO meta data. (NotNull) - */ - public S2DaoInterceptor(DaoMetaDataFactory daoMetaDataFactory) { - _daoMetaDataFactory = daoMetaDataFactory; - } - - //========================================================================== - // ========= - // Execute Status Log - // ================== - protected void log(String msg) { - XLog.log(msg); - } - - protected boolean isLogEnabled() { - return XLog.isLogEnabled(); - } - - //========================================================================== - // ========= - // Invoke - // ====== - /** - * Invoke the method. - * - * @param invocation The method invocation. (NotNull) - * @return The result of the method. (Nullable) - * @throws Throwable - */ - public Object invoke(MethodInvocation invocation) throws Throwable { - clearThreadLocal(); - try { - return dispatchInvoking(invocation); - } finally { - clearThreadLocal(); - } - } - - /** - * Dispatch invoking the method. - * - * @param invocation The method invocation. (NotNull) - * @return The result of the method. (Nullable) - * @throws Throwable - */ - protected Object dispatchInvoking(MethodInvocation invocation) - throws Throwable { - final Method method = invocation.getMethod(); - if (!isAbstract(method)) { - return invocation.proceed(); - } - - // - - - - - - - - - - - - - - // Initialize DAO meta data - // - - - - - - - - - - - - - - if (method.getName().equals("initializeDaoMetaData")) { - initializeSqlCommand(invocation); - return null;// The end! (Initilization Only) - } - - // - - - - - - - - - - - - - // Preprocess outside-SQL - // - - - - - - - - - - - - - preprocessOutsideSql(invocation); - - // - - - - - - - - - - - - - - // Preprocess condition-bean - // - - - - - - - - - - - - - - final ConditionBean cb = preprocessConditionBean(invocation); - - // - - - - - - - - - - - // Set up SQL-command - // - - - - - - - - - - - final SqlCommand cmd; - try { - long beforeCmd = 0; - if (isLogEnabled()) { - beforeCmd = System.currentTimeMillis(); - } - cmd = findSqlCommand(invocation); - if (isLogEnabled()) { - final long afterCmd = System.currentTimeMillis(); - if (beforeCmd != afterCmd) { - logSqlCommand(invocation, cmd, beforeCmd, afterCmd); - } - } - } finally { - if (isLogEnabled()) { - logInvocation(invocation); - } - } - - long before = 0; - if (isLogEnabled()) { - before = System.currentTimeMillis(); - } - - // - - - - - - - - - - - // Execute SQL-command - // - - - - - - - - - - - Object ret = null; - try { - ret = cmd.execute(invocation.getArguments()); - } catch (Exception e) { - if (e.getClass().equals(NotSingleRowUpdatedRuntimeException.class)) { - throw new EntityAlreadyUpdatedException( - (NotSingleRowUpdatedRuntimeException) e); - } - throw e; - } finally { - postprocessConditionBean(invocation, cb); - } - final Class<?> retType = method.getReturnType(); - assertRetType(retType, ret); - - if (isLogEnabled()) { - final long after = System.currentTimeMillis(); - logReturn(invocation, retType, ret, before, after); - } - - // - - - - - - - - - - - // Convert and Return! - // - - - - - - - - - - - if (retType.isPrimitive()) { - return org.seasar.framework.util.NumberConversionUtil - .convertPrimitiveWrapper(retType, ret); - } else if (Number.class.isAssignableFrom(retType)) { - return org.seasar.framework.util.NumberConversionUtil - .convertNumber(retType, ret); - } else { - return ret; - } - } - - //========================================================================== - // ========= - // SqlCommand - // ========== - protected void initializeSqlCommand(MethodInvocation invocation) { - final Class<?> targetType = getTargetClass(invocation); - final DaoMetaData dmd = _daoMetaDataFactory.getDaoMetaData(targetType); - if (OutsideSqlDao.class.isAssignableFrom(targetType)) { - return;// Do nothing! - } else { - final Object[] arguments = invocation.getArguments(); - if (arguments != null && arguments.length > 0 - && arguments[0] instanceof String) { - final String methodName = (String) arguments[0]; - try { - dmd.getSqlCommand(methodName); - } catch (MethodNotFoundRuntimeException ignored) { - // Do nothing! - if (isLogEnabled()) { - log("Not Found the method: " + methodName + " msg=" - + ignored.getMessage()); - } - } - return; - } else { - String msg = "The method should have one string argument as method name: " - + invocation; - throw new IllegalStateException(msg); - } - } - } - - protected SqlCommand findSqlCommand(MethodInvocation invocation) { - final SqlCommand cmd; - final Class<?> targetType = getTargetClass(invocation); - final DaoMetaData dmd = _daoMetaDataFactory.getDaoMetaData(targetType); - if (OutsideSqlDao.class.isAssignableFrom(targetType)) { - cmd = dmd - .getSqlCommand(generateSpecifiedOutsideSqlUniqueKey(invocation)); - } else { - cmd = dmd.getSqlCommand(invocation.getMethod().getName()); - } - return cmd; - } - - protected String generateSpecifiedOutsideSqlUniqueKey( - MethodInvocation invocation) { - final Object[] args = invocation.getArguments(); - final String path = (String) args[0]; - final Object pmb = args[1]; - final OutsideSqlOption option = (OutsideSqlOption) args[2]; - Object resultTypeSpecification = null; - if (args.length > 3) { - resultTypeSpecification = args[3]; - } - return OutsideSqlContext.generateSpecifiedOutsideSqlUniqueKey( - invocation.getMethod().getName(), path, pmb, option, - resultTypeSpecification); - } - - //========================================================================== - // ========= - // Log Invocation - // ============== - protected void logInvocation(MethodInvocation invocation) { - final StackTraceElement[] stackTrace = new Exception().getStackTrace(); - final InvokeNameResult behaviorResult = extractBehaviorInvokeName(stackTrace); - - final String invokeClassName; - final String invokeMethodName; - if (!behaviorResult.isEmptyResult()) { - invokeClassName = behaviorResult.getSimpleClassName(); - invokeMethodName = behaviorResult.getMethodName(); - } else { - final Method method = invocation.getMethod(); - invokeClassName = extractInvocationExpression(method); - invokeMethodName = method.getName(); - } - final String expWithoutKakko = buildInvocationExpressionWithoutKakko( - invocation, invokeClassName, invokeMethodName); - - // Save behavior invoke name for error message. - putObjectToMapContext("df:BehaviorInvokeName", expWithoutKakko + "()"); - - final String equalBorder = buildFitBorder("", "=", expWithoutKakko, - false); - final String invocationExpression = expWithoutKakko + "()"; - - log("/=====================================================" - + equalBorder + "=="); - log(" " - + invocationExpression); - log(" " - + equalBorder + "=/"); - - logPath(invocation, stackTrace, behaviorResult); - - // Specified OutsideSql - if (isSpecifiedOutsideSql(invocation)) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (!outsideSqlContext.isProcedure()) {// [DBFlute-0.7.5] - Object[] args = invocation.getArguments(); - if (outsideSqlContext != null) { - log("path: " + outsideSqlContext.getOutsideSqlPath()); - } else { - log("path: " + getOutsideSqlPath(args)); - } - log("option: " + getOutsideSqlOption(args)); - } - } - } - - protected String buildInvocationExpressionWithoutKakko( - MethodInvocation invocation, String invokeClassName, - String invokeMethodName) { - if (invokeClassName.contains("OutsideSql") - && invokeClassName.endsWith("Executor")) { // OutsideSql - // Executor Handling - try { - final String originalName = invokeClassName; - if (isSpecifiedOutsideSql()) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - final String tableDbName = outsideSqlContext - .getTableDbName(); - final DBMeta dbmeta = DBMetaInstanceHandler - .findDBMeta(tableDbName); - final String behaviorTypeName = dbmeta - .getBehaviorTypeName(); - final String behaviorClassName = behaviorTypeName - .substring(behaviorTypeName.lastIndexOf(".") - + ".".length()); - invokeClassName = behaviorClassName + ".outsideSql()"; - if (originalName.endsWith("OutsideSqlEntityExecutor")) { - invokeClassName = invokeClassName + ".entityHandling()"; - } else if (originalName - .endsWith("OutsideSqlPagingExecutor")) { - if (outsideSqlContext.isOffsetByCursorForcedly() - || outsideSqlContext.isLimitByCursorForcedly()) { - 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 invocationExpressionWithoutKakko = invokeClassName + "." - + invokeMethodName; - if ("selectPage".equals(invokeMethodName)) { // Special Handling! - boolean resultTypeInteger = false; - if (isSpecifiedOutsideSql()) { - 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 - || "selectCount".equals(invocation.getMethod().getName())) { - invocationExpressionWithoutKakko = invocationExpressionWithoutKakko - + "():count"; - } else { - invocationExpressionWithoutKakko = invocationExpressionWithoutKakko - + "():paging"; - } - } - return invocationExpressionWithoutKakko; - } - - protected void logPath(MethodInvocation invocation, - 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 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 method The invoked method. (NotNull) - * @return The expression of invocation. (NotNull) - */ - protected String extractInvocationExpression(Method method) { - final Class<?> declaringClass = method.getDeclaringClass(); - return removeBasePrefixFromSimpleClassName(declaringClass - .getSimpleName()); - } - - /** - * @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); - } - - //========================================================================== - // ========= - // Log SqlCommand - // ============== - protected void logSqlCommand(MethodInvocation invocation, SqlCommand cmd, - long beforeCmd, long afterCmd) { - log("SqlCommand Initialization Cost: [" - + TraceViewUtil.convertToPerformanceView(afterCmd - beforeCmd) - + "]"); - } - - protected void assertRetType(Class<?> retType, Object ret) { - if (java.util.List.class.isAssignableFrom(retType)) { - if (ret != null && !(ret instanceof java.util.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); - } - } - } - - //========================================================================== - // ========= - // Log Return - // ========== - protected void logReturn( - org.aopalliance.intercept.MethodInvocation invocation, - Class<?> retType, Object ret, long before, long after) - throws Throwable { - try { - final String daoResultPrefix = "===========/ [" - + TraceViewUtil.convertToPerformanceView(after - before) - + " - "; - if (java.util.List.class.isAssignableFrom(retType)) { - if (ret == null) { - log(daoResultPrefix + "Selected list: null]"); - } else { - final java.util.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 (isSelectCountIgnoreFetchScopeMethod(invocation)) { - log(daoResultPrefix + "Selected count: " + ret + "]"); - } else { - log(daoResultPrefix + "Result: " + ret + "]"); - } - } - log(" "); - } catch (Exception e) { - String msg = "Result object debug threw the exception: methodName="; - msg = msg + invocation.getMethod().getName() + " retType=" - + retType; - msg = msg + " ret=" + ret; - _log.warn(msg, e); - throw e; - } - } - - //========================================================================== - // ========= - // Pre Post Process - // ================ - // ----------------------------------------------------- - // OutsideSql - // ---------- - protected void preprocessOutsideSql(MethodInvocation invocation) { - final Class<jp.sf.pal.board.db.allcommon.annotation.OutsideSql> outsideSqlType = jp.sf.pal.board.db.allcommon.annotation.OutsideSql.class; - final jp.sf.pal.board.db.allcommon.annotation.OutsideSql outsideSql = invocation - .getMethod().getAnnotation(outsideSqlType); - - // Traditional OutsideSql - if (outsideSql != null - && (outsideSql.dynamicBinding() || outsideSql.offsetByCursor() - || outsideSql.offsetByCursor() || outsideSql - .limitByCursor())) { - final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); - outsideSqlContext.setDynamicBinding(outsideSql.dynamicBinding()); - outsideSqlContext.setOffsetByCursorForcedly(outsideSql - .offsetByCursor()); - outsideSqlContext.setLimitByCursorForcedly(outsideSql - .limitByCursor()); - OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); - - // Set up fetchNarrowingBean. - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return; - } - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(args[0] - .getClass())) { - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) args[0]); - } - return; - } - - // Specified OutsideSql - if (isSpecifiedOutsideSql(invocation)) { - if (isOutsideSqlDaoMethodSelect(invocation)) { - setupOutsideSqlContextSelect(invocation); - } else { - setupOutsideSqlContextExecute(invocation); - } - return; - } - } - - protected boolean isSpecifiedOutsideSql(MethodInvocation invocation) { - return OutsideSqlDao.class.isAssignableFrom(getTargetClass(invocation)); - } - - // - - - - - - - - - - - - - // Select - // - - - - protected boolean isOutsideSqlDaoMethodSelect(MethodInvocation invocation) { - return invocation.getMethod().getName().startsWith("select"); - } - - protected void setupOutsideSqlContextSelect(MethodInvocation invocation) { - final Object[] args = invocation.getArguments(); - if (args.length != 4) { - String msg = "Internal Error! OutsideSqlDao.selectXxx() should have 4 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - final String path = getOutsideSqlPath(args); - final Object pmb = getOutsideSqlParameterBean(args); - final OutsideSqlOption option = getOutsideSqlOption(args); - final Object resultTypeSpecification = args[3]; - final OutsideSqlContext outsideSqlContext = new OutsideSqlContext(); - outsideSqlContext.setDynamicBinding(option.isDynamicBinding()); - outsideSqlContext.setOffsetByCursorForcedly(option.isAutoPaging()); - outsideSqlContext.setLimitByCursorForcedly(option.isAutoPaging()); - outsideSqlContext.setOutsideSqlPath(path); - outsideSqlContext.setParameterBean(pmb); - outsideSqlContext.setResultTypeSpecification(resultTypeSpecification); - outsideSqlContext.setMethodName(invocation.getMethod().getName()); - outsideSqlContext.setStatementConfig(option.getStatementConfig()); - outsideSqlContext.setTableDbName(option.getTableDbName()); - outsideSqlContext.setupBehaviorQueryPathIfNeeds(); - OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); - - // Set up fetchNarrowingBean. - setupOutsideSqlFetchNarrowingBean(pmb, option); - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupOutsideSqlContextExecute(MethodInvocation invocation) { - final Object[] args = invocation.getArguments(); - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - final String path = getOutsideSqlPath(args); - final Object pmb = getOutsideSqlParameterBean(args); - final OutsideSqlOption option = getOutsideSqlOption(args); - 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(invocation.getMethod().getName()); - outsideSqlContext.setStatementConfig(option.getStatementConfig()); - outsideSqlContext.setTableDbName(option.getTableDbName()); - outsideSqlContext.setupBehaviorQueryPathIfNeeds(); - OutsideSqlContext.setOutsideSqlContextOnThread(outsideSqlContext); - - // Set up fetchNarrowingBean. - setupOutsideSqlFetchNarrowingBean(pmb, option); - } - - // - - - - - - - - - - - - - // Common - // - - - - protected String getOutsideSqlPath(Object[] args) { - return (String) args[0]; - } - - protected Object getOutsideSqlParameterBean(Object[] args) { - return args[1]; - } - - protected OutsideSqlOption getOutsideSqlOption(Object[] args) { - return (OutsideSqlOption) args[2]; - } - - 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); - } - - // ----------------------------------------------------- - // ConditionBean - // ------------- - /** - * Pre-process conditionBean. - * <p> - * If this method is condition bean select target, make dynamic SQL. Else - * nothing. - * - * @param invocation Method invocation. (NotNull) - * @return ConditionBean. (Nullable) - */ - protected ConditionBean preprocessConditionBean(MethodInvocation invocation) { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - if (outsideSqlContext != null) { - return null; // Because it has already finished setting up - // fetchNarrowingBean for outsideSql here. - } - - final ConditionBean cb; - { - final Object[] args = invocation.getArguments(); - if (args == null || args.length == 0) { - return null; - } - final Object arg0 = args[0]; - if (arg0 == null) { - return null; - } - if (!ConditionBeanContext.isTheTypeConditionBean(arg0.getClass())) {// The - // argument - // is - // not - // condition - // - - // bean - // ... - if (FetchNarrowingBeanContext.isTheTypeFetchNarrowingBean(arg0 - .getClass()) - && !isSelectCountIgnoreFetchScopeMethod(invocation)) { - // Fetch-narrowing-bean and Not select count! - FetchNarrowingBeanContext - .setFetchNarrowingBeanOnThread((FetchNarrowingBean) arg0); - } - return null; - } - cb = (ConditionBean) arg0; - } - - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xsetupSelectCountIgnoreFetchScope(); - } else { - FetchNarrowingBeanContext.setFetchNarrowingBeanOnThread(cb); - } - - ConditionBeanContext.setConditionBeanOnThread(cb); - return cb; - } - - /** - * Post-process condition-bean. - * - * @param invocation Method invocation. (NotNull) - * @param cb Condition-bean. (Nullable) - */ - protected void postprocessConditionBean(MethodInvocation invocation, - ConditionBean cb) { - if (cb == null) { - return; - } - if (isSelectCountIgnoreFetchScopeMethod(invocation)) { - cb.xafterCareSelectCountIgnoreFetchScope(); - } - } - - // ----------------------------------------------------- - // Clear Thread Local - // ------------------ - protected void clearThreadLocal() { - 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(); - } - } - - //========================================================================== - // ========= - // Context Helper - // ============== - protected OutsideSqlContext getOutsideSqlContext() { - if (!OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - return null; - } - return OutsideSqlContext.getOutsideSqlContextOnThread(); - } - - protected boolean isSpecifiedOutsideSql() { - final OutsideSqlContext outsideSqlContext = getOutsideSqlContext(); - return outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql(); - } - - protected void putObjectToMapContext(String key, Object value) { - InternalMapContext.setObject(key, value); - } - - //========================================================================== - // ========= - // Determination - // ============= - /** - * Is select count ignore-fetch-scope method? - * - * @param invocation Method invocation. (NotNull) - * @return Determination. - */ - protected boolean isSelectCountIgnoreFetchScopeMethod( - MethodInvocation invocation) { - final String name = invocation.getMethod().getName(); - return name.startsWith("readCount") || name.startsWith("selectCount"); - } - - //========================================================================== - // ========= - // General Helper - // ============== - /** - * Is the method abstract? - * - * @param method Method. (NotNull) - * @return Determination. (NotNull) - */ - public boolean isAbstract(Method method) { - final int mod = method.getModifiers(); - return Modifier.isAbstract(mod); - } - - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected String getLineSeparator() { - return System.getProperty("line.separator"); - } -} \ No newline at end of file Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,20 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import jp.sf.pal.board.db.allcommon.jdbc.LatestSqlProvider; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -/** - * The provider of latest SQL as S2Dao. This instance should be singleton. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoLatestSqlProvider implements LatestSqlProvider { - - public String getDisplaySql() { - return InternalSqlLogRegistry.peekCompleteSql(); - } - - public void clearSqlCache() { - InternalSqlLogRegistry.clearSqlLogRegistry(); - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,1460 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.board.db.allcommon.BehaviorSelector; -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.db.allcommon.annotation.OutsideSql; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; -import jp.sf.pal.board.db.allcommon.exception.BatchEntityAlreadyUpdatedException; -import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException; -import jp.sf.pal.board.db.allcommon.exception.EntityDuplicatedException; -import jp.sf.pal.board.db.allcommon.jdbc.CursorHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; -import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalRowCreator; -import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; - -import org.seasar.dao.BeanEnhancer; -import org.seasar.dao.BeanMetaData; -import org.seasar.dao.BeanMetaDataFactory; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.RelationPropertyTypeFactoryBuilder; -import org.seasar.dao.RelationRowCreator; -import org.seasar.dao.RowCreator; -import org.seasar.dao.SqlCommand; -import org.seasar.dao.TableNaming; -import org.seasar.dao.dbms.DbmsManager; -import org.seasar.dao.impl.BeanMetaDataImpl; -import org.seasar.dao.impl.DaoMetaDataImpl; -import org.seasar.dao.impl.ResultSetHandlerFactoryImpl; -import org.seasar.dao.impl.SelectDynamicCommand; -import org.seasar.dao.impl.UpdateAutoStaticCommand; -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; -import org.seasar.framework.beans.MethodNotFoundRuntimeException; -import org.seasar.framework.beans.factory.BeanDescFactory; -import org.seasar.framework.util.MethodUtil; - -/** - * The extension of DaoMetaDataImpl for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - @ SuppressWarnings("unchecked") -public class S2DaoMetaDataExtension extends DaoMetaDataImpl { - - //========================================================================== - // ========= - // Definition - // ========== - /** Log instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(S2DaoMetaDataExtension.class); - - //========================================================================== - // ========= - // Attribute - // ========= - /** Bean enhancer. */ - protected BeanEnhancer beanEnhancer; - - /** The factory of annotation reader. */ - protected org.seasar.dao.AnnotationReaderFactory annotationReaderFactory; - - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The selector of behavior. {Since DBFlute-0.7.1} */ - protected BehaviorSelector _behaviorSelector; - - /** The lock monitor of method initialization. */ - protected Object _methodInitializationLockMonitor = new Object(); - - /** The determination of internal debug. {Since DBFlute-0.6.2} */ - protected boolean _internalDebug; - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataExtension() { - } - - //========================================================================== - // ========= - // Initialize Override - // =================== - @Override - public void initialize() { - beanClass = daoAnnotationReader.getBeanClass(); - daoInterface = getDaoInterface(daoClass); - daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final Connection conn = getConnection();// It is first impact to - // Database! - try { - final DatabaseMetaData dbMetaData = getMetaData(conn); - dbms = DbmsManager.getDbms(getDatabaseProductName(dbMetaData)); - } finally { - close(conn); - } - this.beanMetaData = beanMetaDataFactory.createBeanMetaData( - daoInterface, beanClass); - checkSingleRowUpdateForAll = daoAnnotationReader - .isCheckSingleRowUpdate(); - - // Comment out for lazy-load! - // setupSqlCommand(); - } - - //========================================================================== - // ========= - // SqlCommand Setup Override - // ========================= - @Override - public SqlCommand getSqlCommand(String methodName) - throws MethodNotFoundRuntimeException { - SqlCommand cmd = (SqlCommand) sqlCommands.get(methodName); - if (cmd != null) { - return cmd; - } - synchronized (_methodInitializationLockMonitor) { - cmd = (SqlCommand) sqlCommands.get(methodName); - if (cmd != null) { - if (_log.isDebugEnabled()) { - _log - .debug("...Getting sqlCommand as cache because the previous thread have already initilized."); - } - return cmd; - } - if (_log.isDebugEnabled()) { - _log.debug("...Initializing sqlCommand for " + methodName - + "()."); - } - cmd = initializeSqlCommand(methodName); - } - return cmd; - } - - protected SqlCommand initializeSqlCommand(String methodName) - throws MethodNotFoundRuntimeException { - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext outsideSqlContext = OutsideSqlContext - .getOutsideSqlContextOnThread(); - if (outsideSqlContext != null - && outsideSqlContext.isSpecifiedOutsideSql()) { - return initializeSpecifiedOutsideSqlCommand(methodName, - outsideSqlContext); - } - } - final Method[] methods = daoBeanDesc.getMethods(methodName); - if (methods.length == 1 && MethodUtil.isAbstract(methods[0])) { - setupMethod(methods[0]); - } - final SqlCommand cmd = (SqlCommand) sqlCommands.get(methodName); - if (cmd != null) { - return cmd; - } - throw new MethodNotFoundRuntimeException(daoClass, methodName, null); - } - - protected SqlCommand initializeSpecifiedOutsideSqlCommand( - String sqlCommandKey, OutsideSqlContext outsideSqlContext) - throws MethodNotFoundRuntimeException { - final Method[] methods = daoBeanDesc.getMethods(outsideSqlContext - .getMethodName());// By real method name. - if (methods.length == 1 - && org.seasar.framework.util.MethodUtil.isAbstract(methods[0])) { - final Method method = methods[0]; - if (isOutsideSqlDaoMethodSelect(method)) { - setupSpecifiedOutsideSqlSelectCommand(sqlCommandKey, method, - outsideSqlContext); - } else if (isOutsideSqlDaoMethodCall(method)) { - setupSpecifiedOutsideSqlCallCommand(sqlCommandKey, method, - outsideSqlContext); - } else { - setupSpecifiedOutsideSqlExecuteCommand(sqlCommandKey, method, - outsideSqlContext); - } - } - final SqlCommand cmd = (SqlCommand) sqlCommands.get(sqlCommandKey); - if (cmd != null) { - return cmd; - } - String msg = "Internal Error! The sql-command is not found:"; - msg = msg + " sqlCommandKey=" + sqlCommandKey; - msg = msg + " sqlCommands=" + sqlCommands; - throw new IllegalStateException(msg); - } - - protected boolean isOutsideSqlDaoMethodSelect(Method method) { - return method.getName().startsWith("select"); - } - - protected boolean isOutsideSqlDaoMethodCall(Method method) { - return method.getName().startsWith("call"); - } - - //========================================================================== - // ========= - // Assert Override - // =============== - @Override - protected void setupMethodByAnnotation(Class daoInterface, Method method) { - final String sql = daoAnnotationReader.getSQL(method, dbms.getSuffix()); - assertSQLAnnotationUnsupported(method, sql); - super.setupMethodByAnnotation(daoInterface, method); - } - - protected void assertSQLAnnotationUnsupported(final Method method, - String sql) { - if (sql != null) { - throwS2DaoSQLAnnotationUnsupportedException(method, sql); - } - } - - protected void throwS2DaoSQLAnnotationUnsupportedException( - final Method method, String sql) { - String msg = "Look! Read the message below." + getLineSeparator(); - msg = msg - + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" - + getLineSeparator(); - msg = msg - + "Sorry, the SQL annotation of S2Dao is unsupported on DBFlute!" - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Advice]" + getLineSeparator(); - msg = msg + "Please use outside-sql of behavior." + getLineSeparator(); - msg = msg + " For example:" + getLineSeparator(); - msg = msg + " memberBhv.outsideSql().selectList(...)" - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "If you've got to use it, you can set the property:" - + getLineSeparator(); - msg = msg + "{torque.isCompatibleS2DaoSQLAnnotationValid = true}" - + getLineSeparator(); - msg = msg + "But pay attention to version up of DBFlute" - + getLineSeparator(); - msg = msg - + " because the property will not always supported at the future." - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[Method]" + getLineSeparator() + method - + getLineSeparator(); - msg = msg + getLineSeparator(); - msg = msg + "[SQL]" + getLineSeparator() + sql + getLineSeparator(); - msg = msg + "* * * * * * * * * */"; - throw new UnsupportedOperationException(msg); - } - - @Override - protected void setupMethodByAuto(Method method) { - final OutsideSql outsideSql = method.getAnnotation(OutsideSql.class); - if (outsideSql != null) { - String msg = "This method '" + method.getName() - + "()' should use Outside Sql but the file was not found!"; - msg = msg + " Expected sql file name is '" - + method.getDeclaringClass().getSimpleName() + "_" - + method.getName() + ".sql'"; - throw new IllegalStateException(msg); - } - super.setupMethodByAuto(method); - } - - //========================================================================== - // ========= - // ConditionBean Override - // ====================== - @Override - protected void setupSelectMethodByAuto(final Method method) { - if (setupInternalSelectMethodSequenceNextVal(method)) { // For sequence - return; - } - if (setupInternalSelectMethodEntityByIdsForBuri(method)) { // For Buri - return; - } - - // Assert unsupported - final String query = daoAnnotationReader.getQuery(method); - assertQueryAnnotationUnsupported(method, query); - final String[] argNames = daoAnnotationReader.getArgNames(method); - assertAutoQueryByArgsAnnotationUnsupported(method, argNames); - - // Here it is the only method that the argument is DTO. - final ResultSetHandler handler = createResultSetHandler(method); - final SqlCommand cmd = setupInternalNonQuerySelectMethodByDto(method, - handler); - - putSqlCommand(method.getName(), cmd); - } - - protected boolean setupInternalSelectMethodSequenceNextVal( - final Method method) { // For sequence - if (!"selectNextVal".equals(method.getName())) { - return false; - } - 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() - + " method=" + method; - 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() + " method=" + method; - throw new IllegalStateException(msg); - } - setupSelectMethodByManual(method, nextValSql); - return true; - } - - protected boolean setupInternalSelectMethodEntityByIdsForBuri( - final Method method) { // For Buri - if (!"getEntityByIds".equals(method.getName())) { - return false; - } - final ResultSetHandler handler = createResultSetHandler(method); - final String[] argNames = daoAnnotationReader.getArgNames(method); - final String query = daoAnnotationReader.getQuery(method); - if (query == null) { - String msg = "The method 'getEntityByIds()' should have QUERY annotation:"; - msg = msg + " method=" + method; - throw new IllegalStateException(msg); - } - final Class[] types = method.getParameterTypes(); - final SelectDynamicCommand cmd = createSelectDynamicCommand(handler, - query); - cmd.setArgNames(argNames); - cmd.setArgTypes(types); - putSqlCommand(method.getName(), cmd); - return true; - } - - protected void assertQueryAnnotationUnsupported(final Method method, - String query) { - if (query != null) { - String msg = "Sorry! The QUERY annotation of S2Dao is unsupported on DBFlute:"; - msg = msg + " query=" + query + " method=" + method; - throw new UnsupportedOperationException(msg); - } - } - - protected void assertAutoQueryByArgsAnnotationUnsupported( - final Method method, String[] argNames) { - if (!isAutoSelectSqlByDto(method, argNames)) { - String msg = "Sorry! The auto query by ARGS annotation of S2Dao is unsupported on DBFlute:"; - msg = msg + " argNames=" + argNames + " method=" + method; - throw new UnsupportedOperationException(msg); - } - } - - // For condition-bean! - protected SqlCommand setupInternalNonQuerySelectMethodByDto(Method method, - ResultSetHandler handler) { - final Class[] argTypes = method.getParameterTypes(); - assertAutoQueryByDtoUnsupported(method, argTypes); - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(handler); - cmd.setArgNames(new String[] { "dto" }); - cmd.setArgTypes(argTypes); - return cmd; - } - - protected void assertAutoQueryByDtoUnsupported(final Method method, - Class[] argTypes) { - final Class firstArgType = argTypes[0]; - if (!ConditionBeanContext.isTheTypeConditionBean(firstArgType)) { - String msg = "Sorry! The auto query by DTO of S2Dao is unsupported on DBFlute:"; - msg = msg + " dto=" + firstArgType + " method=" + method; - throw new UnsupportedOperationException(msg); - } - } - - //========================================================================== - // ========= - // Insert and Update and Delete By Auto Override - // ============================================= - // ----------------------------------------------------- - // Insert - // ------ - @Override - protected void setupInsertMethodByAuto(final Method method) { - checkAutoUpdateMethod(method); - final String[] propertyNames = getPersistentPropertyNames(method); - final SqlCommand command; - if (isUpdateSignatureForBean(method)) { - final InternalInsertAutoDynamicCommand cmd = new InternalInsertAutoDynamicCommand(); - cmd.setBeanMetaData(getBeanMetaData()); - cmd.setDataSource(dataSource); - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - cmd.setPropertyNames(propertyNames); - cmd.setStatementFactory(statementFactory); - cmd.setCheckSingleRowUpdate(isCheckSingleRowUpdate(method)); - command = cmd; - } else { - boolean returningRows = false; - if (int[].class.isAssignableFrom(method.getReturnType())) { - returningRows = true; - } - final InternalInsertBatchAutoStaticCommand cmd = new InternalInsertBatchAutoStaticCommand( - dataSource, statementFactory, getBeanMetaData(), - propertyNames, returningRows); - command = cmd; - } - putSqlCommand(method.getName(), command); - } - - // ----------------------------------------------------- - // Update - // ------ - @Override - protected void setupUpdateMethodByAuto(final Method method) { - if (isFirstArgumentConditionBean(method)) { - final SqlCommand cmd = new InternalUpdateQueryAutoDynamicCommand( - dataSource, statementFactory); - putSqlCommand(method.getName(), cmd); - return; - } - checkAutoUpdateMethod(method); - final String[] propertyNames = getPersistentPropertyNames(method); - SqlCommand cmd; - if (isUpdateSignatureForBean(method)) { - if (isUnlessNull(method.getName())) { - cmd = createInternalUpdateAutoDynamicCommand(method, - propertyNames); - } else if (isModifiedOnly(method.getName())) { - cmd = createInternalUpdateModifiedOnlyCommand(method, - propertyNames); - } else { - cmd = createInternalUpdateAutoStaticCommand(method, - propertyNames); - } - } else { - boolean returningRows = false; - if (int[].class.isAssignableFrom(method.getReturnType())) { - returningRows = true; - } - cmd = createInternalUpdateBatchAutoStaticCommand(method, - propertyNames, returningRows); - } - putSqlCommand(method.getName(), cmd); - } - - protected UpdateAutoStaticCommand createInternalUpdateAutoStaticCommand( - final Method method, final String[] propertyNames) { - final UpdateAutoStaticCommand cmd = new UpdateAutoStaticCommand( - dataSource, statementFactory, beanMetaData, propertyNames); - cmd.setCheckSingleRowUpdate(isCheckSingleRowUpdate(method)); - return cmd; - } - - protected InternalUpdateAutoDynamicCommand createInternalUpdateAutoDynamicCommand( - Method method, String[] propertyNames) { - final InternalUpdateAutoDynamicCommand cmd = newUpdateAutoDynamicCommand( - method, dataSource, statementFactory); - cmd.setBeanMetaData(createBeanMetaData4UpdateDeleteByAuto(method));// Extension - // Point - // ! - cmd.setPropertyNames(propertyNames); - cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - cmd - .setVersionNoAutoIncrementOnMemory(isUpdateVersionNoAutoIncrementOnMemory(method)); - return cmd; - } - - protected InternalUpdateAutoDynamicCommand newUpdateAutoDynamicCommand( - Method method, DataSource ds, StatementFactory sf) { - return new InternalUpdateAutoDynamicCommand(ds, sf); - } - - protected InternalUpdateModifiedOnlyCommand createInternalUpdateModifiedOnlyCommand( - final Method method, final String[] propertyNames) { - final InternalUpdateModifiedOnlyCommand cmd = newInternalUpdateModifiedOnlyCommand( - method, dataSource, statementFactory); - cmd.setBeanMetaData(createBeanMetaData4UpdateDeleteByAuto(method));// Extension - // Point - // ! - cmd.setPropertyNames(propertyNames); - cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - cmd - .setVersionNoAutoIncrementOnMemory(isUpdateVersionNoAutoIncrementOnMemory(method)); - return cmd; - } - - protected InternalUpdateModifiedOnlyCommand newInternalUpdateModifiedOnlyCommand( - Method method, DataSource ds, StatementFactory sf) { - return new InternalUpdateModifiedOnlyCommand(ds, sf); - } - - protected InternalUpdateBatchAutoStaticCommand createInternalUpdateBatchAutoStaticCommand( - final Method method, final String[] propertyNames, - boolean returningRows) { - return new InternalUpdateBatchAutoStaticCommand(dataSource, - statementFactory, - createBeanMetaData4UpdateDeleteByAuto(method), propertyNames, - returningRows, isUpdateVersionNoAutoIncrementOnMemory(method)) { - @Override - protected InternalUpdateBatchAutoHandler newInternalBatchAutoHandler() { - return new InternalUpdateBatchAutoHandler(getDataSource(), - getStatementFactory(), getBeanMetaData(), - getPropertyTypes()) { - @Override - protected int[] executeBatch(PreparedStatement ps, - List<?> list) { - final int[] result = super.executeBatch(ps, list); - try { - handleBatchUpdateResultWithOptimisticLock(ps, list, - result, method); - } catch (SQLException e) { - handleSQLException(e, ps, false); - return null;// Unreachable! - } - return result; - } - }; - } - }; - } - - // ----------------------------------------------------- - // Delete - // ------ - @Override - protected void setupDeleteMethodByAuto(final Method method) { - if (isFirstArgumentConditionBean(method)) { - final SqlCommand cmd = new InternalDeleteQueryAutoDynamicCommand( - dataSource, statementFactory); - putSqlCommand(method.getName(), cmd); - return; - } - checkAutoUpdateMethod(method); - final String[] propertyNames = getPersistentPropertyNames(method); - final SqlCommand cmd; - if (isUpdateSignatureForBean(method)) { - cmd = createInternalDeleteAutoStaticCommand(method, propertyNames); - } else { - boolean returningRows = false; - if (int[].class.isAssignableFrom(method.getReturnType())) { - returningRows = true; - } - cmd = createInternalDeleteBatchAutoStaticCommand(method, - propertyNames, returningRows); - } - putSqlCommand(method.getName(), cmd); - } - - protected InternalDeleteAutoStaticCommand createInternalDeleteAutoStaticCommand( - final Method method, final String[] propertyNames) { - final InternalDeleteAutoStaticCommand cmd = new InternalDeleteAutoStaticCommand( - dataSource, statementFactory, - createBeanMetaData4UpdateDeleteByAuto(method), propertyNames); - cmd.setCheckSingleRowUpdate(!isNonstrictMethod(method)); - return cmd; - } - - protected InternalDeleteBatchAutoStaticCommand createInternalDeleteBatchAutoStaticCommand( - final Method method, final String[] propertyNames, - boolean returningRows) { - return new InternalDeleteBatchAutoStaticCommand(dataSource, - statementFactory, - createBeanMetaData4UpdateDeleteByAuto(method), propertyNames, - returningRows) { - @Override - protected InternalDeleteBatchAutoHandler newInternalBatchAutoHandler() { - return new InternalDeleteBatchAutoHandler(getDataSource(), - getStatementFactory(), getBeanMetaData(), - getPropertyTypes()) { - @Override - protected int[] executeBatch(PreparedStatement ps, - List<?> list) { - final int[] result = super.executeBatch(ps, list); - try { - handleBatchUpdateResultWithOptimisticLock(ps, list, - result, method); - } catch (SQLException e) { - handleSQLException(e, ps, false); - return null;// Unreachable! - } - return result; - } - }; - } - }; - } - - // ----------------------------------------------------- - // Common Helper - // ------------- - protected BeanMetaData createBeanMetaData4UpdateDeleteByAuto(Method method) { - if (isNonstrictMethod(method)) { - return createNonConcurrencyBmdFactory().createBeanMetaData( - getBeanClass()); - } else { - return getBeanMetaData(); - } - } - - protected boolean isUpdateVersionNoAutoIncrementOnMemory(Method method) { - return !isNonstrictMethod(method); - } - - protected boolean isNonstrictMethod(Method method) { - return method.getName().contains("Nonstrict"); - } - - protected BeanMetaDataFactory createNonConcurrencyBmdFactory() { - final S2BeanMetaDataFactoryImpl nonConcurrencyBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return new BeanMetaDataImpl() { - public boolean hasVersionNoPropertyType() { - return false; - } - - public boolean hasTimestampPropertyType() { - return false; - } - }; - } - }; - nonConcurrencyBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - nonConcurrencyBmdFactory - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - nonConcurrencyBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - nonConcurrencyBmdFactory.setTableNaming(this.tableNaming); - nonConcurrencyBmdFactory.setDataSource(this.dataSource); - nonConcurrencyBmdFactory - .setDaoNamingConvention(this.daoNamingConvention); - nonConcurrencyBmdFactory.setBeanEnhancer(this.beanEnhancer); - return nonConcurrencyBmdFactory; - } - - protected boolean isFirstArgumentConditionBean(final Method method) { - final Class<?>[] pmbTypes = method.getParameterTypes(); - return pmbTypes.length > 0 - && ConditionBean.class.isAssignableFrom(pmbTypes[0]); - } - - protected void handleBatchUpdateResultWithOptimisticLock( - PreparedStatement ps, List<?> list, int[] result, Method method) - throws SQLException { - if (ConditionBeanContext.isOracle()) { - final int updateCount = ps.getUpdateCount(); - handleBatchUpdateResultWithOptimisticLockByUpdateCount(list, - updateCount, method); - } else { - handleBatchUpdateResultWithOptimisticLockByResult(list, result, - method); - } - } - - protected void handleBatchUpdateResultWithOptimisticLockByUpdateCount( - List<?> list, int updateCount, Method method) { - if (list.isEmpty()) { - return;// for Safety! - } - if (updateCount < 0) { - return;// for Safety! - } - final int entityCount = list.size(); - if (updateCount < entityCount) { - if (isNonstrictMethod(method)) { - String msg = "The entity have already deleted:"; - msg = msg + " updateCount=" + updateCount; - msg = msg + " entityCount=" + entityCount; - msg = msg + " allEntities=" + list; - throw new EntityAlreadyDeletedException(msg); - } else { - throw new BatchEntityAlreadyUpdatedException(list.get(0), 0, - updateCount); - } - } - } - - protected void handleBatchUpdateResultWithOptimisticLockByResult( - List<?> list, Object result, Method method) { - if (list.isEmpty()) { - return;// for Safety! - } - if (!(result instanceof int[])) { - return;// for Safety! - } - final int[] updatedCountArray = (int[]) 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; - } - if (alreadyUpdated) { - int updateCount = 0; - for (int oneUpdateCount : updatedCountArray) { - updateCount = updateCount + oneUpdateCount; - } - if (isNonstrictMethod(method)) { - 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); - } else { - throw new BatchEntityAlreadyUpdatedException(list.get(index), - 0, updateCount); - } - } - } - - //========================================================================== - // ========= - // OutsideSql Override - // =================== - // ----------------------------------------------------- - // Normal OutsideSql - // ----------------- - @Override - protected void setupSelectMethodByManual(Method method, String sql) { - final Class<?>[] pmbTypes = method.getParameterTypes(); - final String[] argNames = this.daoAnnotationReader.getArgNames(method); - final Class<?>[] argTypes; - if (pmbTypes != null - && pmbTypes.length > 0 - && CursorHandler.class - .isAssignableFrom(pmbTypes[pmbTypes.length - 1])) { - argTypes = new Class<?>[pmbTypes.length - 1]; - for (int i = 0; i < pmbTypes.length - 1; i++) { - argTypes[i] = pmbTypes[i]; - } - } else { - argTypes = pmbTypes; - } - final BeanMetaData myBeanMetaData = getOutsideSqlBeanMetaData(method); - registerSqlCommand(method.getName(), method, sql, argNames, argTypes, - myBeanMetaData); - } - - protected BeanMetaData getOutsideSqlBeanMetaData(Method method) { - final Class beanClass4SelectMethodByManual = getOutsideSqlDefaultBeanClass(method); - if (beanClass4SelectMethodByManual.equals(getBeanClass())) { - return getBeanMetaData(); - } - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - @Override - protected void setupUpdateMethodByManual(Method method, final String sql) { - // DBFlute Extesion does not exist. Because DBFlute methods don't use - // this! - // The insert/update/delete methods on DAO interface as outside SQL are - // target. - // And especially NonPrimaryInsertMethod uses this for using S2Dao's - // BindVariableNode. - super.setupUpdateMethodByManual(method, sql); - } - - // ----------------------------------------------------- - // Specified OutsideSql - // -------------------- - // - - - - - - - - - - - - - // Select - // - - - - protected void setupSpecifiedOutsideSqlSelectCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - final Object pmb = outsideSqlContext.getParameterBean(); - final Object resultTypeSpecification = outsideSqlContext - .getResultTypeSpecification(); - - // - - - - - - - - - - - - - - - - // 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 customized BeanMetaData. - // - - - - - - - - - - - - - - - - - final Class<?> lastestArguementType = method.getParameterTypes()[method - .getParameterTypes().length - 1]; - final ResultSetHandler myResultSetHandler; - if (Class.class.isAssignableFrom(lastestArguementType)) { - // - - - - - - - - - // EntityHandling - // - - - - - - - - - final Class<?> customizeEntityType = (Class<?>) resultTypeSpecification; - final BeanMetaData myBeanMetaData = createSpecifiedOutsideSqlCustomizeBeanMetaData(customizeEntityType); - if (List.class.isAssignableFrom(method.getReturnType())) { - myResultSetHandler = createSpecifiedOutsideSqlCustomizeBeanListResultSetHandler( - myBeanMetaData, customizeEntityType); - } else { - throw new UnsupportedOperationException( - "The return type of method is unsupported: method.getReturnType()=" - + method.getReturnType()); - // myResultSetHandler = - // createSpecifiedOutsideSqlCustomizeBeanResultSetHandler - // (myBeanMetaData, customizeEntityType); - } - } else if (CursorHandler.class.isAssignableFrom(lastestArguementType)) { - // - - - - - - - - - // CursorHandling - // - - - - - - - - - final BeanMetaData myBeanMetaData = createSpecifiedOutsideSqlCursorBeanMetaData(method); - myResultSetHandler = createSpecifiedOutsideSqlCursorResultSetHandler(myBeanMetaData); - } else { - String msg = "The lastestArguementType is unsupported:"; - msg = msg + " lastestArguementType=" + lastestArguementType; - msg = msg + " method=" + method; - throw new IllegalStateException(msg); - } - - // - - - - - - - - - - - - // Register Sql-Command. - // - - - - - - - - - - - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - myResultSetHandler); - } - - protected BeanMetaData createSpecifiedOutsideSqlCustomizeBeanMetaData( - Class clazz) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(clazz); - } - - /** - * Create the handler of result set of specified outside-sql for the list of - * customize bean. - * - * @param specifiedBeanMetaData Specified bean meta data. (NotNull) - * @param customizeEntityType The type of customize entity. (NotNull) - * @return The handler of result set. (NotNull) - */ - protected ResultSetHandler createSpecifiedOutsideSqlCustomizeBeanListResultSetHandler( - BeanMetaData specifiedBeanMetaData, Class<?> customizeEntityType) { - final ValueType valueType = ValueTypes - .getValueType(customizeEntityType); - if (valueType == null || !valueType.equals(ValueTypes.OBJECT)) { - return new InternalObjectListResultSetHandler(valueType); - } - final InternalRowCreator rowCreator = createSpecifiedOutsideSqlInternalRowCreator(specifiedBeanMetaData); - final InternalRelationRowCreator relationRowCreator = createSpecifiedOutsideSqlInternalRelationRowCreator(specifiedBeanMetaData); - return new InternalBeanListMetaDataResultSetHandler( - specifiedBeanMetaData, rowCreator, relationRowCreator); - } - - protected InternalRowCreator createSpecifiedOutsideSqlInternalRowCreator( - BeanMetaData bmd) { - final Class clazz = bmd.getBeanClass(); - return InternalRowCreator.createInternalRowCreator(clazz); - } - - protected InternalRelationRowCreator createSpecifiedOutsideSqlInternalRelationRowCreator( - BeanMetaData bmd) { - return new InternalRelationRowCreator(); - } - - protected 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 BeanMetaData createSpecifiedOutsideSqlCursorBeanMetaData( - Method method) { - return createOutsideSqlCustomizeBeanMetaDataFactory() - .createBeanMetaData(getOutsideSqlDefaultBeanClass(method)); - } - - protected ResultSetHandler createSpecifiedOutsideSqlCursorResultSetHandler( - BeanMetaData specifiedBeanMetaData) { - return new org.seasar.extension.jdbc.impl.ObjectResultSetHandler();// This - // is - // dummy - // for - // cursor - // handling - // ! - } - - // - - - - - - - - - - - - - // Execute - // - - - - - protected void setupSpecifiedOutsideSqlExecuteCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final String sql = outsideSqlContext.readFilteredOutsideSql( - getSqlFileEncoding(), dbms.getSuffix()); - 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<?>[] {}); - - final InternalUpdateDynamicCommand cmd = new InternalUpdateDynamicCommand( - dataSource, statementFactory) { - @Override - public Object execute(Object[] args) { - if (args.length != 3) { - String msg = "Internal Error! OutsideSqlDao.execute() should have 3 arguements: args.length=" - + args.length; - throw new IllegalStateException(msg); - } - Object arg = args[1]; - return super.execute(new Object[] { arg }); - } - }; - - // It is unnecessary for DBFlute! - // cmd.setNotSingleRowUpdatedExceptionClass( - // getNotSingleRowUpdatedExceptionClass(method)); - - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - // - - - - - - - - - - - - - // Call Procedure - // - - - - - - - - protected void setupSpecifiedOutsideSqlCallCommand(String sqlCommandKey, - Method method, OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - - - - - - - // The attribute of Specified-OutsideSqlContext. - // - - - - - - - - - - - - - - - - - - - - - - - - final Object pmb = outsideSqlContext.getParameterBean(); - final String procedureName = outsideSqlContext.getOutsideSqlPath(); - - // - - - - - - - - - - - - - - - - // The attribute of SqlCommand. - // - - - - - - - - - - - - - - - - final InternalProcedureMetaDataFactory factory = createInternalProcedureMetaDataFactory(); - factory.setValueTypeFactory(valueTypeFactory); - final Class<?> pmbType = pmb != null ? pmb.getClass() : null; - final InternalProcedureMetaData metaData = factory - .createProcedureMetaData(procedureName, pmbType); - final InternalProcedureCommand cmd = createInternalProcedureCommand( - method, metaData); - putSqlCommand(sqlCommandKey, cmd); - } - - protected InternalProcedureMetaDataFactory createInternalProcedureMetaDataFactory() { - return new InternalProcedureMetaDataFactory(); - } - - protected InternalProcedureCommand createInternalProcedureCommand( - Method method, InternalProcedureMetaData metaData) { - final ResultSetHandler resultSetHandler = createResultSetHandler(method); - return new InternalProcedureCommand(dataSource, resultSetHandler, - statementFactory, metaData); - } - - // ----------------------------------------------------- - // Common of OutsideSql - // -------------------- - protected BeanMetaDataFactory createOutsideSqlCustomizeBeanMetaDataFactory() { - final S2BeanMetaDataFactoryImpl originalBmdFactory = new S2BeanMetaDataFactoryImpl() { - protected BeanMetaDataImpl createBeanMetaDataImpl() { - return newOutsideSqlCustomizeBeanMetaDataImpl(); - } - }; - originalBmdFactory - .setAnnotationReaderFactory(this.annotationReaderFactory); - originalBmdFactory - .setPropertyTypeFactoryBuilder(createOutsideSqlPropertyTypeFactoryBuilder()); - originalBmdFactory - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - originalBmdFactory.setTableNaming(this.tableNaming); - originalBmdFactory.setDataSource(this.dataSource); - originalBmdFactory.setDaoNamingConvention(this.daoNamingConvention); - originalBmdFactory.setBeanEnhancer(this.beanEnhancer); - return originalBmdFactory; - } - - protected BeanMetaDataImpl newOutsideSqlCustomizeBeanMetaDataImpl() { - return new OutsideSqlCustomizeBeanMetaDataImpl(); - } - - protected static class OutsideSqlCustomizeBeanMetaDataImpl extends - BeanMetaDataImpl { - // Though nothing to override, it uses original class just in case. - } - - protected S2DaoPropertyTypeFactoryBuilderExtension createOutsideSqlPropertyTypeFactoryBuilder() { - final S2DaoPropertyTypeFactoryBuilderExtension impl = new S2DaoPropertyTypeFactoryBuilderExtension(); - if (columnNaming == null) { - String msg = "Internal Error! The columnNaming should not be null! {Failed to Injection!}"; - throw new IllegalStateException(msg); - } - impl.setColumnNaming(columnNaming); - impl.setValueTypeFactory(valueTypeFactory); - return impl; - } - - protected Class getOutsideSqlDefaultBeanClass(Method method) { - final Class retType = method.getReturnType(); - if (java.util.List.class.isAssignableFrom(retType)) { - final Class elementType = InternalMethodUtil - .getElementTypeOfListFromReturnMethod(method); - if (elementType != null) { - return elementType; - } else { - return getBeanClass(); - } - } else if (retType.isArray()) { - return retType.getComponentType(); - } else if (retType.isPrimitive() - || !ValueTypes.getValueType(retType).equals(ValueTypes.OBJECT)) { - return getBeanClass(); - } else { - return retType; - } - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - BeanMetaData myBeanMetaData) { - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, - createResultSetHandler(myBeanMetaData, method)); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - ResultSetHandler myResultSetHandler) { - final S2DaoSelectDynamicCommand cmd = createCustomizeSelectDynamicCommand(myResultSetHandler); - registerSqlCommand(sqlCommandKey, method, sql, argNames, argTypes, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - S2DaoSelectDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - protected void registerSqlCommand(String sqlCommandKey, Method method, - String sql, String[] argNames, Class[] argTypes, - InternalUpdateDynamicCommand cmd) { - cmd.setSql(sql); - cmd.setArgNames(argNames); - cmd.setArgTypes(argTypes); - this.sqlCommands.put(sqlCommandKey, cmd); - } - - //========================================================================== - // ========= - // Common Handlnig - // =============== - @Override - protected void putSqlCommand(String methodName, SqlCommand cmd) { - sqlCommands.put(methodName, cmd); - } - - protected boolean isCheckSingleRowUpdate(Method method) { - return checkSingleRowUpdateForAll - & daoAnnotationReader.isCheckSingleRowUpdate(method); - } - - //========================================================================== - // ========= - // Customize SelectDynamicCommand Creation - // ======================================= - /** - * Create the customize select dynamic command that is for all select SQL on - * DBFlute. - * - * @param handler The handler of result set. (NotNull) - * @return The customize select dynamic command. (NotNull) - */ - protected S2DaoSelectDynamicCommand createCustomizeSelectDynamicCommand( - ResultSetHandler handler) { - return new S2DaoSelectDynamicCommand(dataSource, statementFactory, - handler); - } - - //========================================================================== - // ========= - // ResultSetHandler Override - // ========================= - @Override - protected ResultSetHandler createResultSetHandler(Method method) { - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, beanMetaData, method); - } - - protected ResultSetHandler createResultSetHandler( - BeanMetaData specifiedBeanMetaData, Method method) {// For specified - // BeanMetaData - return this.resultSetHandlerFactory.getResultSetHandler( - daoAnnotationReader, specifiedBeanMetaData, method); - } - - //========================================================================== - // ========= - // JDBC Delegator - // ============== - protected Connection getConnection() { - if (dataSource == null) { - throw new IllegalStateException( - "The dataSource should not be null!"); - } - try { - return dataSource.getConnection(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected DatabaseMetaData getMetaData(Connection conn) { - try { - return conn.getMetaData(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected String getDatabaseProductName(DatabaseMetaData dbMetaData) { - try { - return dbMetaData.getDatabaseProductName(); - } catch (SQLException e) { - handleSQLException(e, null); - return null;// Unreachable! - } - } - - protected void close(Connection conn) { - if (conn == null) { - return; - } - try { - conn.close(); - } catch (SQLException e) { - handleSQLException(e, null); - } - } - - //========================================================================== - // ========= - // Exception Handlnig - // ================== - protected void handleSQLException(SQLException e, Statement statement) { - new SQLExceptionHandler().handleSQLException(e, statement); - } - - //========================================================================== - // ========= - // ResultSetHandlerFactoryImpl Extension - // ===================================== - public static class ResultSetHandlerFactoryExtension extends - ResultSetHandlerFactoryImpl { - public ResultSetHandlerFactoryExtension() { - super(); - } - - @Override - protected RowCreator createRowCreator() { // [DAO-118] (2007/08/25) - return createInternalRowCreator(null); - } - - @Override - protected RelationRowCreator createRelationRowCreator() { - return createInternalRelationRowCreator(null); - } - - @Override - protected ResultSetHandler createBeanListMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanListMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - @Override - protected ResultSetHandler createBeanArrayMetaDataResultSetHandler( - BeanMetaData bmd) { // DBFlute Target - final InternalRowCreator rowCreator = createInternalRowCreator(bmd); - final InternalRelationRowCreator relationRowCreator = createInternalRelationRowCreator(bmd); - return new InternalBeanArrayMetaDataResultSetHandler(bmd, - rowCreator, relationRowCreator); - } - - 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! - } - } - - //========================================================================== - // ========= - // Vert Internal - // ============= - protected static class InternalMethodUtil { - public static Class getElementTypeOfListFromReturnMethod(Method method) { - return InternalReflectionUtil - .getElementTypeOfListFromReturnType(method); - } - } - - protected static class InternalReflectionUtil { - public static Class<?> getElementTypeOfList(final Type parameterizedList) { - if (!(parameterizedList instanceof ParameterizedType)) { - return null; - } - final ParameterizedType parameterizedType = ParameterizedType.class - .cast(parameterizedList); - final Type rawType = parameterizedType.getRawType(); - if (!(rawType instanceof Class)) { - return null; - } - final Class<?> rawClass = Class.class.cast(rawType); - if (!rawClass.isAssignableFrom(List.class)) { - return null; - } - final Type[] actualTypeArgument = parameterizedType - .getActualTypeArguments(); - if (actualTypeArgument == null || actualTypeArgument.length != 1) { - return null; - } - if (!(actualTypeArgument[0] instanceof Class)) { - return null; - } - return Class.class.cast(actualTypeArgument[0]); - } - - public static Class<?> getElementTypeOfListFromParameterType( - final Method method, final int parameterPosition) { - final Type[] pmbTypes = method.getGenericParameterTypes(); - return getElementTypeOfList(pmbTypes[parameterPosition]); - } - - public static Class<?> getElementTypeOfListFromReturnType( - final Method method) { - return getElementTypeOfList(method.getGenericReturnType()); - } - } - - //========================================================================== - // ========= - // Assist Helper - // ============= - protected DBMeta findDBMeta() { - final Class<?> beanType = getBeanClass(); - 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(); - } - - //========================================================================== - // ========= - // General Helper - // ============== - protected String getLineSeparator() { - return SimpleSystemUtil.getLineSeparator(); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Sql File Encoding - // ----------------- - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - // ----------------------------------------------------- - // Bean Enhancer - // ------------- - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Annotation Reader Factory - // ------------------------- - public void setAnnotationReaderFactory( - org.seasar.dao.AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - public BehaviorSelector getBehaviorSelector() { - return _behaviorSelector; - } - - public void setBehaviorSelector(final BehaviorSelector behaviorSelector) { - this._behaviorSelector = behaviorSelector; - } - - public boolean isInternalDebug() { - return _internalDebug; - } - - public void setInternalDebug(final boolean internalDebug) { - this._internalDebug = internalDebug; - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,655 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.CallableStatement; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.HashMap; -import java.util.Map; - -import javax.sql.DataSource; -import javax.sql.XADataSource; - -import jp.sf.pal.board.db.allcommon.DBFluteConfig; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; - -import org.seasar.dao.AnnotationReaderFactory; -import org.seasar.dao.BeanEnhancer; -import org.seasar.dao.BeanMetaDataFactory; -import org.seasar.dao.ColumnNaming; -import org.seasar.dao.DaoAnnotationReader; -import org.seasar.dao.DaoMetaData; -import org.seasar.dao.DaoMetaDataFactory; -import org.seasar.dao.DaoNamingConvention; -import org.seasar.dao.DtoMetaDataFactory; -import org.seasar.dao.ProcedureMetaDataFactory; -import org.seasar.dao.PropertyTypeFactoryBuilder; -import org.seasar.dao.RelationPropertyTypeFactoryBuilder; -import org.seasar.dao.ResultSetHandlerFactory; -import org.seasar.dao.TableNaming; -import org.seasar.dao.ValueTypeFactory; -import org.seasar.dao.impl.DaoMetaDataImpl; -import org.seasar.dao.pager.PagingSqlRewriter; -import org.seasar.extension.jdbc.ResultSetFactory; -import org.seasar.extension.jdbc.StatementFactory; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.factory.BeanDescFactory; -import org.seasar.framework.util.Disposable; -import org.seasar.framework.util.DisposableUtil; - -/** - * The implementation of DaoMetaDataFactory for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ -public class S2DaoMetaDataFactoryImpl implements DaoMetaDataFactory, Disposable { - - //========================================================================== - // ========= - // Definition - // ========== - /** Log-instance. */ - private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory - .getLog(S2DaoMetaDataFactoryImpl.class); - - // ----------------------------------------------------- - // For Logging - // ----------- - /** The binding annotation for xaDataSource. {bindingType=may} */ - public static final String xaDataSource_BINDING = "bindingType=may"; - - // ----------------------------------------------------- - // Factory Basic - // ------------- - public static final String dataSource_BINDING = "bindingType=must"; - - public static final String annotationReaderFactory_BINDING = "bindingType=must"; - - public static final String valueTypeFactory_BINDING = "bindingType=must"; - - public static final String beanMetaDataFactory_BINDING = "bindingType=must"; - - public static final String daoNamingConvention_BINDING = "bindingType=must"; - - public static final String resultSetHandlerFactory_BINDING = "bindingType=must"; - - public static final String dtoMetaDataFactory_BINDING = "bindingType=must"; - - public static final String procedureMetaDataFactory_BINDING = "bindingType=must"; - - public static final String pagingSQLRewriter_BINDING = "bindingType=may"; - - //========================================================================== - // ========= - // Attribute - // ========= - // ----------------------------------------------------- - // Factory Basic - // ------------- - protected DataSource dataSource; - - protected AnnotationReaderFactory annotationReaderFactory; - - protected ValueTypeFactory valueTypeFactory; - - protected BeanMetaDataFactory beanMetaDataFactory; - - protected DaoNamingConvention daoNamingConvention; - - protected ResultSetHandlerFactory resultSetHandlerFactory; - - protected DtoMetaDataFactory dtoMetaDataFactory; - - protected ProcedureMetaDataFactory procedureMetaDataFactory; - - protected PagingSqlRewriter pagingSqlRewriter; - - protected Map<String, DaoMetaData> daoMetaDataCache = new HashMap<String, DaoMetaData>(); - - protected boolean initialized; - - protected boolean useDaoClassForLog; - - protected String sqlFileEncoding; - - protected BeanEnhancer beanEnhancer; - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - /** The naming of column. {After S2Dao-1.0.47} */ - protected ColumnNaming columnNaming; - - /** The builder of property type factory. {After S2Dao-1.0.47} */ - protected PropertyTypeFactoryBuilder propertyTypeFactoryBuilder; - - /** The builder of relation property type factory. {After S2Dao-1.0.47} */ - protected RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder; - - /** The builder of table naming. {After S2Dao-1.0.47} */ - protected TableNaming tableNaming; - - // ----------------------------------------------------- - // DBFlute Extension - // ----------------- - /** The lock monitor of DAO meta data initialization. */ - protected Object _daoMetaDataInitializationLockMonitor = new Object(); - - //========================================================================== - // ========= - // Constructor - // =========== - public S2DaoMetaDataFactoryImpl(DataSource dataSource, - AnnotationReaderFactory annotationReaderFactory, - XADataSource xaDataSource) { - this.dataSource = dataSource; - this.annotationReaderFactory = annotationReaderFactory; - - _log - .info("/* * * * * * * * * * * * * * * * * * * * * * * * * * * * {DBFlute}"); - showInformation(dataSource, xaDataSource); - - // Stop the LinkageError! - ConditionBeanContext.initialize(); - - initializeDatabaseProductNameOfContext(xaDataSource); - - handleSqlLogRegistry(); - - DBFluteConfig.getInstance().lock(); - _log.info("* * * * */"); - } - - protected void showInformation(javax.sql.DataSource dataSource, - javax.sql.XADataSource xaDataSource) { - final StringBuilder sb = new StringBuilder(); - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.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); - } - - protected void handleSqlLogRegistry() { - final StringBuilder sb = new StringBuilder(); - sb.append("{SqlLog Information}").append(getLineSeparator()); - sb.append(" [SqlLogRegistry]").append(getLineSeparator()); - if (DBFluteConfig.getInstance().isUseSqlLogRegistry()) { - 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!"); - } - } else { - final Object sqlLogRegistry = InternalSqlLogRegistry - .findContainerSqlLogRegistry(); - if (sqlLogRegistry != null) { - InternalSqlLogRegistry.closeRegistration(); - sb - .append( - " SqlLogRegistry(org.seasar.extension.jdbc) is close! It's default for DBFlute.") - .append(getLineSeparator()); - sb - .append(" If you want to use this, set SqlLogRegistry to SqlLogRegistryLocator at yourself."); - } else { - sb - .append(" SqlLogRegistry(org.seasar.extension.jdbc) is not available!"); - } - } - _log.info(sb); - } - - // ----------------------------------------------------- - // Database Product Name - // --------------------- - protected void initializeDatabaseProductNameOfContext( - javax.sql.XADataSource xaDataSource) { - if (getDatabaseProductNameFromContext() != null) { - return; - } - - // From JDBC Driver! - if (xaDataSource != null - && xaDataSource instanceof org.seasar.extension.dbcp.impl.XADataSourceImpl) { - final org.seasar.extension.dbcp.impl.XADataSourceImpl xaDataSourceImpl = (org.seasar.extension.dbcp.impl.XADataSourceImpl) xaDataSource; - final String driverClassName = xaDataSourceImpl - .getDriverClassName(); - if (driverClassName != null) { - if (setupDatabaseProductNameByDriverClassName(driverClassName)) { - _log - .info("...Initializing database product name from driverClassName: " - + getDatabaseProductNameFromContext()); - return; - } - } - } - - _log.info("...Initializing database product name as default: H2"); - setDatabaseProductNameToContext("H2"); - } - - protected String getDatabaseProductNameFromContext() { - return ConditionBeanContext.getDatabaseProductName(); - } - - protected void setDatabaseProductNameToContext(String name) { - ConditionBeanContext.setDatabaseProductName(name); - } - - protected boolean setupDatabaseProductNameByDriverClassName( - String driverClassName) { - return ConditionBeanContext - .setupDatabaseProductNameByDriverClassName(driverClassName); - } - - //========================================================================== - // ========= - // Implementation - // ============== - @SuppressWarnings("unchecked") - public DaoMetaData getDaoMetaData(final Class daoClass) { - if (!initialized) { - DisposableUtil.add(this); - initialized = true; - } - final String key = daoClass.getName(); - - // [A] - DaoMetaData dmd = getSynchronizedDaoMetaDataCache(key); - - // [B] - if (dmd != null) { - return dmd; - } - - // [C] - synchronized (_daoMetaDataInitializationLockMonitor) {// One Thread Only - // Entered - // [D] - dmd = getSynchronizedDaoMetaDataCache(key); - // [E] - if (dmd != null) { - // The second thread that stops at [C] can find - // because the first thread have already initialized. - if (_log.isDebugEnabled()) { - _log - .debug("...Getting daoMetaData as cache because the previous thread have already initilized."); - } - return dmd; - } - // [F] - if (_log.isDebugEnabled()) { - _log.debug("...Creating daoMetaData for " - + daoClass.getSimpleName() + "."); - } - final DaoMetaData dmdi = createDaoMetaData(daoClass); - putSynchronizedDaoMetaDataCache(key, dmdi); - } - // [G] - dmd = getSynchronizedDaoMetaDataCache(key); - if (dmd != null) { - return dmd; - } - String msg = "The cache should have data meta data here: key=" + key - + " cache=" + daoMetaDataCache; - throw new IllegalStateException(msg); - } - - @SuppressWarnings("unchecked") - protected void putSynchronizedDaoMetaDataCache(String key, DaoMetaData dmd) { - synchronized (daoMetaDataCache) { - daoMetaDataCache.put(key, dmd); - } - } - - protected DaoMetaData getSynchronizedDaoMetaDataCache(String key) { - DaoMetaData dmd = null; - synchronized (daoMetaDataCache) { - dmd = (DaoMetaData) daoMetaDataCache.get(key); - } - return dmd; - } - - //========================================================================== - // ========= - // DataMetaData Creation - // ===================== - protected DaoMetaData createDaoMetaData(final Class<?> daoClass) { - final BeanDesc daoBeanDesc = BeanDescFactory.getBeanDesc(daoClass); - final DaoAnnotationReader daoAnnotationReader = annotationReaderFactory - .createDaoAnnotationReader(daoBeanDesc); - - final DaoMetaDataImpl daoMetaData = createDaoMetaDataExtension(); - daoMetaData.setDaoClass(daoClass); - daoMetaData.setDataSource(dataSource); - daoMetaData.setStatementFactory(createCustomizeStatememtFactory()); - daoMetaData.setResultSetFactory(createCustomizeResultSetFactory()); - daoMetaData.setValueTypeFactory(valueTypeFactory); - daoMetaData.setBeanMetaDataFactory(getBeanMetaDataFactory()); - daoMetaData.setDaoNamingConvention(getDaoNamingConvention()); - daoMetaData.setUseDaoClassForLog(useDaoClassForLog); - daoMetaData.setDaoAnnotationReader(daoAnnotationReader); - daoMetaData.setProcedureMetaDataFactory(procedureMetaDataFactory); - daoMetaData.setDtoMetaDataFactory(dtoMetaDataFactory); - daoMetaData.setResultSetHandlerFactory(resultSetHandlerFactory); - if (sqlFileEncoding != null) { - daoMetaData.setSqlFileEncoding(sqlFileEncoding); - } - if (pagingSqlRewriter != null) { - daoMetaData.setPagingSQLRewriter(pagingSqlRewriter); - } - daoMetaData.initialize(); - return daoMetaData; - } - - protected S2DaoMetaDataExtension createDaoMetaDataExtension() { - final S2DaoMetaDataExtension dmdExtension = newDaoMetaDataExtension(); - dmdExtension.setBeanEnhancer(beanEnhancer); - dmdExtension.setAnnotationReaderFactory(this.annotationReaderFactory); - dmdExtension.setColumnNaming(this.columnNaming); - dmdExtension - .setPropertyTypeFactoryBuilder(this.propertyTypeFactoryBuilder); - dmdExtension - .setRelationPropertyTypeFactoryBuilder(this.relationPropertyTypeFactoryBuilder); - dmdExtension.setTableNaming(tableNaming); - dmdExtension.setInternalDebug(DBFluteConfig.getInstance() - .isInternalDebug()); - return dmdExtension; - } - - protected S2DaoMetaDataExtension newDaoMetaDataExtension() { - return new S2DaoMetaDataExtension(); - } - - //========================================================================== - // ========= - // Result Set Factory - // ================== - /** - * Create the customize result set factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected ResultSetFactory createCustomizeResultSetFactory() { - return new FetchNarrowingResultSetFactory(); - } - - //========================================================================== - // ========= - // Statement Factory - // ================= - /** - * Create the customize statement factory that is for all SQL on DBFlute. - * - * @return The customize statement factory. (NotNull) - */ - protected StatementFactory createCustomizeStatememtFactory() { - final StatementConfig defaultStatementConfig = DBFluteConfig - .getInstance().getDefaultStatementConfig(); - final boolean internalDebug = DBFluteConfig.getInstance() - .isInternalDebug(); - return new StatementFactory() { - public PreparedStatement createPreparedStatement(Connection con, - 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 = con.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); - } - }; - } - - //========================================================================== - // ========= - // Dispose - // ======= - public synchronized void dispose() { - daoMetaDataCache.clear(); - initialized = false; - } - - //========================================================================== - // ========= - // Helper - // ====== - /** - * Get the value of line separator. - * - * @return The value of line separator. (NotNull) - */ - protected static String getLineSeparator() { - return System.getProperty("line.separator"); - } - - //========================================================================== - // ========= - // Accessor - // ======== - // ----------------------------------------------------- - // Factory Basic - // ------------- - public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { - this.valueTypeFactory = valueTypeFactory; - } - - protected BeanMetaDataFactory getBeanMetaDataFactory() { - return beanMetaDataFactory; - } - - public void setBeanMetaDataFactory( - final BeanMetaDataFactory beanMetaDataFactory) { - this.beanMetaDataFactory = beanMetaDataFactory; - } - - public DaoNamingConvention getDaoNamingConvention() { - return daoNamingConvention; - } - - public void setDaoNamingConvention( - final DaoNamingConvention daoNamingConvention) { - this.daoNamingConvention = daoNamingConvention; - } - - public void setAnnotationReaderFactory( - final AnnotationReaderFactory annotationReaderFactory) { - this.annotationReaderFactory = annotationReaderFactory; - } - - public void setDataSource(final DataSource dataSource) { - this.dataSource = dataSource; - } - - public void setUseDaoClassForLog(final boolean userDaoClassForLog) { - useDaoClassForLog = userDaoClassForLog; - } - - public void setResultSetHandlerFactory( - final ResultSetHandlerFactory resultSetHandlerFactory) { - this.resultSetHandlerFactory = resultSetHandlerFactory; - } - - public void setDtoMetaDataFactory( - final DtoMetaDataFactory dtoMetaDataFactory) { - this.dtoMetaDataFactory = dtoMetaDataFactory; - } - - public void setProcedureMetaDataFactory( - ProcedureMetaDataFactory procedureMetaDataFactory) { - this.procedureMetaDataFactory = procedureMetaDataFactory; - } - - public void setPagingSQLRewriter(final PagingSqlRewriter pagingSqlRewriter) { - this.pagingSqlRewriter = pagingSqlRewriter; - } - - public String getSqlFileEncoding() { - return sqlFileEncoding; - } - - public void setSqlFileEncoding(final String encoding) { - sqlFileEncoding = encoding; - } - - public BeanEnhancer getBeanEnhancer() { - return beanEnhancer; - } - - public void setBeanEnhancer(final BeanEnhancer beanEnhancer) { - this.beanEnhancer = beanEnhancer; - } - - // ----------------------------------------------------- - // Version After 1.0.47 - // -------------------- - public ColumnNaming getColumnNaming() { - return columnNaming; - } - - public void setColumnNaming(final ColumnNaming columnNaming) { - this.columnNaming = columnNaming; - } - - public PropertyTypeFactoryBuilder getPropertyTypeFactoryBuilder() { - return propertyTypeFactoryBuilder; - } - - public void setPropertyTypeFactoryBuilder( - final PropertyTypeFactoryBuilder propertyTypeFactoryBuilder) { - this.propertyTypeFactoryBuilder = propertyTypeFactoryBuilder; - } - - public RelationPropertyTypeFactoryBuilder getRelationPropertyTypeFactoryBuilder() { - return relationPropertyTypeFactoryBuilder; - } - - public void setRelationPropertyTypeFactoryBuilder( - final RelationPropertyTypeFactoryBuilder relationPropertyTypeFactoryBuilder) { - this.relationPropertyTypeFactoryBuilder = relationPropertyTypeFactoryBuilder; - } - - public TableNaming getTableNaming() { - return tableNaming; - } - - public void setTableNaming(final TableNaming tableNaming) { - this.tableNaming = tableNaming; - } -} \ No newline at end of file Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,215 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.List; - -import jp.sf.pal.board.db.allcommon.Entity; -import jp.sf.pal.board.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 S2DaoPropertyTypeFactoryBuilderExtension 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; - } -} Deleted: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,491 +0,0 @@ -package jp.sf.pal.board.db.allcommon.s2dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.sql.DataSource; - -import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; -import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; -import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; -import jp.sf.pal.board.db.allcommon.util.SimpleStringUtil; -import jp.sf.pal.board.db.allcommon.util.SimpleSystemUtil; - -import org.seasar.dao.CommandContext; -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; -import org.seasar.framework.beans.BeanDesc; -import org.seasar.framework.beans.PropertyDesc; -import org.seasar.framework.beans.factory.BeanDescFactory; - -/** - * SelectDynamicCommand for DBFlute. - * - * @author DBFlute(AutoGenerator) - */ - @ SuppressWarnings("unchecked") -public class S2DaoSelectDynamicCommand 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 S2DaoSelectDynamicCommand(DataSource dataSource, - StatementFactory statementFactory, ResultSetHandler resultSetHandler) { - super(dataSource, statementFactory); - this.resultSetHandler = resultSetHandler; - } - - //========================================================================== - // ========= - // Very Important Extension - // ======================== - // ----------------------------------------------------- - // SelectDynamicCommand Creation - // ----------------------------- - protected S2DaoSelectDynamicCommand createMySelectDynamicCommand() { - return new S2DaoSelectDynamicCommand(getDataSource(), - getStatementFactory(), resultSetHandler); - } - - //========================================================================== - // ========= - // Execute - // ======= - // ----------------------------------------------------- - // Top Execute - // ----------- - /** - * @param args The array of argument. (Nullable) - * @return The object of execution result. (Nullable) - */ - public Object execute(Object[] args) { - // - - - - - - - - - - - - - // This is top execution. - // - - - - - - - - - - - - - - if (!ConditionBeanContext.isExistConditionBeanOnThread()) { - // - - - - - - - - - - - // Execute outsideSql. - // - - - - - - - - - - - if (OutsideSqlContext.isExistOutsideSqlContextOnThread()) { - final OutsideSqlContext outsideSqlContext = OutsideSqlContext - .getOutsideSqlContextOnThread(); - if (outsideSqlContext.isDynamicBinding()) { - return executeOutsideSqlAsDynamic(args, outsideSqlContext); - } else { - return executeOutsideSqlAsStatic(args, outsideSqlContext); - } - } - - // - - - - - - - - - - // Execute default. - // - - - - - - - - - - return executeDefault(args); - } - - // - - - - - - - - - - - - - // Execute conditionBean. - // - - - - - - - - - - - - - final List<Object> bindVariableList = new ArrayList<Object>(4); - final List<Class> bindVariableTypeList = new ArrayList<Class>(4); - - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - final String finalClause; - if (cb.hasUnionQueryOrUnionAllQuery()) { - final String realClause = setupRealClause(args, bindVariableList, - bindVariableTypeList); - if (cb.isSelectCountIgnoreFetchScope()) { - // If the query uses union and it selects count, the way of - // select-count is as follows. - finalClause = "select count(*) from (" + realClause - + ") dfmain"; - } else { - finalClause = realClause; - } - } else { - if (cb.isSelectCountIgnoreFetchScope()) { - finalClause = setupRealSelectCountClause(args, - bindVariableList, bindVariableTypeList); - } else { - 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)); - } - - // ----------------------------------------------------- - // Default Execute - // --------------- - /** - * Execute default. - * - * @param args The array of argument. (Nullable) - * @return Result. (Nullable) - */ - protected Object executeDefault(Object args[]) { - // - - - - - - - - - - - - - - - - - - // Find specified resultSetHandler. - // - - - - - - - - - - - - - - - - - - final ResultSetHandler specifiedResultSetHandler = findSpecifiedResultSetHandler(args); - - // - - - - - - - - - - // Filter arguments. - // - - - - - - - - - - final Object[] filteredArgs = filterArgumentsForResultSetHandler(args); - - final org.seasar.dao.CommandContext ctx = apply(filteredArgs); - final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( - ctx.getSql(), specifiedResultSetHandler); - final Object[] bindVariableArray = ctx.getBindVariables(); - selectHandler.setLoggingMessageSqlArgs(bindVariableArray); - return selectHandler.execute(bindVariableArray, ctx - .getBindVariableTypes()); - } - - // ----------------------------------------------------- - // OutsideSql Execute - // ------------------ - /** - * Execute outsideSql as static. - * - * @param args The array of argument. (Nullable) - * @param outsideSqlContext The context of outsideSql. (NotNull) - * @return Result. (Nullable) - */ - protected Object executeOutsideSqlAsStatic(Object[] args, - OutsideSqlContext outsideSqlContext) { - // - - - - - - - - - - - - - - - - - - // Find specified resultSetHandler. - // - - - - - - - - - - - - - - - - - - final ResultSetHandler specifiedResultSetHandler = findSpecifiedResultSetHandler(args); - - // - - - - - - - - - - // Filter arguments. - // - - - - - - - - - - final Object[] filteredArgs; - if (outsideSqlContext.isSpecifiedOutsideSql()) { - final Object parameterBean = outsideSqlContext.getParameterBean(); - filteredArgs = new Object[] { parameterBean }; - } else { - filteredArgs = filterArgumentsForResultSetHandler(args); - } - - final org.seasar.dao.CommandContext ctx = apply(filteredArgs); - final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( - ctx.getSql(), specifiedResultSetHandler); - final Object[] bindVariableArray = ctx.getBindVariables(); - selectHandler.setLoggingMessageSqlArgs(bindVariableArray); - return selectHandler.execute(bindVariableArray, ctx - .getBindVariableTypes()); - } - - /** - * Execute outsideSql as Dynamic. - * - * @param args The array of argument. (Nullable) - * @param outsideSqlContext The context of outsideSql. (NotNull) - * @return Result. (Nullable) - */ - protected Object executeOutsideSqlAsDynamic(Object[] args, - OutsideSqlContext outsideSqlContext) { - final Object firstArg; - if (outsideSqlContext.isSpecifiedOutsideSql()) { - final Object parameterBean = outsideSqlContext.getParameterBean(); - firstArg = parameterBean; - } else { - firstArg = args[0]; - } - String filteredSql = 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() + "*/"; - filteredSql = replaceString(filteredSql, embeddedComment, - outsideSqlPiece); - } - } - final S2DaoSelectDynamicCommand outsideSqlCommand = createMySelectDynamicCommand(); - if (outsideSqlContext.isSpecifiedOutsideSql()) { - outsideSqlCommand.setArgNames(new String[] { "pmb" }); - outsideSqlCommand - .setArgTypes(new Class<?>[] { firstArg != null ? firstArg - .getClass() : Object.class }); - } else { - outsideSqlCommand.setArgNames(getArgNames()); - outsideSqlCommand.setArgTypes(getArgTypes()); - } - outsideSqlCommand.setSql(filteredSql); - - // - - - - - - - - - - - - - - - - - - // Find specified resultSetHandler. - // - - - - - - - - - - - - - - - - - - final ResultSetHandler specifiedResultSetHandler = findSpecifiedResultSetHandler(args); - - // - - - - - - - - - - // Filter arguments. - // - - - - - - - - - - final Object[] filteredArgs; - if (outsideSqlContext.isSpecifiedOutsideSql()) { - final Object parameterBean = outsideSqlContext.getParameterBean(); - filteredArgs = new Object[] { parameterBean }; - } else { - filteredArgs = filterArgumentsForResultSetHandler(args); - } - - final org.seasar.dao.CommandContext ctx = outsideSqlCommand - .apply(filteredArgs); - final java.util.List<Object> bindVariableList = new java.util.ArrayList<Object>(); - final java.util.List<Class> bindVariableTypeList = new java.util.ArrayList<Class>(); - addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); - final InternalBasicSelectHandler selectHandler = createBasicSelectHandler( - ctx.getSql(), specifiedResultSetHandler); - final Object[] bindVariableArray = bindVariableList.toArray(); - selectHandler.setLoggingMessageSqlArgs(bindVariableArray); - return selectHandler.execute(bindVariableArray, - toClassArray(bindVariableTypeList)); - } - - protected Object[] filterArgumentsForResultSetHandler(Object[] args) { - if (args == null || args.length == 0) { - return args; - } - final Object[] filteredArgs; - if (args[args.length - 1] instanceof jp.sf.pal.board.db.allcommon.jdbc.CursorHandler) { - filteredArgs = new Object[args.length - 1]; - for (int i = 0; i < args.length - 1; i++) { - filteredArgs[i] = args[i]; - } - } else { - filteredArgs = args; - } - return filteredArgs; - } - - protected ResultSetHandler findSpecifiedResultSetHandler(Object[] args) { - if (args == null || args.length == 0) { - return this.resultSetHandler; - } - if (args[args.length - 1] instanceof jp.sf.pal.board.db.allcommon.jdbc.CursorHandler) { - final jp.sf.pal.board.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.board.db.allcommon.jdbc.CursorHandler) args[args.length - 1]; - return new ResultSetHandler() { - public Object handle(java.sql.ResultSet rs) - throws java.sql.SQLException { - return cursorHandler.handle(rs); - } - }; - } - if (getArgTypes().length + 1 == args.length - && args[args.length - 1] == null) { - String msg = "System Level Exception!" + getLineSeparator(); - msg = msg - + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" - + getLineSeparator(); - msg = msg - + "The size of arg types have not been same as the size of arg objects:"; - msg = msg + " argTypes=" + getArgTypes().length + " args=" - + args.length + getLineSeparator(); - msg = msg - + "If the arguments contain ResultSetHandler, the argument value should not be null!" - + getLineSeparator(); - for (int i = 0; i < args.length - 1; i++) { - msg = msg + " args[" + i + "] -- " + args[i] - + getLineSeparator(); - } - msg = msg + "* * * * * * * * * */" + getLineSeparator(); - throw new IllegalStateException(msg); - } - return this.resultSetHandler; - } - - // ----------------------------------------------------- - // Setup Clause - // ------------ - protected String setupRealClause(Object[] args, - List<Object> bindVariableList, List<Class> bindVariableTypeList) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - final String realClause; - { - final S2DaoSelectDynamicCommand dynamicCommand = createMySelectDynamicCommand(); - dynamicCommand.setArgNames(getArgNames()); - dynamicCommand.setArgTypes(getArgTypes()); - if (cb.isLimitSelect_PKOnly()) { - dynamicCommand.setSql(cb.getSqlClause().getClausePKOnly()); - } else { - dynamicCommand.setSql(cb.getSqlClause().getClause()); - } - final CommandContext ctx = dynamicCommand.apply(args); - realClause = ctx.getSql(); - addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); - } - return realClause; - } - - protected String setupRealSelectCountClause(Object[] args, - List<Object> bindVariableList, List<Class> bindVariableTypeList) { - final ConditionBean cb = ConditionBeanContext - .getConditionBeanOnThread(); - final String realSelectCountClause; - { - final S2DaoSelectDynamicCommand selectCountCommand = createMySelectDynamicCommand(); - selectCountCommand.setArgNames(getArgNames()); - selectCountCommand.setArgTypes(getArgTypes()); - final String selectClause = "select count(*)"; - String fromWhereClause = cb.getSqlClause() - .getClauseFromWhereWithUnionTemplate(); - - // Replace template marks. These are very important! - fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() - .getUnionSelectClauseMark(), selectClause); - fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() - .getUnionWhereClauseMark(), ""); - fromWhereClause = replaceString(fromWhereClause, cb.getSqlClause() - .getUnionWhereFirstConditionMark(), ""); - - final String sql = cb.getSqlClause().filterSubQueryIndent( - selectClause + " " + fromWhereClause); - selectCountCommand.setSql(sql); - - final CommandContext ctx = selectCountCommand.apply(args); - realSelectCountClause = ctx.getSql(); - addBindVariableInfo(ctx, bindVariableList, bindVariableTypeList); - } - return realSelectCountClause; - } - - protected InternalBasicSelectHandler createBasicSelectHandler( - String realSql, ResultSetHandler specifiedResultSetHandler) { - return newBasicSelectHandler(realSql, specifiedResultSetHandler, - getStatementFactory()); - } - - protected InternalBasicSelectHandler newBasicSelectHandler(String sql, - ResultSetHandler resultSetHandler, StatementFactory statementFactory) { - return new InternalBasicSelectHandler(getDataSource(), sql, - resultSetHandler, statementFactory) { - @Override - protected void bindArgs(java.sql.PreparedStatement ps, - Object[] args, Class[] argTypes) { - if (args == null) { - return; - } - for (int i = 0; i < args.length; ++i) { - final ValueType valueType = findValueType(argTypes[i], - args[i]); - try { - valueType.bindValue(ps, i + 1, args[i]); - } catch (java.sql.SQLException e) { - handleSQLException(e, ps); - } - } - } - - protected ValueType findValueType(Class argType, Object arg) { - 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); - } - }; - } - - // ----------------------------------------------------- - // 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(); - } -} \ No newline at end of file Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,21 @@ +package jp.sf.pal.board.db.allcommon.s2dao; + +import jp.sf.pal.board.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/SqlLogRegistryLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -6,10 +6,11 @@ import java.util.Map; import java.util.Set; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,13 +2,16 @@ import javax.sql.DataSource; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,11 +5,11 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,6 +2,7 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; import jp.sf.pal.board.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,29 +5,27 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.XLog; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -10,6 +10,7 @@ import javax.sql.DataSource; import jp.sf.pal.board.db.allcommon.Entity; +import jp.sf.pal.board.db.allcommon.bhv.core.SqlExecution; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -10,12 +10,14 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,11 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.DBDef; +import jp.sf.pal.board.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.board.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,7 @@ import javax.sql.DataSource; import jp.sf.pal.board.db.allcommon.CallbackContext; +import jp.sf.pal.board.db.allcommon.DBDef; import jp.sf.pal.board.db.allcommon.DBFluteConfig; import jp.sf.pal.board.db.allcommon.InternalMapContext; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,6 +20,7 @@ StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -19,8 +19,8 @@ public InternalInsertBatchAutoHandler(DataSource dataSource, StatementFactory statementFactory, BeanMetaData beanMetaData, PropertyType[] propertyTypes) { - super(dataSource, statementFactory, beanMetaData, propertyTypes); + setOptimisticLockHandling(false); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -12,6 +12,7 @@ import javax.sql.DataSource; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -2,8 +2,6 @@ import javax.sql.DataSource; -import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,146 @@ +package jp.sf.pal.board.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.board.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAbstractGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,33 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierAssignedGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,105 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Constructor; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierGeneratorFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,35 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierIdentityGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,116 @@ +package jp.sf.pal.board.db.allcommon.s2dao.internal.various; + +import java.util.HashMap; + +import javax.sql.DataSource; + +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalIdentifierSequenceGenerator.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,7 @@ import java.util.Map; import java.util.Stack; -import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,158 @@ +package jp.sf.pal.board.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.board.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.board.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.board.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/s2dao/internal/various/InternalStatementFactory.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleAssertUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,117 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleResourceUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleStringUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,14 +1,20 @@ package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleSystemUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,8 +7,8 @@ //========================================================================== // ========= - // System - // ====== + // Line Separator + // ============== public static String getLineSeparator() { // /- - - - - - - - - - - - - - - - - - - - - - // Because 'CR + LF' caused many trouble! Added: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java (rev 0) +++ board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -0,0 +1,692 @@ +package jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/allcommon/util/SimpleTypeUtil.java ___________________________________________________________________ Name: svn:eol-style + native Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsAttachmentBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -20,12 +19,11 @@ import jp.sf.pal.board.db.cbean.AttachmentCB; import jp.sf.pal.board.db.cbean.MessageAttachmentCB; import jp.sf.pal.board.db.exbhv.MessageAttachmentBhv; -import jp.sf.pal.board.db.exdao.AttachmentDao; import jp.sf.pal.board.db.exentity.Attachment; import jp.sf.pal.board.db.exentity.MessageAttachment; /** - * The behavior of ATTACHMENT. + * The behavior of ATTACHMENT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -70,12 +68,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected AttachmentDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -87,39 +79,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return AttachmentDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public AttachmentDbm getMyDBMeta() { return AttachmentDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public AttachmentDao getMyDao() { - return _dao; - } - - public void setMyDao(AttachmentDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -149,7 +120,7 @@ * @return The selected count. */ public int selectCount(AttachmentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -226,7 +197,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<Attachment> selectList(AttachmentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<Attachment>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -242,7 +213,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<Attachment> selectPage(final AttachmentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Attachment> invoker = new PagingInvoker<Attachment>( getTableDbName()); final PagingHandler<Attachment> handler = new PagingHandler<Attachment>() { @@ -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> + * attachmentBhv.scalarSelect(Date.class).max(new ScalarQuery(AttachmentCB 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<AttachmentCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + AttachmentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<AttachmentCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -272,8 +269,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - AttachmentCB cb, ValueLabelSetupper<Attachment> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(AttachmentCB cb, + ValueLabelSetupper<Attachment> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -377,8 +374,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -560,11 +557,11 @@ */ public int queryUpdate(Attachment attachment, AttachmentCB cb) { assertObjectNotNull("attachment", attachment); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(attachment); filterEntityOfUpdate(attachment); assertEntityOfUpdate(attachment); - return getMyDao().updateByQuery(cb, attachment); + return invoke(createQueryUpdateEntityCBCommand(attachment, cb)); } /** @@ -574,8 +571,8 @@ * @return The deleted count. */ public int queryDelete(AttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -587,19 +584,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(AttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((AttachmentCB) cb); + } + protected List<Attachment> delegateSelectList(AttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Attachment.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((AttachmentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -607,38 +612,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(Attachment 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(Attachment 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<Attachment> ls) { - assertObjectNotNull("attachmentList", 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<Attachment> ls) { - assertObjectNotNull("attachmentList", 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<Attachment> ls) { - assertObjectNotNull("attachmentList", 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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryAccessBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.CategoryAccessDbm; import jp.sf.pal.board.db.cbean.CategoryAccessCB; -import jp.sf.pal.board.db.exdao.CategoryAccessDao; import jp.sf.pal.board.db.exentity.Category; import jp.sf.pal.board.db.exentity.CategoryAccess; /** - * The behavior of CATEGORY_ACCESS. + * The behavior of CATEGORY_ACCESS that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -66,12 +64,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected CategoryAccessDao _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 CategoryAccessDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public CategoryAccessDbm getMyDBMeta() { return CategoryAccessDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public CategoryAccessDao getMyDao() { - return _dao; - } - - public void setMyDao(CategoryAccessDao 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(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -225,7 +196,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<CategoryAccess> selectList(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<CategoryAccess>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -241,7 +212,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<CategoryAccess> selectPage(final CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<CategoryAccess> invoker = new PagingInvoker<CategoryAccess>( getTableDbName()); final PagingHandler<CategoryAccess> handler = new PagingHandler<CategoryAccess>() { @@ -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> + * categoryAccessBhv.scalarSelect(Date.class).max(new ScalarQuery(CategoryAccessCB 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<CategoryAccessCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + CategoryAccessCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<CategoryAccessCB, 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( - CategoryAccessCB cb, + public List<Map<String, Object>> selectValueLabelList(CategoryAccessCB cb, ValueLabelSetupper<CategoryAccess> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -284,8 +280,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Category'. * @@ -604,11 +600,11 @@ */ public int queryUpdate(CategoryAccess categoryAccess, CategoryAccessCB cb) { assertObjectNotNull("categoryAccess", categoryAccess); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(categoryAccess); filterEntityOfUpdate(categoryAccess); assertEntityOfUpdate(categoryAccess); - return getMyDao().updateByQuery(cb, categoryAccess); + return invoke(createQueryUpdateEntityCBCommand(categoryAccess, cb)); } /** @@ -618,8 +614,8 @@ * @return The deleted count. */ public int queryDelete(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -631,19 +627,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((CategoryAccessCB) cb); + } + protected List<CategoryAccess> delegateSelectList(CategoryAccessCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, CategoryAccess.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((CategoryAccessCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -651,62 +655,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(CategoryAccess 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(CategoryAccess e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(CategoryAccess 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(CategoryAccess e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<CategoryAccess> ls) { - assertObjectNotNull("categoryAccessList", 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<CategoryAccess> ls) { - assertObjectNotNull("categoryAccessList", 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<CategoryAccess> ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<CategoryAccess> ls) { - assertObjectNotNull("categoryAccessList", 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<CategoryAccess> ls) { - assertObjectNotNull("categoryAccessList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsCategoryBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.board.db.cbean.MessageCB; import jp.sf.pal.board.db.exbhv.CategoryAccessBhv; import jp.sf.pal.board.db.exbhv.MessageBhv; -import jp.sf.pal.board.db.exdao.CategoryDao; import jp.sf.pal.board.db.exentity.Category; import jp.sf.pal.board.db.exentity.CategoryAccess; import jp.sf.pal.board.db.exentity.Message; /** - * The behavior of CATEGORY. + * The behavior of CATEGORY that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -73,12 +71,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected CategoryDao _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 CategoryDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public CategoryDbm getMyDBMeta() { return CategoryDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public CategoryDao getMyDao() { - return _dao; - } - - public void setMyDao(CategoryDao 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(CategoryCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -229,7 +200,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<Category> selectList(CategoryCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<Category>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -245,7 +216,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<Category> selectPage(final CategoryCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Category> invoker = new PagingInvoker<Category>( getTableDbName()); final PagingHandler<Category> handler = new PagingHandler<Category>() { @@ -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> + * categoryBhv.scalarSelect(Date.class).max(new ScalarQuery(CategoryCB 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<CategoryCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + CategoryCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<CategoryCB, 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( - CategoryCB cb, ValueLabelSetupper<Category> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(CategoryCB cb, + ValueLabelSetupper<Category> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -469,8 +466,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ //========================================================================== // ========= @@ -766,11 +763,11 @@ */ public int queryUpdate(Category category, CategoryCB cb) { assertObjectNotNull("category", category); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(category); filterEntityOfUpdate(category); assertEntityOfUpdate(category); - return getMyDao().updateByQuery(cb, category); + return invoke(createQueryUpdateEntityCBCommand(category, cb)); } /** @@ -780,8 +777,8 @@ * @return The deleted count. */ public int queryDelete(CategoryCB 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(CategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((CategoryCB) cb); + } + protected List<Category> delegateSelectList(CategoryCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Category.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((CategoryCB) 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(Category 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(Category e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Category 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(Category e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<Category> ls) { - assertObjectNotNull("categoryList", 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<Category> ls) { - assertObjectNotNull("categoryList", 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<Category> ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<Category> ls) { - assertObjectNotNull("categoryList", 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<Category> ls) { - assertObjectNotNull("categoryList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupInfoBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.exbhv.GroupMappingBhv; import jp.sf.pal.board.db.exbhv.UserInfoBhv; -import jp.sf.pal.board.db.exdao.GroupInfoDao; import jp.sf.pal.board.db.exentity.GroupInfo; import jp.sf.pal.board.db.exentity.GroupMapping; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsGroupMappingBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.GroupMappingDbm; import jp.sf.pal.board.db.cbean.GroupMappingCB; -import jp.sf.pal.board.db.exdao.GroupMappingDao; import jp.sf.pal.board.db.exentity.GroupInfo; import jp.sf.pal.board.db.exentity.GroupMapping; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageAttachmentBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.MessageAttachmentDbm; import jp.sf.pal.board.db.cbean.MessageAttachmentCB; -import jp.sf.pal.board.db.exdao.MessageAttachmentDao; import jp.sf.pal.board.db.exentity.Attachment; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.MessageAttachment; /** - * The behavior of MESSAGE_ATTACHMENT. + * The behavior of MESSAGE_ATTACHMENT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -67,12 +65,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected MessageAttachmentDao _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 MessageAttachmentDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public MessageAttachmentDbm getMyDBMeta() { return MessageAttachmentDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public MessageAttachmentDao getMyDao() { - return _dao; - } - - public void setMyDao(MessageAttachmentDao 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(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -227,7 +198,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<MessageAttachment> selectList(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<MessageAttachment>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -244,7 +215,7 @@ */ public PagingResultBean<MessageAttachment> selectPage( final MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<MessageAttachment> invoker = new PagingInvoker<MessageAttachment>( getTableDbName()); final PagingHandler<MessageAttachment> handler = new PagingHandler<MessageAttachment>() { @@ -265,6 +236,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * messageAttachmentBhv.scalarSelect(Date.class).max(new ScalarQuery(MessageAttachmentCB 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<MessageAttachmentCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + MessageAttachmentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<MessageAttachmentCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -274,7 +271,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( + public List<Map<String, Object>> selectValueLabelList( MessageAttachmentCB cb, ValueLabelSetupper<MessageAttachment> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); @@ -287,8 +284,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Attachment'. * @@ -628,11 +625,11 @@ public int queryUpdate(MessageAttachment messageAttachment, MessageAttachmentCB cb) { assertObjectNotNull("messageAttachment", messageAttachment); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(messageAttachment); filterEntityOfUpdate(messageAttachment); assertEntityOfUpdate(messageAttachment); - return getMyDao().updateByQuery(cb, messageAttachment); + return invoke(createQueryUpdateEntityCBCommand(messageAttachment, cb)); } /** @@ -642,8 +639,8 @@ * @return The deleted count. */ public int queryDelete(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -655,19 +652,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MessageAttachmentCB) cb); + } + protected List<MessageAttachment> delegateSelectList(MessageAttachmentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MessageAttachment.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MessageAttachmentCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -675,62 +680,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(MessageAttachment 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(MessageAttachment e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(MessageAttachment 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(MessageAttachment e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<MessageAttachment> ls) { - assertObjectNotNull("messageAttachmentList", 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<MessageAttachment> ls) { - assertObjectNotNull("messageAttachmentList", 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<MessageAttachment> ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<MessageAttachment> ls) { - assertObjectNotNull("messageAttachmentList", 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<MessageAttachment> ls) { - assertObjectNotNull("messageAttachmentList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,7 +21,6 @@ import jp.sf.pal.board.db.cbean.ReplyCB; import jp.sf.pal.board.db.exbhv.MessageAttachmentBhv; import jp.sf.pal.board.db.exbhv.ReplyBhv; -import jp.sf.pal.board.db.exdao.MessageDao; import jp.sf.pal.board.db.exentity.Category; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.MessageAttachment; @@ -30,7 +28,7 @@ import jp.sf.pal.board.db.exentity.Reply; /** - * The behavior of MESSAGE. + * The behavior of MESSAGE that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -75,12 +73,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected MessageDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -92,39 +84,18 @@ // ========= // DBMeta // ====== - /** @return The meta data of the database. (NotNull) */ + /** @return The instance of DBMeta. (NotNull) */ public DBMeta getDBMeta() { return MessageDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public MessageDbm getMyDBMeta() { return MessageDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public MessageDao getMyDao() { - return _dao; - } - - public void setMyDao(MessageDao dao) { - assertObjectNotNull("dao", dao); - _dao = dao; - } - - public DaoReadable getDaoReadable() { - return getMyDao(); - } - - public DaoWritable getDaoWritable() { - return getMyDao(); - } - - //========================================================================== - // ========= // New Instance // ============ public Entity newEntity() { @@ -154,7 +125,7 @@ * @return The selected count. */ public int selectCount(MessageCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -231,7 +202,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<Message> selectList(MessageCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<Message>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -247,7 +218,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<Message> selectPage(final MessageCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Message> invoker = new PagingInvoker<Message>( getTableDbName()); final PagingHandler<Message> handler = new PagingHandler<Message>() { @@ -268,6 +239,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * messageBhv.scalarSelect(Date.class).max(new ScalarQuery(MessageCB 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<MessageCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + MessageCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<MessageCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -277,8 +274,8 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList( - MessageCB cb, ValueLabelSetupper<Message> valueLabelSetupper) { + public List<Map<String, Object>> selectValueLabelList(MessageCB cb, + ValueLabelSetupper<Message> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -466,8 +463,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Category'. * @@ -794,11 +791,11 @@ */ public int queryUpdate(Message message, MessageCB cb) { assertObjectNotNull("message", message); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(message); filterEntityOfUpdate(message); assertEntityOfUpdate(message); - return getMyDao().updateByQuery(cb, message); + return invoke(createQueryUpdateEntityCBCommand(message, cb)); } /** @@ -808,8 +805,8 @@ * @return The deleted count. */ public int queryDelete(MessageCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -821,19 +818,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(MessageCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MessageCB) cb); + } + protected List<Message> delegateSelectList(MessageCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Message.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MessageCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -841,62 +846,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(Message 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(Message e) { if (!processBeforeUpdate(e)) { return 1; } - return getMyDao().updateNonstrictModifiedOnly(e); + return invoke(createUpdateNonstrictEntityCommand(e)); } protected int delegateDelete(Message 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(Message e) { if (!processBeforeDelete(e)) { return 1; } - return getMyDao().deleteNonstrict(e); + return invoke(createDeleteNonstrictEntityCommand(e)); } protected int[] delegateInsertList(List<Message> ls) { - assertObjectNotNull("messageList", 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<Message> ls) { - assertObjectNotNull("messageList", 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<Message> ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().updateListNonstrict( - helpFilterBeforeUpdateInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchUpdateNonstrictEntityCommand(helpFilterBeforeUpdateInternally(ls))); } protected int[] delegateDeleteList(List<Message> ls) { - assertObjectNotNull("messageList", 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<Message> ls) { - assertObjectNotNull("messageList", ls); - return getMyDao().deleteListNonstrict( - helpFilterBeforeDeleteInternally(ls)); + if (ls.isEmpty()) { + return new int[] {}; + } + return invoke(createBatchDeleteNonstrictEntityCommand(helpFilterBeforeDeleteInternally(ls))); } //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsMessageContentBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.MessageContentDbm; import jp.sf.pal.board.db.cbean.MessageContentCB; -import jp.sf.pal.board.db.exdao.MessageContentDao; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.MessageContent; /** - * The behavior of MESSAGE_CONTENT. + * The behavior of MESSAGE_CONTENT that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -66,12 +64,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected MessageContentDao _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 MessageContentDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public MessageContentDbm getMyDBMeta() { return MessageContentDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public MessageContentDao getMyDao() { - return _dao; - } - - public void setMyDao(MessageContentDao 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(MessageContentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -225,7 +196,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<MessageContent> selectList(MessageContentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<MessageContent>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -241,7 +212,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<MessageContent> selectPage(final MessageContentCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<MessageContent> invoker = new PagingInvoker<MessageContent>( getTableDbName()); final PagingHandler<MessageContent> handler = new PagingHandler<MessageContent>() { @@ -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> + * messageContentBhv.scalarSelect(Date.class).max(new ScalarQuery(MessageContentCB 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<MessageContentCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + MessageContentCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<MessageContentCB, 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( - MessageContentCB cb, + public List<Map<String, Object>> selectValueLabelList(MessageContentCB cb, ValueLabelSetupper<MessageContent> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -284,8 +280,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Message'. * @@ -483,11 +479,11 @@ */ public int queryUpdate(MessageContent messageContent, MessageContentCB cb) { assertObjectNotNull("messageContent", messageContent); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(messageContent); filterEntityOfUpdate(messageContent); assertEntityOfUpdate(messageContent); - return getMyDao().updateByQuery(cb, messageContent); + return invoke(createQueryUpdateEntityCBCommand(messageContent, cb)); } /** @@ -497,8 +493,8 @@ * @return The deleted count. */ public int queryDelete(MessageContentCB 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(MessageContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((MessageContentCB) cb); + } + protected List<MessageContent> delegateSelectList(MessageContentCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, MessageContent.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((MessageContentCB) 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(MessageContent 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(MessageContent 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<MessageContent> ls) { - assertObjectNotNull("messageContentList", 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<MessageContent> ls) { - assertObjectNotNull("messageContentList", 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<MessageContent> ls) { - assertObjectNotNull("messageContentList", 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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsReplyBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,12 +15,11 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.ReplyDbm; import jp.sf.pal.board.db.cbean.ReplyCB; -import jp.sf.pal.board.db.exdao.ReplyDao; import jp.sf.pal.board.db.exentity.Message; import jp.sf.pal.board.db.exentity.Reply; /** - * The behavior of REPLY. + * The behavior of REPLY that the type is TABLE. <br /> * * <pre> * [primary-key] @@ -66,12 +64,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected ReplyDao _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 ReplyDbm.getInstance(); } - /** @return The meta data of the database as my table type. (NotNull) */ + /** @return The instance of DBMeta as my table type. (NotNull) */ public ReplyDbm getMyDBMeta() { return ReplyDbm.getInstance(); } //========================================================================== // ========= - // Dao Accessor - // ============ - public ReplyDao getMyDao() { - return _dao; - } - - public void setMyDao(ReplyDao 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(ReplyCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -222,7 +193,7 @@ * @return The result bean of selected list. (NotNull) */ public ListResultBean<Reply> selectList(ReplyCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return new ResultBeanBuilder<Reply>(getTableDbName()) .buildListResultBean(cb, delegateSelectList(cb)); } @@ -238,7 +209,7 @@ * @return The result bean of selected page. (NotNull) */ public PagingResultBean<Reply> selectPage(final ReplyCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); final PagingInvoker<Reply> invoker = new PagingInvoker<Reply>( getTableDbName()); final PagingHandler<Reply> handler = new PagingHandler<Reply>() { @@ -259,6 +230,32 @@ //========================================================================== // ========= + // Scalar Select + // ============= + /** + * Select the scalar value derived by a function. <br /> Call a function + * method after this method called like as follows: + * + * <pre> + * replyBhv.scalarSelect(Date.class).max(new ScalarQuery(ReplyCB 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<ReplyCB, RESULT> scalarSelect( + Class<RESULT> resultType) { + ReplyCB cb = newMyConditionBean(); + cb.xsetupForScalarSelect(); + return new SLFunction<ReplyCB, RESULT>(cb, resultType); + } + + //========================================================================== + // ========= // Various Select // ============== /** @@ -268,7 +265,7 @@ * @param valueLabelSetupper The setupper of value-label. (NotNull) * @return The list of value-label. (NotNull) */ - public List<java.util.Map<String, Object>> selectValueLabelList(ReplyCB cb, + public List<Map<String, Object>> selectValueLabelList(ReplyCB cb, ValueLabelSetupper<Reply> valueLabelSetupper) { return createValueLabelList(selectList(cb), valueLabelSetupper); } @@ -280,8 +277,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'Message'. * @@ -475,11 +472,11 @@ */ public int queryUpdate(Reply reply, ReplyCB cb) { assertObjectNotNull("reply", reply); - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); setupCommonColumnOfUpdateIfNeeds(reply); filterEntityOfUpdate(reply); assertEntityOfUpdate(reply); - return getMyDao().updateByQuery(cb, reply); + return invoke(createQueryUpdateEntityCBCommand(reply, cb)); } /** @@ -489,8 +486,8 @@ * @return The deleted count. */ public int queryDelete(ReplyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -502,19 +499,27 @@ // ========= // Delegate Method // =============== + // [Behavior Command] // ----------------------------------------------------- // Select // ------ protected int delegateSelectCount(ReplyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectCount(cb); + return invoke(createSelectCountCBCommand(cb)); } + protected int doCallReadCount(ConditionBean cb) { + return delegateSelectCount((ReplyCB) cb); + } + protected List<Reply> delegateSelectList(ReplyCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().selectList(cb); + return invoke(createSelectListCBCommand(cb, Reply.class)); } + @SuppressWarnings("unchecked") + protected List<Entity> doCallReadList(ConditionBean cb) { + return (List) delegateSelectList((ReplyCB) cb); + } + // ----------------------------------------------------- // Update // ------ @@ -522,38 +527,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(Reply 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(Reply 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<Reply> ls) { - assertObjectNotNull("replyList", 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<Reply> ls) { - assertObjectNotNull("replyList", 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<Reply> ls) { - assertObjectNotNull("replyList", 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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleInfoBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,13 +21,12 @@ import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.exbhv.RoleMappingBhv; import jp.sf.pal.board.db.exbhv.UserInfoBhv; -import jp.sf.pal.board.db.exdao.RoleInfoDao; import jp.sf.pal.board.db.exentity.RoleInfo; import jp.sf.pal.board.db.exentity.RoleMapping; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsRoleMappingBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.setup.ValueLabelSetupper; import jp.sf.pal.board.db.allcommon.cbean.ConditionBean; @@ -16,13 +15,12 @@ import jp.sf.pal.board.db.allcommon.dbmeta.DBMeta; import jp.sf.pal.board.db.bsentity.dbmeta.RoleMappingDbm; import jp.sf.pal.board.db.cbean.RoleMappingCB; -import jp.sf.pal.board.db.exdao.RoleMappingDao; import jp.sf.pal.board.db.exentity.RoleInfo; import jp.sf.pal.board.db.exentity.RoleMapping; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsbhv/BsUserInfoBhv.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -1,9 +1,8 @@ package jp.sf.pal.board.db.bsbhv; import java.util.List; +import java.util.Map; -import jp.sf.pal.board.db.allcommon.DaoReadable; -import jp.sf.pal.board.db.allcommon.DaoWritable; import jp.sf.pal.board.db.allcommon.Entity; import jp.sf.pal.board.db.allcommon.bhv.load.LoadReferrerOption; import jp.sf.pal.board.db.allcommon.bhv.setup.ConditionBeanSetupper; @@ -22,7 +21,6 @@ import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.exbhv.GroupMappingBhv; import jp.sf.pal.board.db.exbhv.RoleMappingBhv; -import jp.sf.pal.board.db.exdao.UserInfoDao; import jp.sf.pal.board.db.exentity.GroupInfo; import jp.sf.pal.board.db.exentity.GroupMapping; import jp.sf.pal.board.db.exentity.RoleInfo; @@ -30,14 +28,14 @@ import jp.sf.pal.board.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] * @@ -75,12 +73,6 @@ //========================================================================== // ========= - // Attribute - // ========= - protected UserInfoDao _dao; - - //========================================================================== - // ========= // Table name // ========== /** @return The name on database of table. (NotNull) */ @@ -92,39 +84,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() { @@ -154,7 +125,7 @@ * @return The selected count. */ public int selectCount(UserInfoCB cb) { - assertConditionBeanNotNull(cb); + assertCBNotNull(cb); return delegateSelectCount(cb); } @@ -231,7 +202,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)); } @@ -247,7 +218,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>() { @@ -268,6 +239,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 // ============== /** @@ -277,8 +274,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); } @@ -470,8 +467,8 @@ //========================================================================== // ========= - // Pullout Foreign - // =============== + // Pull out Foreign + // ================ /** * Pull out the list of foreign table 'GroupInfo'. * @@ -796,11 +793,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)); } /** @@ -810,8 +807,8 @@ * @return The deleted count. */ public int queryDelete(UserInfoCB cb) { - assertConditionBeanNotNull(cb); - return getMyDao().deleteByQuery(cb); + assertCBNotNull(cb); + return invoke(createQueryDeleteCBCommand(cb)); } //========================================================================== @@ -823,19 +820,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 // ------ @@ -843,62 +848,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: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsAttachment.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -43,7 +43,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsAttachment implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategory.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsCategory implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsCategoryAccess.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsCategoryAccess implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsGroupInfo implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsGroupMapping.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsGroupMapping implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessage.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -46,7 +46,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsMessage implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageAttachment.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsMessageAttachment implements Entity, java.io.Serializable { Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsMessageContent.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsMessageContent implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsReply.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -41,7 +41,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsReply implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -44,7 +44,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsRoleInfo implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsRoleMapping.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -42,7 +42,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsRoleMapping implements Entity, java.io.Serializable { //========================================================================== Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/BsUserInfo.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,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] * @@ -46,7 +46,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class BsUserInfo implements Entity, java.io.Serializable { //========================================================================== @@ -114,6 +113,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; @@ -401,6 +403,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()); @@ -752,6 +755,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: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/AttachmentDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Attachment; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class AttachmentDbm extends AbstractDBMeta { private static final AttachmentDbm _instance = new AttachmentDbm(); @@ -96,40 +96,14 @@ return _columnCreatedBy; } - { - 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 @@ -286,7 +260,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<Attachment>> _epsMap = newHashMap(); + protected Map<String, Eps<Attachment>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsData(), columnData()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryAccessDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.CategoryAccess; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class CategoryAccessDbm extends AbstractDBMeta { private static final CategoryAccessDbm _instance = new CategoryAccessDbm(); @@ -110,40 +110,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 @@ -306,7 +280,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<CategoryAccess>> _epsMap = newHashMap(); + protected Map<String, Eps<CategoryAccess>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/CategoryDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Category; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class CategoryDbm extends AbstractDBMeta { private static final CategoryDbm _instance = new CategoryDbm(); @@ -117,40 +117,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 @@ -320,7 +294,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<Category>> _epsMap = newHashMap(); + protected Map<String, Eps<Category>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsName(), columnName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupInfoDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/GroupMappingDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageAttachmentDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.MessageAttachment; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageAttachmentDbm extends AbstractDBMeta { private static final MessageAttachmentDbm _instance = new MessageAttachmentDbm(); @@ -131,40 +131,14 @@ return _columnVersionno; } - { - initializeColumnInfoList(); - } - //========================================================================== // ========= - // Name Map - // ======== - public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { - return createDbNamePropertyNameKeyToLowerMap(); + // Resource Initialization + // ======================= + { + initializeInformationResource(); } - public Map<String, String> getPropertyNameDbNameKeyToLowerMap() { - return createPropertyNameDbNameKeyToLowerMap(); - } - - protected static Map<String, String> _dbNamePropertyNameKeyToLowerMap; - - protected Map<String, String> createDbNamePropertyNameKeyToLowerMap() { - if (_dbNamePropertyNameKeyToLowerMap == null) { - _dbNamePropertyNameKeyToLowerMap = setupKeyToLowerMap(true); - } - return _dbNamePropertyNameKeyToLowerMap; - } - - protected static Map<String, String> _propertyNameDbNameKeyToLowerMap; - - protected Map<String, String> createPropertyNameDbNameKeyToLowerMap() { - if (_propertyNameDbNameKeyToLowerMap == null) { - _propertyNameDbNameKeyToLowerMap = setupKeyToLowerMap(false); - } - return _propertyNameDbNameKeyToLowerMap; - } - //========================================================================== // ========= // Type Name @@ -336,7 +310,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<MessageAttachment>> _epsMap = newHashMap(); + protected Map<String, Eps<MessageAttachment>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsMemo(), columnMemo()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageContentDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.MessageContent; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageContentDbm extends AbstractDBMeta { private static final MessageContentDbm _instance = new MessageContentDbm(); @@ -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<MessageContent>> _epsMap = newHashMap(); + protected Map<String, Eps<MessageContent>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsMessageId(), columnMessageId()); setupEps(_epsMap, new EpsContent(), columnContent()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/MessageDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Message; /** @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageDbm extends AbstractDBMeta { private static final MessageDbm _instance = new MessageDbm(); @@ -153,40 +153,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 @@ -368,7 +342,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<Message>> _epsMap = newHashMap(); + protected Map<String, Eps<Message>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsDisplayName(), columnDisplayName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/ReplyDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.db.exentity.Reply; /** @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class ReplyDbm extends AbstractDBMeta { private static final ReplyDbm _instance = new ReplyDbm(); @@ -103,40 +103,14 @@ return _columnDeletedBy; } - { - 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 @@ -292,7 +266,8 @@ // Entity Property Setup // ===================== // It's very INTERNAL! - protected Map<String, Eps<Reply>> _epsMap = newHashMap(); + protected Map<String, Eps<Reply>> _epsMap = StringKeyMap + .createAsFlexibleConcurrent(); { setupEps(_epsMap, new EpsId(), columnId()); setupEps(_epsMap, new EpsDisplayName(), columnDisplayName()); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleInfoDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/RoleMappingDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,6 +8,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ColumnInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/bsentity/dbmeta/UserInfoDbm.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -9,6 +9,7 @@ import jp.sf.pal.board.db.allcommon.dbmeta.info.ForeignInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.ReferrerInfo; import jp.sf.pal.board.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.board.db.allcommon.helper.StringKeyMap; import jp.sf.pal.board.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 @@ -417,7 +398,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()); @@ -434,6 +416,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()); @@ -542,6 +525,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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsAttachmentCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -16,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsAttachmentCB extends AbstractConditionBean { //========================================================================== @@ -84,7 +83,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -134,23 +138,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<AttachmentCB> unionQuery). - */ - public void union(AttachmentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<AttachmentCB> - * unionQuery). - */ - public void unionAll(AttachmentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -178,7 +165,8 @@ public AttachmentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -188,8 +176,10 @@ protected SpQyCall<AttachmentCQ> _myQyCall; public Specification(ConditionBean baseCB, - SpQyCall<AttachmentCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<AttachmentCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryAccessCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsCategoryAccessCB 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<CategoryAccessCB> - * unionQuery). - */ - public void union(CategoryAccessCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<CategoryAccessCB> - * unionQuery). - */ - public void unionAll(CategoryAccessCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected CategoryNss _nssCategory; public CategoryNss getNssCategory() { @@ -202,7 +187,8 @@ public CategoryAccessCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected CategoryCB.Specification _category; public Specification(ConditionBean baseCB, - SpQyCall<CategoryAccessCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<CategoryAccessCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -280,7 +268,8 @@ public CategoryCQ qy() { return _myQyCall.qy().queryCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _category; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsCategoryCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -17,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsCategoryCB extends AbstractConditionBean { //========================================================================== @@ -85,7 +84,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -135,23 +139,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<CategoryCB> unionQuery). - */ - public void union(CategoryCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<CategoryCB> - * unionQuery). - */ - public void unionAll(CategoryCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -179,7 +166,8 @@ public CategoryCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -188,8 +176,10 @@ protected SpQyCall<CategoryCQ> _myQyCall; public Specification(ConditionBean baseCB, SpQyCall<CategoryCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupInfoCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsGroupMappingCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageAttachmentCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -21,7 +21,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMessageAttachmentCB 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<MessageAttachmentCB> - * unionQuery). - */ - public void union(MessageAttachmentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<MessageAttachmentCB> - * unionQuery). - */ - public void unionAll(MessageAttachmentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +151,6 @@ // ========= // Setup Select // ============ - protected AttachmentNss _nssAttachment; public AttachmentNss getNssAttachment() { @@ -226,7 +211,8 @@ public MessageAttachmentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -240,8 +226,11 @@ protected MessageCB.Specification _message; public Specification(ConditionBean baseCB, - SpQyCall<MessageAttachmentCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<MessageAttachmentCQ> qyCall, + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -321,7 +310,8 @@ public AttachmentCQ qy() { return _myQyCall.qy().queryAttachment(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _attachment; } @@ -340,7 +330,8 @@ public MessageCQ qy() { return _myQyCall.qy().queryMessage(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _message; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -23,7 +23,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMessageCB extends AbstractConditionBean { //========================================================================== @@ -91,7 +90,12 @@ return _conditionQuery; } - public ConditionQuery getConditionQueryAsInterface() { + /** + * The implementation. + * + * @return The conditionQuery of the local table as interface. (NotNull) + */ + public ConditionQuery localCQ() { return getConditionQuery(); } @@ -141,22 +145,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<MessageCB> unionQuery). - */ - public void union(MessageCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<MessageCB> unionQuery). - */ - public void unionAll(MessageCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -165,7 +153,6 @@ // ========= // Setup Select // ============ - protected CategoryNss _nssCategory; public CategoryNss getNssCategory() { @@ -227,7 +214,7 @@ public MessageCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -240,8 +227,10 @@ protected MessageContentCB.Specification _messageContentAsOne; public Specification(ConditionBean baseCB, SpQyCall<MessageCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -330,7 +319,8 @@ public CategoryCQ qy() { return _myQyCall.qy().queryCategory(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _category; } @@ -339,7 +329,8 @@ assertForeign("messageContentAsOne"); if (_messageContentAsOne == null) { _messageContentAsOne = new MessageContentCB.Specification( - _baseCB, new SpQyCall<MessageContentCQ>() { + _baseCB, + new SpQyCall<MessageContentCQ>() { public boolean has() { return _myQyCall.has() && _myQyCall @@ -351,7 +342,8 @@ return _myQyCall.qy() .queryMessageContentAsOne(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _messageContentAsOne; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsMessageContentCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMessageContentCB 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<MessageContentCB> - * unionQuery). - */ - public void union(MessageContentCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<MessageContentCB> - * unionQuery). - */ - public void unionAll(MessageContentCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -162,7 +148,6 @@ // ========= // Setup Select // ============ - protected MessageNss _nssMessage; public MessageNss getNssMessage() { @@ -202,7 +187,8 @@ public MessageContentCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -214,8 +200,10 @@ protected MessageCB.Specification _message; public Specification(ConditionBean baseCB, - SpQyCall<MessageContentCQ> qyCall, boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + SpQyCall<MessageContentCQ> qyCall, boolean forDeriveReferrer, + boolean forScalarSelect, boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -251,7 +239,8 @@ public MessageCQ qy() { return _myQyCall.qy().queryMessage(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _message; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsReplyCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsReplyCB 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,22 +140,6 @@ query().xsetUnionAllQuery(cq); } - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use union(UnionQuery<ReplyCB> unionQuery). - */ - public void union(ReplyCQ unionQuery) { - query().xsetUnionQuery(unionQuery); - } - - /** - * @param unionQuery The query of 'union'. (NotNull) - * @deprecated Sorry! Please use unionAll(UnionQuery<ReplyCB> unionQuery). - */ - public void unionAll(ReplyCQ unionQuery) { - query().xsetUnionAllQuery(unionQuery); - } - public boolean hasUnionQueryOrUnionAllQuery() { return query().hasUnionQueryOrUnionAllQuery(); } @@ -160,7 +148,6 @@ // ========= // Setup Select // ============ - protected MessageNss _nssMessage; public MessageNss getNssMessage() { @@ -199,7 +186,7 @@ public ReplyCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, _forScalarSubQuery); } return _specification; } @@ -210,8 +197,10 @@ protected MessageCB.Specification _message; public Specification(ConditionBean baseCB, SpQyCall<ReplyCQ> qyCall, - boolean forDeriveReferrer) { - super(baseCB, qyCall, forDeriveReferrer); + boolean forDeriveReferrer, boolean forScalarSelect, + boolean forScalarSubQuery) { + super(baseCB, qyCall, forDeriveReferrer, forScalarSelect, + forScalarSubQuery); _myQyCall = qyCall; } @@ -272,7 +261,8 @@ public MessageCQ qy() { return _myQyCall.qy().queryMessage(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _message; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleInfoCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsRoleMappingCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/bs/BsUserInfoCB.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -23,7 +23,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsUserInfoCB 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,23 +146,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(); } @@ -167,7 +154,6 @@ // ========= // Setup Select // ============ - protected GroupInfoNss _nssGroupInfo; public GroupInfoNss getNssGroupInfo() { @@ -228,7 +214,8 @@ public UserInfoCQ qy() { return query(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _specification; } @@ -241,8 +228,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; } @@ -306,6 +295,10 @@ doColumn("GROUP_ID"); } + public void columnStatus() { + doColumn("STATUS"); + } + public void columnCreatedTime() { doColumn("CREATED_TIME"); } @@ -362,7 +355,8 @@ public GroupInfoCQ qy() { return _myQyCall.qy().queryGroupInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _groupInfo; } @@ -381,7 +375,8 @@ public RoleInfoCQ qy() { return _myQyCall.qy().queryRoleInfo(); } - }, _forDeriveReferrer); + }, _forDerivedReferrer, _forScalarSelect, + _forScalarSubQuery); } return _roleInfo; } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsAttachmentCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -121,22 +121,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use inScopeMessageAttachmentList(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageAttachmentCBquery, "ID", - "ATTACHMENT_ID", subQueryPropertyName); - } - public void inScopeMessageAttachmentList( SubQuery<MessageAttachmentCB> subQuery) { assertObjectNotNull("subQuery<MessageAttachmentCB>", subQuery); @@ -144,12 +128,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageAttachmentList( + public abstract String keepId_InScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); public void notInScopeMessageAttachmentList( @@ -159,31 +143,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageAttachmentList( + public abstract String keepId_NotInScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use existsMessageAttachmentList(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageAttachmentCBquery, "ID", "ATTACHMENT_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select ATTACHMENT_ID from * MESSAGE_ATTACHMENT where ...)} * @@ -197,12 +165,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageAttachmentList( + public abstract String keepId_ExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** @@ -220,38 +188,38 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "ATTACHMENT_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageAttachmentList( + public abstract String keepId_NotExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); public void xderiveMessageAttachmentList(String function, SubQuery<MessageAttachmentCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<MessageAttachmentCB>", subQuery); MessageAttachmentCB cb = new MessageAttachmentCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "ATTACHMENT_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MessageAttachmentList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "ATTACHMENT_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MessageAttachmentList( + public abstract String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ 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); @@ -278,7 +246,7 @@ abstract protected ConditionValue getCValueData(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(255)} * * @param name The value of name as equal. */ @@ -287,7 +255,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -296,7 +264,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -305,7 +273,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -314,7 +282,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -323,7 +291,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -332,7 +300,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -341,20 +309,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -365,38 +319,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -413,7 +381,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {INTEGER} * * @param size The value of size as equal. */ @@ -422,7 +390,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as notEqual. */ @@ -431,7 +399,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as greaterThan. */ @@ -440,7 +408,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as lessThan. */ @@ -449,7 +417,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as greaterEqual. */ @@ -458,7 +426,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param size The value of size as lessEqual. */ @@ -487,14 +455,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setSize_IsNull() { regSize(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setSize_IsNotNull() { regSize(CK_ISNN, DUMMY_OBJECT); @@ -511,7 +479,7 @@ abstract protected ConditionValue getCValueSize(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(40)} * * @param contentType The value of contentType as equal. */ @@ -520,7 +488,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as notEqual. */ @@ -529,7 +497,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as greaterThan. */ @@ -538,7 +506,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as lessThan. */ @@ -547,7 +515,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as greaterEqual. */ @@ -556,7 +524,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as lessEqual. */ @@ -565,7 +533,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param contentType The value of contentType as prefixSearch. */ @@ -574,21 +542,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param contentType The value of contentType as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setContentType_LikeSearch( - String contentType, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(contentType), - getCValueContentType(), "CONTENT_TYPE", "ContentType", - "contentType", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -599,38 +552,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param contentType The collection of contentType as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param contentTypeList The collection of contentType as notInScope. */ - public void setContentType_InScope( + public void setContentType_NotInScope(Collection<String> contentTypeList) { + regContentType(CK_NINS, cTL(contentTypeList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param contentType The value of contentType as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setContentType_LikeSearch( String contentType, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(contentType), getCValueContentType(), - "CONTENT_TYPE", "ContentType", "contentType", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(contentType), getCValueContentType(), + "CONTENT_TYPE", "ContentType", "contentType", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param contentTypeList The collection of contentType as notInScope. + * @param contentType The value of contentType as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setContentType_NotInScope(Collection<String> contentTypeList) { - regContentType(CK_NINS, cTL(contentTypeList)); + public void setContentType_NotLikeSearch( + String contentType, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(contentType), getCValueContentType(), + "CONTENT_TYPE", "ContentType", "contentType", likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setContentType_IsNull() { regContentType(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setContentType_IsNotNull() { regContentType(CK_ISNN, DUMMY_OBJECT); @@ -649,7 +616,7 @@ abstract protected ConditionValue getCValueContentType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -658,7 +625,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -667,7 +634,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -676,7 +643,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -685,7 +652,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -694,7 +661,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -704,7 +671,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) @@ -721,7 +688,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) @@ -747,7 +714,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. @@ -757,7 +724,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -766,7 +733,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -775,7 +742,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -784,7 +751,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -793,7 +760,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -802,7 +769,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -811,20 +778,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.board.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. * @@ -835,27 +788,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -870,6 +837,50 @@ abstract protected ConditionValue getCValueCreatedBy(); + public SSQFunction<AttachmentCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<AttachmentCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<AttachmentCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<AttachmentCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<AttachmentCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<AttachmentCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<AttachmentCB>(new SSQSetupper<AttachmentCB>() { + public void setup(String function, SubQuery<AttachmentCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<AttachmentCB> subQuery, String operand) { + assertObjectNotNull("subQuery<AttachmentCB>", subQuery); + AttachmentCB cb = new AttachmentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(AttachmentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return AttachmentCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryAccessCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsCategoryAccessCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(255)} * * @param name The value of name as equal. @@ -156,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -165,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -174,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -183,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -192,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -201,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -210,20 +210,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -234,27 +220,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -268,7 +268,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER} * * @param accessType The value of accessType as equal. */ @@ -277,7 +277,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as notEqual. */ @@ -286,7 +286,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as greaterThan. */ @@ -295,7 +295,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as lessThan. */ @@ -304,7 +304,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as greaterEqual. */ @@ -313,7 +313,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param accessType The value of accessType as lessEqual. */ @@ -354,7 +354,7 @@ abstract protected ConditionValue getCValueAccessType(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : FK to * CATEGORY} * * @param categoryId The value of categoryId as equal. @@ -364,7 +364,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -373,7 +373,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -382,7 +382,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -391,7 +391,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -400,7 +400,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -428,34 +428,18 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param categoryCBquery Query. - * @deprecated Please use inScopeCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_Category( - CategoryCQ categoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(categoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(categoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeCategory(SubQuery<CategoryCB> subQuery) { assertObjectNotNull("subQuery<CategoryCB>", subQuery); CategoryCB cb = new CategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_Category( + public abstract String keepCategoryId_InScopeSubQuery_Category( CategoryCQ subQuery); protected void regCategoryId(ConditionKey key, Object value) { @@ -471,7 +455,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. */ @@ -480,7 +464,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -489,7 +473,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -498,7 +482,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -507,7 +491,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -516,7 +500,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -526,7 +510,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) @@ -543,7 +527,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) @@ -569,7 +553,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. @@ -579,7 +563,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -588,7 +572,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -597,7 +581,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -606,7 +590,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -615,7 +599,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -624,7 +608,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -633,20 +617,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.board.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. * @@ -657,27 +627,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -693,7 +677,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. */ @@ -702,7 +686,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -711,7 +695,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -720,7 +704,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -729,7 +713,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -738,7 +722,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -748,7 +732,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) @@ -765,7 +749,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) @@ -791,7 +775,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. @@ -801,7 +785,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -810,7 +794,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -819,7 +803,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -828,7 +812,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -837,7 +821,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -846,7 +830,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -855,20 +839,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.board.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. * @@ -879,27 +849,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -915,7 +899,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param versionno The value of versionno as equal. @@ -925,7 +909,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -934,7 +918,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -943,7 +927,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -952,7 +936,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -961,7 +945,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1001,6 +985,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<CategoryAccessCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<CategoryAccessCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<CategoryAccessCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<CategoryAccessCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<CategoryAccessCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<CategoryAccessCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<CategoryAccessCB>( + new SSQSetupper<CategoryAccessCB>() { + public void setup(String function, + SubQuery<CategoryAccessCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<CategoryAccessCB> subQuery, String operand) { + assertObjectNotNull("subQuery<CategoryAccessCB>", subQuery); + CategoryAccessCB cb = new CategoryAccessCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(CategoryAccessCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return CategoryAccessCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsCategoryCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsCategoryCQ extends AbstractConditionQuery { //========================================================================== @@ -50,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. */ @@ -59,7 +59,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -68,7 +68,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -77,7 +77,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -86,7 +86,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -95,7 +95,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -123,63 +123,32 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param categoryAccessCBquery Query. - * @deprecated Please use inScopeCategoryAccessList(subQuery) method. - */ - public void setId_InScopeSubQuery_CategoryAccessList( - CategoryAccessCQ categoryAccessCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_CategoryAccessList(categoryAccessCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(categoryAccessCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeCategoryAccessList(SubQuery<CategoryAccessCB> subQuery) { assertObjectNotNull("subQuery<CategoryAccessCB>", subQuery); CategoryAccessCB cb = new CategoryAccessCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_CategoryAccessList( + public abstract String keepId_InScopeSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessageList(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageList(MessageCQ messageCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageList(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - public void inScopeMessageList(SubQuery<MessageCB> subQuery) { assertObjectNotNull("subQuery<MessageCB>", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageList(MessageCQ subQuery); + public abstract String keepId_InScopeSubQuery_MessageList(MessageCQ subQuery); public void notInScopeCategoryAccessList(SubQuery<CategoryAccessCB> subQuery) { assertObjectNotNull("subQuery<CategoryAccessCB>", subQuery); @@ -187,12 +156,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_CategoryAccessList( + public abstract String keepId_NotInScopeSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); public void notInScopeMessageList(SubQuery<MessageCB> subQuery) { @@ -201,31 +170,15 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageList( + public abstract String keepId_NotInScopeSubQuery_MessageList( MessageCQ subQuery); /** - * @param categoryAccessCBquery Query. - * @deprecated Please use existsCategoryAccessList(subQuery) method. - */ - public void setId_ExistsSubQuery_CategoryAccessList( - CategoryAccessCQ categoryAccessCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_CategoryAccessList(categoryAccessCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(categoryAccessCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from * CATEGORY_ACCESS where ...)} * @@ -238,30 +191,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_CategoryAccessList( + public abstract String keepId_ExistsSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); /** - * @param messageCBquery Query. - * @deprecated Please use existsMessageList(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageList(MessageCQ messageCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageList(messageCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageCBquery, "ID", "CATEGORY_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select CATEGORY_ID from MESSAGE where * ...)} * @@ -274,12 +212,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageList(MessageCQ subQuery); + public abstract String keepId_ExistsSubQuery_MessageList(MessageCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select CATEGORY_ID from @@ -294,12 +232,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_CategoryAccessList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_CategoryAccessList( + public abstract String keepId_NotExistsSubQuery_CategoryAccessList( CategoryAccessCQ subQuery); /** @@ -315,52 +253,52 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "CATEGORY_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageList( + public abstract String keepId_NotExistsSubQuery_MessageList( MessageCQ subQuery); public void xderiveCategoryAccessList(String function, SubQuery<CategoryAccessCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<CategoryAccessCB>", subQuery); CategoryAccessCB cb = new CategoryAccessCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_CategoryAccessList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_CategoryAccessList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_CategoryAccessList( + public abstract String keepId_DerivedReferrer_CategoryAccessList( CategoryAccessCQ subQuery); public void xderiveMessageList(String function, SubQuery<MessageCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<MessageCB>", subQuery); MessageCB cb = new MessageCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MessageList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "CATEGORY_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MessageList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "CATEGORY_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MessageList(MessageCQ subQuery); + public abstract String keepId_DerivedReferrer_MessageList(MessageCQ 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); @@ -377,7 +315,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. @@ -387,7 +325,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as notEqual. */ @@ -396,7 +334,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterThan. */ @@ -405,7 +343,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessThan. */ @@ -414,7 +352,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as greaterEqual. */ @@ -423,7 +361,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as lessEqual. */ @@ -432,7 +370,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param name The value of name as prefixSearch. */ @@ -441,20 +379,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", - "Name", "name", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -465,27 +389,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(name), getCValueName(), "NAME", "Name", "name", + likeSearchOption); } protected void regName(ConditionKey key, Object value) { @@ -499,7 +437,7 @@ abstract protected ConditionValue getCValueName(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0]} * * @param sortOrder The value of sortOrder as equal. @@ -509,7 +447,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as notEqual. */ @@ -518,7 +456,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterThan. */ @@ -527,7 +465,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessThan. */ @@ -536,7 +474,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as greaterEqual. */ @@ -545,7 +483,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param sortOrder The value of sortOrder as lessEqual. */ @@ -586,7 +524,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. */ @@ -595,7 +533,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -604,7 +542,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -613,7 +551,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -622,7 +560,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -631,7 +569,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -641,7 +579,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) @@ -658,7 +596,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) @@ -684,7 +622,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. @@ -694,7 +632,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -703,7 +641,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -712,7 +650,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -721,7 +659,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -730,7 +668,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -739,7 +677,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -748,20 +686,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.board.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. * @@ -772,27 +696,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -808,7 +746,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. */ @@ -817,7 +755,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -826,7 +764,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -835,7 +773,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -844,7 +782,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -853,7 +791,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -863,7 +801,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) @@ -880,7 +818,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) @@ -906,7 +844,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. @@ -916,7 +854,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -925,7 +863,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -934,7 +872,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -943,7 +881,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -952,7 +890,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -961,7 +899,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -970,20 +908,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.board.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. * @@ -994,27 +918,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1030,7 +968,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1039,7 +977,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1048,7 +986,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1057,7 +995,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1066,7 +1004,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1075,7 +1013,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1085,7 +1023,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) @@ -1102,7 +1040,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) @@ -1116,14 +1054,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); @@ -1142,7 +1080,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. */ @@ -1151,7 +1089,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1160,7 +1098,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1169,7 +1107,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1178,7 +1116,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1187,7 +1125,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1196,7 +1134,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1205,20 +1143,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.board.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. * @@ -1229,38 +1153,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1279,7 +1217,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. @@ -1289,7 +1227,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1298,7 +1236,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1307,7 +1245,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1316,7 +1254,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1325,7 +1263,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1365,6 +1303,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<CategoryCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<CategoryCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<CategoryCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<CategoryCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<CategoryCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<CategoryCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<CategoryCB>(new SSQSetupper<CategoryCB>() { + public void setup(String function, SubQuery<CategoryCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<CategoryCB> subQuery, String operand) { + assertObjectNotNull("subQuery<CategoryCB>", subQuery); + CategoryCB cb = new CategoryCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(CategoryCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return CategoryCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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.board.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.board.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.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.board.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.board.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) @@ -1176,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) @@ -1202,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. @@ -1212,7 +1146,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1221,7 +1155,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1230,7 +1164,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1239,7 +1173,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1248,7 +1182,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1257,7 +1191,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1266,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.board.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. * @@ -1290,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1326,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. */ @@ -1335,7 +1269,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1344,7 +1278,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1353,7 +1287,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1362,7 +1296,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1371,7 +1305,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1381,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 +1332,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 +1358,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 +1368,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1443,7 +1377,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1452,7 +1386,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1461,7 +1395,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1470,7 +1404,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1479,7 +1413,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1488,20 +1422,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.board.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 +1432,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.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 +1482,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 +1491,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1566,7 +1500,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1575,7 +1509,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1584,7 +1518,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1593,7 +1527,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1603,7 +1537,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) @@ -1620,7 +1554,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) @@ -1634,14 +1568,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); @@ -1660,7 +1594,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. */ @@ -1669,7 +1603,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1678,7 +1612,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1687,7 +1621,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1696,7 +1630,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1705,7 +1639,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1714,7 +1648,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1723,20 +1657,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.board.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. * @@ -1747,38 +1667,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1797,7 +1731,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. */ @@ -1806,7 +1740,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1815,7 +1749,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1824,7 +1758,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1833,7 +1767,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1842,7 +1776,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1882,6 +1816,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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,16 +11,13 @@ import jp.sf.pal.board.db.cbean.GroupInfoCB; import jp.sf.pal.board.db.cbean.GroupMappingCB; import jp.sf.pal.board.db.cbean.UserInfoCB; -import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -20,7 +20,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsMessageAttachmentCQ extends AbstractConditionQuery { @@ -51,7 +50,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -60,7 +60,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -69,7 +69,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -78,7 +78,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -87,7 +87,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -96,7 +96,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -125,14 +125,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -149,7 +149,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(100)} * * @param memo The value of memo as equal. */ @@ -158,7 +158,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as notEqual. */ @@ -167,7 +167,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterThan. */ @@ -176,7 +176,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessThan. */ @@ -185,7 +185,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as greaterEqual. */ @@ -194,7 +194,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as lessEqual. */ @@ -203,7 +203,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param memo The value of memo as prefixSearch. */ @@ -212,20 +212,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param memo The value of memo as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setMemo_LikeSearch( - String memo, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -236,38 +222,52 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param memo The collection of memo as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param memoList The collection of memo as notInScope. */ - public void setMemo_InScope( + public void setMemo_NotInScope(Collection<String> memoList) { + regMemo(CK_NINS, cTL(memoList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param memo The value of memo as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setMemo_LikeSearch( String memo, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(memo), getCValueMemo(), "MEMO", - "Memo", "memo", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param memoList The collection of memo as notInScope. + * @param memo The value of memo as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setMemo_NotInScope(Collection<String> memoList) { - regMemo(CK_NINS, cTL(memoList)); + public void setMemo_NotLikeSearch( + String memo, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(memo), getCValueMemo(), "MEMO", "Memo", "memo", + likeSearchOption); } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMemo_IsNull() { regMemo(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMemo_IsNotNull() { regMemo(CK_ISNN, DUMMY_OBJECT); @@ -284,8 +284,8 @@ abstract protected ConditionValue getCValueMemo(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[F]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[F]} * * @param versionable The value of versionable as equal. */ @@ -294,7 +294,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as notEqual. */ @@ -303,7 +303,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as greaterThan. */ @@ -312,7 +312,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as lessThan. */ @@ -321,7 +321,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as greaterEqual. */ @@ -330,7 +330,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as lessEqual. */ @@ -339,7 +339,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param versionable The value of versionable as prefixSearch. */ @@ -348,21 +348,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param versionable The value of versionable as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setVersionable_LikeSearch( - String versionable, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(versionable), - getCValueVersionable(), "VERSIONABLE", "Versionable", - "versionable", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -373,27 +358,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param versionable The collection of versionable as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param versionableList The collection of versionable as notInScope. */ - public void setVersionable_InScope( + public void setVersionable_NotInScope(Collection<String> versionableList) { + regVersionable(CK_NINS, cTL(versionableList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param versionable The value of versionable as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setVersionable_LikeSearch( String versionable, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(versionable), getCValueVersionable(), - "VERSIONABLE", "Versionable", "versionable", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(versionable), getCValueVersionable(), "VERSIONABLE", + "Versionable", "versionable", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param versionableList The collection of versionable as notInScope. + * @param versionable The value of versionable as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setVersionable_NotInScope(Collection<String> versionableList) { - regVersionable(CK_NINS, cTL(versionableList)); + public void setVersionable_NotLikeSearch( + String versionable, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(versionable), getCValueVersionable(), + "VERSIONABLE", "Versionable", "versionable", likeSearchOption); } protected void regVersionable(ConditionKey key, Object value) { @@ -409,7 +408,7 @@ abstract protected ConditionValue getCValueVersionable(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * MESSAGE} * * @param messageId The value of messageId as equal. @@ -419,7 +418,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as notEqual. */ @@ -428,7 +427,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterThan. */ @@ -437,7 +436,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessThan. */ @@ -446,7 +445,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterEqual. */ @@ -455,7 +454,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessEqual. */ @@ -483,33 +482,18 @@ regMessageId(CK_NINS, cTL(messageIdList)); } - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessage(subQuery) method. - */ - public void setMessageId_InScopeSubQuery_Message(MessageCQ messageCBquery) { - String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "MESSAGE_ID", "ID", - subQueryPropertyName); - } - public void inScopeMessage(SubQuery<MessageCB> subQuery) { assertObjectNotNull("subQuery<MessageCB>", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MESSAGE_ID", "ID", subQueryPropertyName); } - abstract public String keepMessageId_InScopeSubQuery_Message( + public abstract String keepMessageId_InScopeSubQuery_Message( MessageCQ subQuery); protected void regMessageId(ConditionKey key, Object value) { @@ -525,7 +509,7 @@ abstract protected ConditionValue getCValueMessageId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * ATTACHMENT} * * @param attachmentId The value of attachmentId as equal. @@ -535,7 +519,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as notEqual. */ @@ -544,7 +528,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as greaterThan. */ @@ -553,7 +537,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as lessThan. */ @@ -562,7 +546,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as greaterEqual. */ @@ -571,7 +555,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param attachmentId The value of attachmentId as lessEqual. */ @@ -599,34 +583,18 @@ regAttachmentId(CK_NINS, cTL(attachmentIdList)); } - /** - * @param attachmentCBquery Query. - * @deprecated Please use inScopeAttachment(subQuery) method. - */ - public void setAttachmentId_InScopeSubQuery_Attachment( - AttachmentCQ attachmentCBquery) { - String subQueryPropertyName = keepAttachmentId_InScopeSubQuery_Attachment(attachmentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(attachmentCBquery, "ATTACHMENT_ID", "ID", - subQueryPropertyName); - } - public void inScopeAttachment(SubQuery<AttachmentCB> subQuery) { assertObjectNotNull("subQuery<AttachmentCB>", subQuery); AttachmentCB cb = new AttachmentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepAttachmentId_InScopeSubQuery_Attachment(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ATTACHMENT_ID", "ID", subQueryPropertyName); } - abstract public String keepAttachmentId_InScopeSubQuery_Attachment( + public abstract String keepAttachmentId_InScopeSubQuery_Attachment( AttachmentCQ subQuery); protected void regAttachmentId(ConditionKey key, Object value) { @@ -642,7 +610,7 @@ abstract protected ConditionValue getCValueAttachmentId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -651,7 +619,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -660,7 +628,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -669,7 +637,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -678,7 +646,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -687,7 +655,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -697,7 +665,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) @@ -714,7 +682,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) @@ -740,7 +708,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. @@ -750,7 +718,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -759,7 +727,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -768,7 +736,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -777,7 +745,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -786,7 +754,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -795,7 +763,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -804,20 +772,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.board.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. * @@ -828,27 +782,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -864,7 +832,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. */ @@ -873,7 +841,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -882,7 +850,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -891,7 +859,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -900,7 +868,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -909,7 +877,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -919,7 +887,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) @@ -936,7 +904,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) @@ -962,7 +930,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. @@ -972,7 +940,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -981,7 +949,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -990,7 +958,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -999,7 +967,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1008,7 +976,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1017,7 +985,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1026,20 +994,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.board.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. * @@ -1050,27 +1004,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1086,7 +1054,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1095,7 +1063,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1104,7 +1072,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1113,7 +1081,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1122,7 +1090,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1131,7 +1099,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1141,7 +1109,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) @@ -1158,7 +1126,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) @@ -1172,14 +1140,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); @@ -1198,7 +1166,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. */ @@ -1207,7 +1175,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1216,7 +1184,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1225,7 +1193,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1234,7 +1202,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1243,7 +1211,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1252,7 +1220,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1261,20 +1229,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.board.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. * @@ -1285,38 +1239,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1335,7 +1303,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. @@ -1345,7 +1313,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1354,7 +1322,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1363,7 +1331,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1372,7 +1340,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1381,7 +1349,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1421,6 +1389,53 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<MessageAttachmentCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<MessageAttachmentCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<MessageAttachmentCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<MessageAttachmentCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<MessageAttachmentCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<MessageAttachmentCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<MessageAttachmentCB>( + new SSQSetupper<MessageAttachmentCB>() { + public void setup(String function, + SubQuery<MessageAttachmentCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<MessageAttachmentCB> subQuery, String operand) { + assertObjectNotNull("subQuery<MessageAttachmentCB>", subQuery); + MessageAttachmentCB cb = new MessageAttachmentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MessageAttachmentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MessageAttachmentCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -24,7 +24,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsMessageCQ extends AbstractConditionQuery { //========================================================================== @@ -54,7 +53,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. */ @@ -63,7 +63,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -72,7 +72,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -81,7 +81,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -90,7 +90,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -99,7 +99,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -127,22 +127,6 @@ regId(CK_NINS, cTL(idList)); } - /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use inScopeMessageAttachmentList(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageAttachmentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - public void inScopeMessageAttachmentList( SubQuery<MessageAttachmentCB> subQuery) { assertObjectNotNull("subQuery<MessageAttachmentCB>", subQuery); @@ -150,71 +134,40 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageAttachmentList( + public abstract String keepId_InScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); - /** - * @param messageContentCBquery Query. - * @deprecated Please use inScopeMessageContentAsOne(subQuery) method. - */ - public void setId_InScopeSubQuery_MessageContentAsOne( - MessageContentCQ messageContentCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_MessageContentAsOne(messageContentCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageContentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - public void inScopeMessageContentAsOne(SubQuery<MessageContentCB> subQuery) { assertObjectNotNull("subQuery<MessageContentCB>", subQuery); MessageContentCB cb = new MessageContentCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_MessageContentAsOne( + public abstract String keepId_InScopeSubQuery_MessageContentAsOne( MessageContentCQ subQuery); - /** - * @param replyCBquery Query. - * @deprecated Please use inScopeReplyList(subQuery) method. - */ - public void setId_InScopeSubQuery_ReplyList(ReplyCQ replyCBquery) { - String subQueryPropertyName = keepId_InScopeSubQuery_ReplyList(replyCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(replyCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - public void inScopeReplyList(SubQuery<ReplyCB> subQuery) { assertObjectNotNull("subQuery<ReplyCB>", subQuery); ReplyCB cb = new ReplyCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_InScopeSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_InScopeSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_InScopeSubQuery_ReplyList(ReplyCQ subQuery); public void notInScopeMessageAttachmentList( SubQuery<MessageAttachmentCB> subQuery) { @@ -223,12 +176,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageAttachmentList( + public abstract String keepId_NotInScopeSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); public void notInScopeMessageContentAsOne( @@ -238,12 +191,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_MessageContentAsOne( + public abstract String keepId_NotInScopeSubQuery_MessageContentAsOne( MessageContentCQ subQuery); public void notInScopeReplyList(SubQuery<ReplyCB> subQuery) { @@ -252,30 +205,14 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotInScopeSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotInScopeSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_NotInScopeSubQuery_ReplyList(ReplyCQ subQuery); /** - * @param messageAttachmentCBquery Query. - * @deprecated Please use existsMessageAttachmentList(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageAttachmentList( - MessageAttachmentCQ messageAttachmentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(messageAttachmentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageAttachmentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MESSAGE_ID from * MESSAGE_ATTACHMENT where ...)} * @@ -289,31 +226,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageAttachmentList( + public abstract String keepId_ExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** - * @param messageContentCBquery Query. - * @deprecated Please use existsMessageContentAsOne(subQuery) method. - */ - public void setId_ExistsSubQuery_MessageContentAsOne( - MessageContentCQ messageContentCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_MessageContentAsOne(messageContentCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(messageContentCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MESSAGE_ID from * MESSAGE_CONTENT where ...)} * @@ -326,30 +247,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_MessageContentAsOne( + public abstract String keepId_ExistsSubQuery_MessageContentAsOne( MessageContentCQ subQuery); /** - * @param replyCBquery Query. - * @deprecated Please use existsReplyList(subQuery) method. - */ - public void setId_ExistsSubQuery_ReplyList(ReplyCQ replyCBquery) { - String subQueryPropertyName = keepId_ExistsSubQuery_ReplyList(replyCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(replyCBquery, "ID", "MESSAGE_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select MESSAGE_ID from REPLY where * ...)} * @@ -362,12 +268,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_ExistsSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_ExistsSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_ExistsSubQuery_ReplyList(ReplyCQ subQuery); /** * Set up 'not exists' sub-query. {not exists (select MESSAGE_ID from @@ -384,12 +290,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageAttachmentList( + public abstract String keepId_NotExistsSubQuery_MessageAttachmentList( MessageAttachmentCQ subQuery); /** @@ -405,12 +311,12 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_MessageContentAsOne(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_MessageContentAsOne( + public abstract String keepId_NotExistsSubQuery_MessageContentAsOne( MessageContentCQ subQuery); /** @@ -426,51 +332,51 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepId_NotExistsSubQuery_ReplyList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotExistsSubQuery(cb.query(), "ID", "MESSAGE_ID", subQueryPropertyName); } - abstract public String keepId_NotExistsSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_NotExistsSubQuery_ReplyList(ReplyCQ subQuery); public void xderiveMessageAttachmentList(String function, SubQuery<MessageAttachmentCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<MessageAttachmentCB>", subQuery); MessageAttachmentCB cb = new MessageAttachmentCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_MessageAttachmentList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MESSAGE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_MessageAttachmentList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MESSAGE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_MessageAttachmentList( + public abstract String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery); public void xderiveReplyList(String function, SubQuery<ReplyCB> subQuery, String aliasName) { assertObjectNotNull("subQuery<ReplyCB>", subQuery); ReplyCB cb = new ReplyCB(); - cb.xsetupForDeriveReferrer(); + cb.xsetupForDerivedReferrer(); subQuery.query(cb); - String subQueryPropertyName = keepId_DeriveSubQuery_ReplyList(cb - .query());// for saving query-value. - registerDeriveSubQuery(function, cb.query(), "ID", "MESSAGE_ID", - subQueryPropertyName, aliasName); + String subQueryPropertyName = keepId_DerivedReferrer_ReplyList(cb + .query()); // for saving query-value. + registerDerivedReferrerSubQuery(function, cb.query(), "ID", + "MESSAGE_ID", subQueryPropertyName, aliasName); } - abstract public String keepId_DeriveSubQuery_ReplyList(ReplyCQ subQuery); + public abstract String keepId_DerivedReferrer_ReplyList(ReplyCQ 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); @@ -487,7 +393,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param displayName The value of displayName as equal. @@ -497,7 +403,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as notEqual. */ @@ -506,7 +412,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterThan. */ @@ -515,7 +421,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessThan. */ @@ -524,7 +430,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterEqual. */ @@ -533,7 +439,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessEqual. */ @@ -542,7 +448,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as prefixSearch. */ @@ -551,21 +457,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param displayName The value of displayName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDisplayName_LikeSearch( - String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(displayName), - getCValueDisplayName(), "DISPLAY_NAME", "DisplayName", - "displayName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -576,27 +467,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param displayName The collection of displayName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param displayNameList The collection of displayName as notInScope. */ - public void setDisplayName_InScope( + public void setDisplayName_NotInScope(Collection<String> displayNameList) { + regDisplayName(CK_NINS, cTL(displayNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param displayName The value of displayName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDisplayName_LikeSearch( String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(displayName), getCValueDisplayName(), - "DISPLAY_NAME", "DisplayName", "displayName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param displayNameList The collection of displayName as notInScope. + * @param displayName The value of displayName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDisplayName_NotInScope(Collection<String> displayNameList) { - regDisplayName(CK_NINS, cTL(displayNameList)); + public void setDisplayName_NotLikeSearch( + String displayName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } protected void regDisplayName(ConditionKey key, Object value) { @@ -612,7 +517,7 @@ abstract protected ConditionValue getCValueDisplayName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(200)} * * @param title The value of title as equal. @@ -622,7 +527,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as notEqual. */ @@ -631,7 +536,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterThan. */ @@ -640,7 +545,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessThan. */ @@ -649,7 +554,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as greaterEqual. */ @@ -658,7 +563,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as lessEqual. */ @@ -667,7 +572,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param title The value of title as prefixSearch. */ @@ -676,20 +581,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -700,27 +591,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", - "Title", "title", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(title), getCValueTitle(), "TITLE", "Title", + "title", likeSearchOption); } protected void regTitle(ConditionKey key, Object value) { @@ -735,8 +640,8 @@ abstract protected ConditionValue getCValueTitle(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[E]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[E]} * * @param status The value of status as equal. */ @@ -745,7 +650,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as notEqual. */ @@ -754,7 +659,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterThan. */ @@ -763,7 +668,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as lessThan. */ @@ -772,7 +677,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as greaterEqual. */ @@ -781,7 +686,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as lessEqual. */ @@ -790,7 +695,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param status The value of status as prefixSearch. */ @@ -799,20 +704,6 @@ } /** - * 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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(status), getCValueStatus(), - "STATUS", "Status", "status", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -823,27 +714,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param status The collection of status as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param statusList The collection of status as notInScope. */ - public void setStatus_InScope( + 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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(status), getCValueStatus(), "STATUS", - "Status", "status", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param statusList The collection of status as notInScope. + * @param status The value of status as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setStatus_NotInScope(Collection<String> statusList) { - regStatus(CK_NINS, cTL(statusList)); + public void setStatus_NotLikeSearch( + String status, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(status), getCValueStatus(), "STATUS", "Status", + "status", likeSearchOption); } protected void regStatus(ConditionKey key, Object value) { @@ -859,7 +764,7 @@ abstract protected ConditionValue getCValueStatus(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param startTime The value of startTime as equal. */ @@ -868,7 +773,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as notEqual. */ @@ -877,7 +782,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterThan. */ @@ -886,7 +791,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessThan. */ @@ -895,7 +800,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as greaterEqual. */ @@ -904,7 +809,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param startTime The value of startTime as lessEqual. */ @@ -914,7 +819,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of startTime. (Nullable) * @param toDate The to-date of startTime. (Nullable) @@ -931,7 +836,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of startTime. (Nullable) * @param toDate The to-date of startTime. (Nullable) @@ -945,14 +850,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setStartTime_IsNull() { regStartTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setStartTime_IsNotNull() { regStartTime(CK_ISNN, DUMMY_OBJECT); @@ -971,7 +876,7 @@ abstract protected ConditionValue getCValueStartTime(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param endTime The value of endTime as equal. */ @@ -980,7 +885,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as notEqual. */ @@ -989,7 +894,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterThan. */ @@ -998,7 +903,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessThan. */ @@ -1007,7 +912,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as greaterEqual. */ @@ -1016,7 +921,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param endTime The value of endTime as lessEqual. */ @@ -1026,7 +931,7 @@ /** * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of endTime. (Nullable) * @param toDate The to-date of endTime. (Nullable) @@ -1043,7 +948,7 @@ /** * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, - * OnceRegistered. {TIMESTAMP} + * OnlyOnceRegistered. {TIMESTAMP} * * @param fromDate The from-date of endTime. (Nullable) * @param toDate The to-date of endTime. (Nullable) @@ -1057,14 +962,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setEndTime_IsNull() { regEndTime(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setEndTime_IsNotNull() { regEndTime(CK_ISNN, DUMMY_OBJECT); @@ -1083,8 +988,8 @@ abstract protected ConditionValue getCValueEndTime(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(1) : - * Default=[T]} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : + * VARCHAR(1) : Default=[T]} * * @param hasReply The value of hasReply as equal. */ @@ -1093,7 +998,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as notEqual. */ @@ -1102,7 +1007,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as greaterThan. */ @@ -1111,7 +1016,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as lessThan. */ @@ -1120,7 +1025,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as greaterEqual. */ @@ -1129,7 +1034,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as lessEqual. */ @@ -1138,7 +1043,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param hasReply The value of hasReply as prefixSearch. */ @@ -1147,20 +1052,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param hasReply The value of hasReply as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setHasReply_LikeSearch( - String hasReply, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(hasReply), getCValueHasReply(), - "HAS_REPLY", "HasReply", "hasReply", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1171,27 +1062,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param hasReply The collection of hasReply as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param hasReplyList The collection of hasReply as notInScope. */ - public void setHasReply_InScope( + public void setHasReply_NotInScope(Collection<String> hasReplyList) { + regHasReply(CK_NINS, cTL(hasReplyList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param hasReply The value of hasReply as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setHasReply_LikeSearch( String hasReply, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(hasReply), getCValueHasReply(), - "HAS_REPLY", "HasReply", "hasReply", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(hasReply), getCValueHasReply(), "HAS_REPLY", + "HasReply", "hasReply", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param hasReplyList The collection of hasReply as notInScope. + * @param hasReply The value of hasReply as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setHasReply_NotInScope(Collection<String> hasReplyList) { - regHasReply(CK_NINS, cTL(hasReplyList)); + public void setHasReply_NotLikeSearch( + String hasReply, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(hasReply), getCValueHasReply(), "HAS_REPLY", + "HasReply", "hasReply", likeSearchOption); } protected void regHasReply(ConditionKey key, Object value) { @@ -1207,7 +1112,7 @@ abstract protected ConditionValue getCValueHasReply(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER : + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : INTEGER : * Default=[0] : FK to CATEGORY} * * @param categoryId The value of categoryId as equal. @@ -1217,7 +1122,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as notEqual. */ @@ -1226,7 +1131,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterThan. */ @@ -1235,7 +1140,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessThan. */ @@ -1244,7 +1149,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as greaterEqual. */ @@ -1253,7 +1158,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param categoryId The value of categoryId as lessEqual. */ @@ -1281,34 +1186,18 @@ regCategoryId(CK_NINS, cTL(categoryIdList)); } - /** - * @param categoryCBquery Query. - * @deprecated Please use inScopeCategory(subQuery) method. - */ - public void setCategoryId_InScopeSubQuery_Category( - CategoryCQ categoryCBquery) { - String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(categoryCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(categoryCBquery, "CATEGORY_ID", "ID", - subQueryPropertyName); - } - public void inScopeCategory(SubQuery<CategoryCB> subQuery) { assertObjectNotNull("subQuery<CategoryCB>", subQuery); CategoryCB cb = new CategoryCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepCategoryId_InScopeSubQuery_Category(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "CATEGORY_ID", "ID", subQueryPropertyName); } - abstract public String keepCategoryId_InScopeSubQuery_Category( + public abstract String keepCategoryId_InScopeSubQuery_Category( CategoryCQ subQuery); protected void regCategoryId(ConditionKey key, Object value) { @@ -1324,7 +1213,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. */ @@ -1333,7 +1222,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -1342,7 +1231,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -1351,7 +1240,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -1360,7 +1249,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -1369,7 +1258,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -1379,7 +1268,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) @@ -1396,7 +1285,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) @@ -1422,7 +1311,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. @@ -1432,7 +1321,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1441,7 +1330,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1450,7 +1339,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1459,7 +1348,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1468,7 +1357,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1477,7 +1366,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1486,20 +1375,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.board.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. * @@ -1510,27 +1385,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1546,7 +1435,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. */ @@ -1555,7 +1444,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1564,7 +1453,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1573,7 +1462,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1582,7 +1471,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1591,7 +1480,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1601,7 +1490,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) @@ -1618,7 +1507,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) @@ -1644,7 +1533,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. @@ -1654,7 +1543,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1663,7 +1552,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1672,7 +1561,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1681,7 +1570,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1690,7 +1579,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1699,7 +1588,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1708,20 +1597,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.board.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. * @@ -1732,27 +1607,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1768,7 +1657,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1777,7 +1666,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1786,7 +1675,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1795,7 +1684,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1804,7 +1693,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1813,7 +1702,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1823,7 +1712,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) @@ -1840,7 +1729,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) @@ -1854,14 +1743,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); @@ -1880,7 +1769,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. */ @@ -1889,7 +1778,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1898,7 +1787,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1907,7 +1796,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1916,7 +1805,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1925,7 +1814,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1934,7 +1823,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1943,20 +1832,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.board.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. * @@ -1967,38 +1842,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -2017,7 +1906,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. @@ -2027,7 +1916,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -2036,7 +1925,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -2045,7 +1934,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -2054,7 +1943,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -2063,7 +1952,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -2103,6 +1992,50 @@ abstract protected ConditionValue getCValueVersionno(); + public SSQFunction<MessageCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<MessageCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<MessageCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<MessageCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<MessageCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<MessageCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<MessageCB>(new SSQSetupper<MessageCB>() { + public void setup(String function, SubQuery<MessageCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<MessageCB> subQuery, String operand) { + assertObjectNotNull("subQuery<MessageCB>", subQuery); + MessageCB cb = new MessageCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MessageCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MessageCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsMessageContentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsMessageContentCQ extends AbstractConditionQuery { //========================================================================== @@ -48,8 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to - * MESSAGE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : NotNull : BIGINT : + * FK to MESSAGE} * * @param messageId The value of messageId as equal. */ @@ -58,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as notEqual. */ @@ -67,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterThan. */ @@ -76,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessThan. */ @@ -85,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterEqual. */ @@ -94,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessEqual. */ @@ -122,44 +121,29 @@ regMessageId(CK_NINS, cTL(messageIdList)); } - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessage(subQuery) method. - */ - public void setMessageId_InScopeSubQuery_Message(MessageCQ messageCBquery) { - String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "MESSAGE_ID", "ID", - subQueryPropertyName); - } - public void inScopeMessage(SubQuery<MessageCB> subQuery) { assertObjectNotNull("subQuery<MessageCB>", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MESSAGE_ID", "ID", subQueryPropertyName); } - abstract public String keepMessageId_InScopeSubQuery_Message( + public abstract String keepMessageId_InScopeSubQuery_Message( MessageCQ subQuery); /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setMessageId_IsNull() { regMessageId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setMessageId_IsNotNull() { regMessageId(CK_ISNN, DUMMY_OBJECT); @@ -178,7 +162,7 @@ abstract protected ConditionValue getCValueMessageId(); /** - * 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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.board.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.board.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<MessageContentCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<MessageContentCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<MessageContentCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<MessageContentCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<MessageContentCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<MessageContentCB> xcreateSSQFunction( + final String operand) { + return new SSQFunction<MessageContentCB>( + new SSQSetupper<MessageContentCB>() { + public void setup(String function, + SubQuery<MessageContentCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, + SubQuery<MessageContentCB> subQuery, String operand) { + assertObjectNotNull("subQuery<MessageContentCB>", subQuery); + MessageContentCB cb = new MessageContentCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(MessageContentCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return MessageContentCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsReplyCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -18,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsReplyCQ extends AbstractConditionQuery { //========================================================================== @@ -48,7 +47,8 @@ // ===== /** - * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {PK : ID : NotNull : + * BIGINT} * * @param id The value of id as equal. */ @@ -57,7 +57,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as notEqual. */ @@ -66,7 +66,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterThan. */ @@ -75,7 +75,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessThan. */ @@ -84,7 +84,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as greaterEqual. */ @@ -93,7 +93,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param id The value of id as lessEqual. */ @@ -122,14 +122,14 @@ } /** - * IsNull(is null). And OnceRegistered. + * IsNull(is null). And OnlyOnceRegistered. */ public void setId_IsNull() { regId(CK_ISN, DUMMY_OBJECT); } /** - * IsNotNull(is not null). And OnceRegistered. + * IsNotNull(is not null). And OnlyOnceRegistered. */ public void setId_IsNotNull() { regId(CK_ISNN, DUMMY_OBJECT); @@ -146,7 +146,7 @@ abstract protected ConditionValue getCValueId(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {NotNull : * VARCHAR(100)} * * @param displayName The value of displayName as equal. @@ -156,7 +156,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as notEqual. */ @@ -165,7 +165,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterThan. */ @@ -174,7 +174,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessThan. */ @@ -183,7 +183,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as greaterEqual. */ @@ -192,7 +192,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as lessEqual. */ @@ -201,7 +201,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param displayName The value of displayName as prefixSearch. */ @@ -210,21 +210,6 @@ } /** - * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, - * SeveralRegistered. - * - * @param displayName The value of displayName as likeSearch. - * @param likeSearchOption The option of like-search. (NotNull) - */ - public void setDisplayName_LikeSearch( - String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(displayName), - getCValueDisplayName(), "DISPLAY_NAME", "DisplayName", - "displayName", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -235,27 +220,41 @@ } /** - * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * - * @param displayName The collection of displayName as inScope. - * @param inScopeOption The option of in-scope. (NotNull) + * @param displayNameList The collection of displayName as notInScope. */ - public void setDisplayName_InScope( + public void setDisplayName_NotInScope(Collection<String> displayNameList) { + regDisplayName(CK_NINS, cTL(displayNameList)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param displayName The value of displayName as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setDisplayName_LikeSearch( String displayName, - jp.sf.pal.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(displayName), getCValueDisplayName(), - "DISPLAY_NAME", "DisplayName", "displayName", inScopeOption); + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_LS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } /** - * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, - * NullOrEmptyElementIgnored, SeveralRegistered. + * NotLikeSearch(not like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. * - * @param displayNameList The collection of displayName as notInScope. + * @param displayName The value of displayName as notLikeSearch. + * @param likeSearchOption The option of not-like-search. (NotNull) */ - public void setDisplayName_NotInScope(Collection<String> displayNameList) { - regDisplayName(CK_NINS, cTL(displayNameList)); + public void setDisplayName_NotLikeSearch( + String displayName, + jp.sf.pal.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(displayName), getCValueDisplayName(), + "DISPLAY_NAME", "DisplayName", "displayName", likeSearchOption); } protected void regDisplayName(ConditionKey key, Object value) { @@ -271,7 +270,7 @@ abstract protected ConditionValue getCValueDisplayName(); /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(4000)} + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {VARCHAR(4000)} * * @param content The value of content as equal. */ @@ -280,7 +279,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as notEqual. */ @@ -289,7 +288,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterThan. */ @@ -298,7 +297,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessThan. */ @@ -307,7 +306,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as greaterEqual. */ @@ -316,7 +315,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as lessEqual. */ @@ -325,7 +324,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param content The value of content as prefixSearch. */ @@ -334,20 +333,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -358,38 +343,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), - "CONTENT", "Content", "content", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -408,7 +407,7 @@ abstract protected ConditionValue getCValueContent(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : BIGINT : FK to * MESSAGE} * * @param messageId The value of messageId as equal. @@ -418,7 +417,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as notEqual. */ @@ -427,7 +426,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterThan. */ @@ -436,7 +435,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessThan. */ @@ -445,7 +444,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as greaterEqual. */ @@ -454,7 +453,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param messageId The value of messageId as lessEqual. */ @@ -482,33 +481,18 @@ regMessageId(CK_NINS, cTL(messageIdList)); } - /** - * @param messageCBquery Query. - * @deprecated Please use inScopeMessage(subQuery) method. - */ - public void setMessageId_InScopeSubQuery_Message(MessageCQ messageCBquery) { - String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(messageCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(messageCBquery, "MESSAGE_ID", "ID", - subQueryPropertyName); - } - public void inScopeMessage(SubQuery<MessageCB> subQuery) { assertObjectNotNull("subQuery<MessageCB>", subQuery); MessageCB cb = new MessageCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepMessageId_InScopeSubQuery_Message(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "MESSAGE_ID", "ID", subQueryPropertyName); } - abstract public String keepMessageId_InScopeSubQuery_Message( + public abstract String keepMessageId_InScopeSubQuery_Message( MessageCQ subQuery); protected void regMessageId(ConditionKey key, Object value) { @@ -524,7 +508,7 @@ abstract protected ConditionValue getCValueMessageId(); /** - * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {NotNull : TIMESTAMP} * * @param createdTime The value of createdTime as equal. */ @@ -533,7 +517,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -542,7 +526,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -551,7 +535,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -560,7 +544,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -569,7 +553,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -579,7 +563,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) @@ -596,7 +580,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) @@ -622,7 +606,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. @@ -632,7 +616,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -641,7 +625,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -650,7 +634,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -659,7 +643,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -668,7 +652,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -677,7 +661,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -686,20 +670,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.board.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. * @@ -710,27 +680,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -746,7 +730,7 @@ abstract protected ConditionValue getCValueCreatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -755,7 +739,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -764,7 +748,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -773,7 +757,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -782,7 +766,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -791,7 +775,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -801,7 +785,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) @@ -818,7 +802,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) @@ -832,14 +816,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); @@ -858,7 +842,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. */ @@ -867,7 +851,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -876,7 +860,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -885,7 +869,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -894,7 +878,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -903,7 +887,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -912,7 +896,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -921,20 +905,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.board.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. * @@ -945,38 +915,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -994,6 +978,50 @@ abstract protected ConditionValue getCValueDeletedBy(); + public SSQFunction<ReplyCB> scalar_Equal() { + return xcreateSSQFunction("="); + } + + public SSQFunction<ReplyCB> scalar_GreaterEqual() { + return xcreateSSQFunction(">="); + } + + public SSQFunction<ReplyCB> scalar_GreaterThan() { + return xcreateSSQFunction(">"); + } + + public SSQFunction<ReplyCB> scalar_LessEqual() { + return xcreateSSQFunction("<="); + } + + public SSQFunction<ReplyCB> scalar_LessThan() { + return xcreateSSQFunction("<"); + } + + protected SSQFunction<ReplyCB> xcreateSSQFunction(final String operand) { + return new SSQFunction<ReplyCB>(new SSQSetupper<ReplyCB>() { + public void setup(String function, SubQuery<ReplyCB> subQuery) { + xscalarSubQuery(function, subQuery, operand); + } + }); + } + + protected void xscalarSubQuery(String function, SubQuery<ReplyCB> subQuery, + String operand) { + assertObjectNotNull("subQuery<ReplyCB>", subQuery); + ReplyCB cb = new ReplyCB(); + cb.xsetupForScalarSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScalarSubQuery(cb.query()); // for + // saving + // query + // -value. + registerScalarSubQuery(function, cb.query(), subQueryPropertyName, + operand); + } + + public abstract String keepScalarSubQuery(ReplyCQ subQuery); + // Very Internal (for Suppressing Warn about 'Not Use Import') protected String getConditionBeanClassNameInternally() { return ReplyCB.class.getName(); Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -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.board.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.board.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.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", - "Name", "name", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), - "DESCRIPTION", "Description", "description", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.board.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.board.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.board.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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.board.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.board.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) @@ -1174,7 +1109,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) @@ -1200,7 +1135,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. @@ -1210,7 +1145,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -1219,7 +1154,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -1228,7 +1163,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -1237,7 +1172,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -1246,7 +1181,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -1255,7 +1190,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -1264,20 +1199,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.board.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. * @@ -1288,27 +1209,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -1324,7 +1259,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. */ @@ -1333,7 +1268,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -1342,7 +1277,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -1351,7 +1286,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -1360,7 +1295,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -1369,7 +1304,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -1379,7 +1314,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) @@ -1396,7 +1331,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) @@ -1422,7 +1357,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. @@ -1432,7 +1367,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -1441,7 +1376,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -1450,7 +1385,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -1459,7 +1394,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -1468,7 +1403,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -1477,7 +1412,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -1486,20 +1421,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.board.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. * @@ -1510,27 +1431,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -1546,7 +1481,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -1555,7 +1490,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -1564,7 +1499,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -1573,7 +1508,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -1582,7 +1517,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -1591,7 +1526,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -1601,7 +1536,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) @@ -1618,7 +1553,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) @@ -1632,14 +1567,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); @@ -1658,7 +1593,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. */ @@ -1667,7 +1602,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -1676,7 +1611,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -1685,7 +1620,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -1694,7 +1629,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -1703,7 +1638,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -1712,7 +1647,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -1721,20 +1656,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.board.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. * @@ -1745,38 +1666,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1795,7 +1730,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. */ @@ -1804,7 +1739,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -1813,7 +1748,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -1822,7 +1757,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -1831,7 +1766,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -1840,7 +1775,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -1880,6 +1815,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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -11,16 +11,13 @@ import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.UserInfoCB; -import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; -import jp.sf.pal.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -13,9 +13,7 @@ import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.UserInfoCB; -import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; -import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.db.cbean.cq.UserInfoCQ; @@ -24,7 +22,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { //========================================================================== @@ -54,7 +51,7 @@ // ===== /** - * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. {PK : NotNull : * VARCHAR(255)} * * @param userId The value of userId as equal. @@ -64,7 +61,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as notEqual. */ @@ -73,7 +70,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterThan. */ @@ -82,7 +79,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessThan. */ @@ -91,7 +88,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as greaterEqual. */ @@ -100,7 +97,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as lessEqual. */ @@ -109,7 +106,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param userId The value of userId as prefixSearch. */ @@ -118,20 +115,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.board.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. * @@ -142,43 +125,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.board.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.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(userId), getCValueUserId(), "USER_ID", "UserId", + "userId", likeSearchOption); } public void inScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -187,42 +168,26 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_GroupMappingList( + public abstract String keepUserId_InScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); - /** - * @param roleMappingCBquery Query. - * @deprecated Please use inScopeRoleMappingList(subQuery) method. - */ - public void setUserId_InScopeSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerInScopeSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - public void inScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); RoleMappingCB cb = new RoleMappingCB(); cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_InScopeSubQuery_RoleMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + public abstract String keepUserId_InScopeSubQuery_RoleMappingList( RoleMappingCQ subQuery); public void notInScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { @@ -231,12 +196,12 @@ cb.xsetupForInScopeSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + public abstract String keepUserId_NotInScopeSubQuery_GroupMappingList( GroupMappingCQ subQuery); public void notInScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { @@ -245,31 +210,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 ...)} * @@ -282,31 +231,15 @@ cb.xsetupForExistsSubQuery(); subQuery.query(cb); String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb - .query());// for saving query-value. + .query()); // for saving query-value. registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", subQueryPropertyName); } - abstract public String keepUserId_ExistsSubQuery_GroupMappingList( + public abstract String keepUserId_ExistsSubQuery_GroupMappingList( GroupMappingCQ subQuery); /** - * @param roleMappingCBquery Query. - * @deprecated Please use existsRoleMappingList(subQuery) method. - */ - public void setUserId_ExistsSubQuery_RoleMappingList( - RoleMappingCQ roleMappingCBquery) { - String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(roleMappingCBquery);// for - // saving - // query - // - - // value - // . - registerExistsSubQuery(roleMappingCBquery, "USER_ID", "USER_ID", - subQueryPropertyName); - } - - /** * Set up 'exists' sub-query. {exists (select USER_ID from ROLE_MAPPING * where ...)} * @@ -319,12 +252,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); /** @@ -341,12 +274,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); /** @@ -362,53 +295,53 @@ 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 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); @@ -427,7 +360,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. */ @@ -436,7 +369,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as notEqual. */ @@ -445,7 +378,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterThan. */ @@ -454,7 +387,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessThan. */ @@ -463,7 +396,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as greaterEqual. */ @@ -472,7 +405,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as lessEqual. */ @@ -481,7 +414,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenName The value of givenName as prefixSearch. */ @@ -490,20 +423,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.board.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. * @@ -514,38 +433,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), - "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -564,7 +497,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. */ @@ -573,7 +506,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as notEqual. */ @@ -582,7 +515,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterThan. */ @@ -591,7 +524,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessThan. */ @@ -600,7 +533,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as greaterEqual. */ @@ -609,7 +542,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as lessEqual. */ @@ -618,7 +551,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyName The value of familyName as prefixSearch. */ @@ -627,20 +560,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.board.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. * @@ -651,38 +570,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), - "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -701,7 +634,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. */ @@ -710,7 +643,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as notEqual. */ @@ -719,7 +652,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterThan. */ @@ -728,7 +661,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessThan. */ @@ -737,7 +670,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as greaterEqual. */ @@ -746,7 +679,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as lessEqual. */ @@ -755,7 +688,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param middleName The value of middleName as prefixSearch. */ @@ -764,20 +697,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.board.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. * @@ -788,38 +707,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), - "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -838,7 +771,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. */ @@ -847,7 +780,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as notEqual. */ @@ -856,7 +789,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterThan. */ @@ -865,7 +798,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessThan. */ @@ -874,7 +807,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as greaterEqual. */ @@ -883,7 +816,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as lessEqual. */ @@ -892,7 +825,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param givenNameDesc The value of givenNameDesc as prefixSearch. */ @@ -901,21 +834,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.board.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. * @@ -926,39 +844,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(givenNameDesc), - getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", - "givenNameDesc", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -977,7 +910,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. */ @@ -986,7 +919,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as notEqual. */ @@ -995,7 +928,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterThan. */ @@ -1004,7 +937,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessThan. */ @@ -1013,7 +946,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as greaterEqual. */ @@ -1022,7 +955,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as lessEqual. */ @@ -1031,7 +964,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param familyNameDesc The value of familyNameDesc as prefixSearch. */ @@ -1040,21 +973,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.board.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. * @@ -1065,40 +983,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(familyNameDesc), - getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", - "FamilyNameDesc", "familyNameDesc", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1117,7 +1050,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. */ @@ -1126,7 +1059,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as notEqual. */ @@ -1135,7 +1068,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterThan. */ @@ -1144,7 +1077,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessThan. */ @@ -1153,7 +1086,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as greaterEqual. */ @@ -1162,7 +1095,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as lessEqual. */ @@ -1171,7 +1104,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param nickname The value of nickname as prefixSearch. */ @@ -1180,20 +1113,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1204,38 +1123,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), - "NICKNAME", "Nickname", "nickname", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1254,7 +1187,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. */ @@ -1263,7 +1196,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as notEqual. */ @@ -1272,7 +1205,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterThan. */ @@ -1281,7 +1214,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessThan. */ @@ -1290,7 +1223,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as greaterEqual. */ @@ -1299,7 +1232,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as lessEqual. */ @@ -1308,7 +1241,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param gender The value of gender as prefixSearch. */ @@ -1317,20 +1250,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), - "GENDER", "Gender", "gender", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1341,38 +1260,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", - "Gender", "gender", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1391,7 +1324,7 @@ abstract protected ConditionValue getCValueGender(); /** - * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {DATE} * * @param birthDate The value of birthDate as equal. */ @@ -1400,7 +1333,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as notEqual. */ @@ -1409,7 +1342,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterThan. */ @@ -1418,7 +1351,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessThan. */ @@ -1427,7 +1360,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as greaterEqual. */ @@ -1436,7 +1369,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param birthDate The value of birthDate as lessEqual. */ @@ -1446,7 +1379,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) @@ -1461,7 +1394,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) @@ -1475,14 +1408,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); @@ -1501,7 +1434,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. */ @@ -1510,7 +1443,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as notEqual. */ @@ -1519,7 +1452,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterThan. */ @@ -1528,7 +1461,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessThan. */ @@ -1537,7 +1470,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as greaterEqual. */ @@ -1546,7 +1479,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as lessEqual. */ @@ -1555,7 +1488,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param email The value of email as prefixSearch. */ @@ -1564,20 +1497,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1588,38 +1507,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", - "Email", "email", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1637,7 +1570,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. */ @@ -1646,7 +1579,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as notEqual. */ @@ -1655,7 +1588,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterThan. */ @@ -1664,7 +1597,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessThan. */ @@ -1673,7 +1606,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as greaterEqual. */ @@ -1682,7 +1615,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as lessEqual. */ @@ -1691,7 +1624,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param url The value of url as prefixSearch. */ @@ -1700,20 +1633,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", - "url", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1724,38 +1643,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", - "url", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1772,7 +1705,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. */ @@ -1781,7 +1714,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as notEqual. */ @@ -1790,7 +1723,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterThan. */ @@ -1799,7 +1732,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessThan. */ @@ -1808,7 +1741,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as greaterEqual. */ @@ -1817,7 +1750,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as lessEqual. */ @@ -1826,7 +1759,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param telephone The value of telephone as prefixSearch. */ @@ -1835,20 +1768,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1859,38 +1778,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), - "TELEPHONE", "Telephone", "telephone", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -1909,7 +1842,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. */ @@ -1918,7 +1851,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as notEqual. */ @@ -1927,7 +1860,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterThan. */ @@ -1936,7 +1869,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessThan. */ @@ -1945,7 +1878,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as greaterEqual. */ @@ -1954,7 +1887,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as lessEqual. */ @@ -1963,7 +1896,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param locale The value of locale as prefixSearch. */ @@ -1972,20 +1905,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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { - registerLikeSearchQuery(CK_LS, fRES(locale), getCValueLocale(), - "LOCALE", "Locale", "locale", likeSearchOption); - } - - /** * InScope(in ('a', 'b')). And NullOrEmptyIgnored, * NullOrEmptyElementIgnored, SeveralRegistered. * @@ -1996,38 +1915,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(locale), getCValueLocale(), "LOCALE", - "Locale", "locale", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -2046,8 +1979,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. */ @@ -2056,7 +1989,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as notEqual. */ @@ -2065,7 +1998,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterThan. */ @@ -2074,7 +2007,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessThan. */ @@ -2083,7 +2016,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as greaterEqual. */ @@ -2092,7 +2025,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as lessEqual. */ @@ -2101,7 +2034,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param roleId The value of roleId as prefixSearch. */ @@ -2110,20 +2043,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.board.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. * @@ -2134,42 +2053,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.board.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.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(roleId), getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId", likeSearchOption); } public void inScopeRoleInfo(SubQuery<RoleInfoCB> subQuery) { @@ -2178,23 +2096,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.board.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); @@ -2213,8 +2131,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. */ @@ -2223,7 +2141,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as notEqual. */ @@ -2232,7 +2150,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterThan. */ @@ -2241,7 +2159,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessThan. */ @@ -2250,7 +2168,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as greaterEqual. */ @@ -2259,7 +2177,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as lessEqual. */ @@ -2268,7 +2186,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param groupId The value of groupId as prefixSearch. */ @@ -2277,20 +2195,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.board.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. * @@ -2301,43 +2205,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.board.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.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(groupId), getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId", likeSearchOption); } public void inScopeGroupInfo(SubQuery<GroupInfoCB> subQuery) { @@ -2346,23 +2248,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.board.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); @@ -2381,8 +2283,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.board.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.board.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) { @@ -2390,7 +2429,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as notEqual. */ @@ -2399,7 +2438,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterThan. */ @@ -2408,7 +2447,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessThan. */ @@ -2417,7 +2456,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as greaterEqual. */ @@ -2426,7 +2465,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param createdTime The value of createdTime as lessEqual. */ @@ -2436,7 +2475,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) @@ -2453,7 +2492,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) @@ -2479,7 +2518,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. @@ -2489,7 +2528,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as notEqual. */ @@ -2498,7 +2537,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterThan. */ @@ -2507,7 +2546,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessThan. */ @@ -2516,7 +2555,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as greaterEqual. */ @@ -2525,7 +2564,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as lessEqual. */ @@ -2534,7 +2573,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param createdBy The value of createdBy as prefixSearch. */ @@ -2543,20 +2582,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.board.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. * @@ -2567,27 +2592,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), - "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(createdBy), getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy", likeSearchOption); } protected void regCreatedBy(ConditionKey key, Object value) { @@ -2603,7 +2642,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. */ @@ -2612,7 +2651,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as notEqual. */ @@ -2621,7 +2660,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterThan. */ @@ -2630,7 +2669,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessThan. */ @@ -2639,7 +2678,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as greaterEqual. */ @@ -2648,7 +2687,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param updatedTime The value of updatedTime as lessEqual. */ @@ -2658,7 +2697,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) @@ -2675,7 +2714,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) @@ -2701,7 +2740,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. @@ -2711,7 +2750,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as notEqual. */ @@ -2720,7 +2759,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterThan. */ @@ -2729,7 +2768,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessThan. */ @@ -2738,7 +2777,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as greaterEqual. */ @@ -2747,7 +2786,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as lessEqual. */ @@ -2756,7 +2795,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param updatedBy The value of updatedBy as prefixSearch. */ @@ -2765,20 +2804,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.board.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. * @@ -2789,27 +2814,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), - "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + jp.sf.pal.board.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.board.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + regLSQ(CK_NLS, fRES(updatedBy), getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy", likeSearchOption); } protected void regUpdatedBy(ConditionKey key, Object value) { @@ -2825,7 +2864,7 @@ abstract protected ConditionValue getCValueUpdatedBy(); /** - * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * Equal(=). And NullIgnored, OnlyOnceRegistered. {TIMESTAMP} * * @param deletedTime The value of deletedTime as equal. */ @@ -2834,7 +2873,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as notEqual. */ @@ -2843,7 +2882,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterThan. */ @@ -2852,7 +2891,7 @@ } /** - * LessThan(>). And NullIgnored, OnceRegistered. + * LessThan(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessThan. */ @@ -2861,7 +2900,7 @@ } /** - * GreaterEqual(>). And NullIgnored, OnceRegistered. + * GreaterEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as greaterEqual. */ @@ -2870,7 +2909,7 @@ } /** - * LessEqual(>). And NullIgnored, OnceRegistered. + * LessEqual(>). And NullIgnored, OnlyOnceRegistered. * * @param deletedTime The value of deletedTime as lessEqual. */ @@ -2880,7 +2919,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) @@ -2897,7 +2936,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) @@ -2911,14 +2950,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); @@ -2937,7 +2976,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. */ @@ -2946,7 +2985,7 @@ } /** - * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * NotEqual(!=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as notEqual. */ @@ -2955,7 +2994,7 @@ } /** - * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * GreaterThan(>). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterThan. */ @@ -2964,7 +3003,7 @@ } /** - * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * LessThan(<). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessThan. */ @@ -2973,7 +3012,7 @@ } /** - * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * GreaterEqual(>=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as greaterEqual. */ @@ -2982,7 +3021,7 @@ } /** - * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * LessEqual(<=). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as lessEqual. */ @@ -2991,7 +3030,7 @@ } /** - * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnlyOnceRegistered. * * @param deletedBy The value of deletedBy as prefixSearch. */ @@ -3000,20 +3039,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.board.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. * @@ -3024,38 +3049,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.board.db.allcommon.cbean.coption.InScopeOption inScopeOption) { - registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), - "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + jp.sf.pal.board.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.board.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); @@ -3074,7 +3113,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. */ @@ -3083,7 +3122,7 @@ } /** - * NotEqual(!=). And NullIgnored, OnceRegistered. + * NotEqual(!=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as notEqual. */ @@ -3092,7 +3131,7 @@ } /** - * GreaterThan(>). And NullIgnored, OnceRegistered. + * GreaterThan(>). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterThan. */ @@ -3101,7 +3140,7 @@ } /** - * LessThan(<). And NullIgnored, OnceRegistered. + * LessThan(<). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessThan. */ @@ -3110,7 +3149,7 @@ } /** - * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * GreaterEqual(>=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as greaterEqual. */ @@ -3119,7 +3158,7 @@ } /** - * LessEqual(<=). And NullIgnored, OnceRegistered. + * LessEqual(<=). And NullIgnored, OnlyOnceRegistered. * * @param versionno The value of versionno as lessEqual. */ @@ -3159,6 +3198,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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.AttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.ciq.AttachmentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsAttachmentCQ extends AbstractBsAttachmentCQ { //========================================================================== @@ -60,7 +60,7 @@ public AttachmentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } AttachmentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -153,21 +153,21 @@ return "id_NotExistsSubQuery_MessageAttachmentList." + key; } - protected Map<String, MessageAttachmentCQ> _id_DeriveSubQuery_MessageAttachmentListMap; + protected Map<String, MessageAttachmentCQ> _id_DerivedReferrer_MessageAttachmentListMap; - public Map<String, MessageAttachmentCQ> getId_DeriveSubQuery_MessageAttachmentList() { - return _id_DeriveSubQuery_MessageAttachmentListMap; + public Map<String, MessageAttachmentCQ> getId_DerivedReferrer_MessageAttachmentList() { + return _id_DerivedReferrer_MessageAttachmentListMap; } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { - if (_id_DeriveSubQuery_MessageAttachmentListMap == null) { - _id_DeriveSubQuery_MessageAttachmentListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MessageAttachmentListMap == null) { + _id_DerivedReferrer_MessageAttachmentListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MessageAttachmentListMap.size() + 1); - _id_DeriveSubQuery_MessageAttachmentListMap.put(key, subQuery); - return "id_DeriveSubQuery_MessageAttachmentList." + key; + + (_id_DerivedReferrer_MessageAttachmentListMap.size() + 1); + _id_DerivedReferrer_MessageAttachmentListMap.put(key, subQuery); + return "id_DerivedReferrer_MessageAttachmentList." + key; } public BsAttachmentCQ addOrderBy_Id_Asc() { @@ -344,7 +344,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, AttachmentCQ> _scalarSubQueryMap; + public Map<String, AttachmentCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(AttachmentCQ 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 AttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return AttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryAccessCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryAccessCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.ciq.CategoryAccessCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsCategoryAccessCQ extends AbstractBsCategoryAccessCQ { //========================================================================== @@ -60,7 +60,7 @@ public CategoryAccessCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } CategoryAccessCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -327,7 +327,6 @@ // ========= // Foreign Query // ============= - public CategoryCQ queryCategory() { return getConditionQueryCategory(); } @@ -336,20 +335,13 @@ public CategoryCQ getConditionQueryCategory() { if (_conditionQueryCategory == null) { - _conditionQueryCategory = createQueryCategory(); - setupOuterJoin_Category(); + _conditionQueryCategory = xcreateQueryCategory(); + xsetupOuterJoinCategory(); } return _conditionQueryCategory; } - protected void setupOuterJoin_Category() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryCategory(), joinOnMap); - } - - protected CategoryCQ createQueryCategory() { + protected CategoryCQ xcreateQueryCategory() { String nrp = resolveNextRelationPath("CATEGORY_ACCESS", "category"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); CategoryCQ cq = new CategoryCQ(this, getSqlClause(), jan, @@ -359,10 +351,42 @@ return cq; } + protected void xsetupOuterJoinCategory() { + CategoryCQ cq = getConditionQueryCategory(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryCategory() { return _conditionQueryCategory != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, CategoryAccessCQ> _scalarSubQueryMap; + + public Map<String, CategoryAccessCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(CategoryAccessCQ 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 CategoryAccessCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryAccessCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsCategoryCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsCategoryCQ extends AbstractBsCategoryCQ { //========================================================================== @@ -61,7 +61,7 @@ public CategoryCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } CategoryCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -218,37 +218,37 @@ return "id_NotExistsSubQuery_MessageList." + key; } - protected Map<String, CategoryAccessCQ> _id_DeriveSubQuery_CategoryAccessListMap; + protected Map<String, CategoryAccessCQ> _id_DerivedReferrer_CategoryAccessListMap; - public Map<String, CategoryAccessCQ> getId_DeriveSubQuery_CategoryAccessList() { - return _id_DeriveSubQuery_CategoryAccessListMap; + public Map<String, CategoryAccessCQ> getId_DerivedReferrer_CategoryAccessList() { + return _id_DerivedReferrer_CategoryAccessListMap; } - public String keepId_DeriveSubQuery_CategoryAccessList( + public String keepId_DerivedReferrer_CategoryAccessList( CategoryAccessCQ subQuery) { - if (_id_DeriveSubQuery_CategoryAccessListMap == null) { - _id_DeriveSubQuery_CategoryAccessListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_CategoryAccessListMap == null) { + _id_DerivedReferrer_CategoryAccessListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_CategoryAccessListMap.size() + 1); - _id_DeriveSubQuery_CategoryAccessListMap.put(key, subQuery); - return "id_DeriveSubQuery_CategoryAccessList." + key; + + (_id_DerivedReferrer_CategoryAccessListMap.size() + 1); + _id_DerivedReferrer_CategoryAccessListMap.put(key, subQuery); + return "id_DerivedReferrer_CategoryAccessList." + key; } - protected Map<String, MessageCQ> _id_DeriveSubQuery_MessageListMap; + protected Map<String, MessageCQ> _id_DerivedReferrer_MessageListMap; - public Map<String, MessageCQ> getId_DeriveSubQuery_MessageList() { - return _id_DeriveSubQuery_MessageListMap; + public Map<String, MessageCQ> getId_DerivedReferrer_MessageList() { + return _id_DerivedReferrer_MessageListMap; } - public String keepId_DeriveSubQuery_MessageList(MessageCQ subQuery) { - if (_id_DeriveSubQuery_MessageListMap == null) { - _id_DeriveSubQuery_MessageListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_MessageList(MessageCQ subQuery) { + if (_id_DerivedReferrer_MessageListMap == null) { + _id_DerivedReferrer_MessageListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MessageListMap.size() + 1); - _id_DeriveSubQuery_MessageListMap.put(key, subQuery); - return "id_DeriveSubQuery_MessageList." + key; + + (_id_DerivedReferrer_MessageListMap.size() + 1); + _id_DerivedReferrer_MessageListMap.put(key, subQuery); + return "id_DerivedReferrer_MessageList." + key; } public BsCategoryCQ addOrderBy_Id_Asc() { @@ -494,7 +494,30 @@ // ========= // Foreign Query // ============= + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, CategoryCQ> _scalarSubQueryMap; + public Map<String, CategoryCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(CategoryCQ 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 CategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupMappingCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageAttachmentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageAttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMessageAttachmentCQ extends AbstractBsMessageAttachmentCQ { //========================================================================== @@ -61,7 +61,7 @@ public MessageAttachmentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MessageAttachmentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -419,7 +419,6 @@ // ========= // Foreign Query // ============= - public AttachmentCQ queryAttachment() { return getConditionQueryAttachment(); } @@ -428,20 +427,13 @@ public AttachmentCQ getConditionQueryAttachment() { if (_conditionQueryAttachment == null) { - _conditionQueryAttachment = createQueryAttachment(); - setupOuterJoin_Attachment(); + _conditionQueryAttachment = xcreateQueryAttachment(); + xsetupOuterJoinAttachment(); } return _conditionQueryAttachment; } - protected void setupOuterJoin_Attachment() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ATTACHMENT_ID"), - getConditionQueryAttachment().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryAttachment(), joinOnMap); - } - - protected AttachmentCQ createQueryAttachment() { + protected AttachmentCQ xcreateQueryAttachment() { String nrp = resolveNextRelationPath("MESSAGE_ATTACHMENT", "attachment"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); AttachmentCQ cq = new AttachmentCQ(this, getSqlClause(), jan, @@ -451,6 +443,14 @@ return cq; } + protected void xsetupOuterJoinAttachment() { + AttachmentCQ cq = getConditionQueryAttachment(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ATTACHMENT_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryAttachment() { return _conditionQueryAttachment != null; } @@ -463,20 +463,13 @@ public MessageCQ getConditionQueryMessage() { if (_conditionQueryMessage == null) { - _conditionQueryMessage = createQueryMessage(); - setupOuterJoin_Message(); + _conditionQueryMessage = xcreateQueryMessage(); + xsetupOuterJoinMessage(); } return _conditionQueryMessage; } - protected void setupOuterJoin_Message() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MESSAGE_ID"), - getConditionQueryMessage().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMessage(), joinOnMap); - } - - protected MessageCQ createQueryMessage() { + protected MessageCQ xcreateQueryMessage() { String nrp = resolveNextRelationPath("MESSAGE_ATTACHMENT", "message"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageCQ cq = new MessageCQ(this, getSqlClause(), jan, @@ -486,10 +479,42 @@ return cq; } + protected void xsetupOuterJoinMessage() { + MessageCQ cq = getConditionQueryMessage(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MESSAGE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessage() { return _conditionQueryMessage != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, MessageAttachmentCQ> _scalarSubQueryMap; + + public Map<String, MessageAttachmentCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MessageAttachmentCQ 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 MessageAttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageAttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageCB; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMessageCQ extends AbstractBsMessageCQ { //========================================================================== @@ -63,7 +63,7 @@ public MessageCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MessageCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -288,37 +288,37 @@ return "id_NotExistsSubQuery_ReplyList." + key; } - protected Map<String, MessageAttachmentCQ> _id_DeriveSubQuery_MessageAttachmentListMap; + protected Map<String, MessageAttachmentCQ> _id_DerivedReferrer_MessageAttachmentListMap; - public Map<String, MessageAttachmentCQ> getId_DeriveSubQuery_MessageAttachmentList() { - return _id_DeriveSubQuery_MessageAttachmentListMap; + public Map<String, MessageAttachmentCQ> getId_DerivedReferrer_MessageAttachmentList() { + return _id_DerivedReferrer_MessageAttachmentListMap; } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { - if (_id_DeriveSubQuery_MessageAttachmentListMap == null) { - _id_DeriveSubQuery_MessageAttachmentListMap = newLinkedHashMap(); + if (_id_DerivedReferrer_MessageAttachmentListMap == null) { + _id_DerivedReferrer_MessageAttachmentListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_MessageAttachmentListMap.size() + 1); - _id_DeriveSubQuery_MessageAttachmentListMap.put(key, subQuery); - return "id_DeriveSubQuery_MessageAttachmentList." + key; + + (_id_DerivedReferrer_MessageAttachmentListMap.size() + 1); + _id_DerivedReferrer_MessageAttachmentListMap.put(key, subQuery); + return "id_DerivedReferrer_MessageAttachmentList." + key; } - protected Map<String, ReplyCQ> _id_DeriveSubQuery_ReplyListMap; + protected Map<String, ReplyCQ> _id_DerivedReferrer_ReplyListMap; - public Map<String, ReplyCQ> getId_DeriveSubQuery_ReplyList() { - return _id_DeriveSubQuery_ReplyListMap; + public Map<String, ReplyCQ> getId_DerivedReferrer_ReplyList() { + return _id_DerivedReferrer_ReplyListMap; } - public String keepId_DeriveSubQuery_ReplyList(ReplyCQ subQuery) { - if (_id_DeriveSubQuery_ReplyListMap == null) { - _id_DeriveSubQuery_ReplyListMap = newLinkedHashMap(); + public String keepId_DerivedReferrer_ReplyList(ReplyCQ subQuery) { + if (_id_DerivedReferrer_ReplyListMap == null) { + _id_DerivedReferrer_ReplyListMap = newLinkedHashMap(); } String key = "subQueryMapKey" - + (_id_DeriveSubQuery_ReplyListMap.size() + 1); - _id_DeriveSubQuery_ReplyListMap.put(key, subQuery); - return "id_DeriveSubQuery_ReplyList." + key; + + (_id_DerivedReferrer_ReplyListMap.size() + 1); + _id_DerivedReferrer_ReplyListMap.put(key, subQuery); + return "id_DerivedReferrer_ReplyList." + key; } public BsMessageCQ addOrderBy_Id_Asc() { @@ -706,7 +706,6 @@ // ========= // Foreign Query // ============= - public CategoryCQ queryCategory() { return getConditionQueryCategory(); } @@ -715,20 +714,13 @@ public CategoryCQ getConditionQueryCategory() { if (_conditionQueryCategory == null) { - _conditionQueryCategory = createQueryCategory(); - setupOuterJoin_Category(); + _conditionQueryCategory = xcreateQueryCategory(); + xsetupOuterJoinCategory(); } return _conditionQueryCategory; } - protected void setupOuterJoin_Category() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("CATEGORY_ID"), - getConditionQueryCategory().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryCategory(), joinOnMap); - } - - protected CategoryCQ createQueryCategory() { + protected CategoryCQ xcreateQueryCategory() { String nrp = resolveNextRelationPath("MESSAGE", "category"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); CategoryCQ cq = new CategoryCQ(this, getSqlClause(), jan, @@ -738,6 +730,14 @@ return cq; } + protected void xsetupOuterJoinCategory() { + CategoryCQ cq = getConditionQueryCategory(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("CATEGORY_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryCategory() { return _conditionQueryCategory != null; } @@ -750,21 +750,13 @@ public MessageContentCQ getConditionQueryMessageContentAsOne() { if (_conditionQueryMessageContentAsOne == null) { - _conditionQueryMessageContentAsOne = createQueryMessageContentAsOne(); - setupOuterJoin_MessageContentAsOne(); + _conditionQueryMessageContentAsOne = xcreateQueryMessageContentAsOne(); + xsetupOuterJoinMessageContentAsOne(); } return _conditionQueryMessageContentAsOne; } - protected void setupOuterJoin_MessageContentAsOne() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("ID"), - getConditionQueryMessageContentAsOne().getRealColumnName( - "MESSAGE_ID")); - registerOuterJoin(getConditionQueryMessageContentAsOne(), joinOnMap); - } - - protected MessageContentCQ createQueryMessageContentAsOne() { + protected MessageContentCQ xcreateQueryMessageContentAsOne() { String nrp = resolveNextRelationPath("MESSAGE", "messageContentAsOne"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageContentCQ cq = new MessageContentCQ(this, getSqlClause(), jan, @@ -774,10 +766,42 @@ return cq; } + protected void xsetupOuterJoinMessageContentAsOne() { + MessageContentCQ cq = getConditionQueryMessageContentAsOne(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), cq + .getRealColumnName("MESSAGE_ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessageContentAsOne() { return _conditionQueryMessageContentAsOne != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, MessageCQ> _scalarSubQueryMap; + + public Map<String, MessageCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MessageCQ 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 MessageCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsMessageContentCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageContentCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.MessageContentCQ; import jp.sf.pal.board.db.cbean.cq.ciq.MessageContentCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsMessageContentCQ extends AbstractBsMessageContentCQ { //========================================================================== @@ -60,7 +60,7 @@ public MessageContentCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } MessageContentCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -166,7 +166,6 @@ // ========= // Foreign Query // ============= - public MessageCQ queryMessage() { return getConditionQueryMessage(); } @@ -175,20 +174,13 @@ public MessageCQ getConditionQueryMessage() { if (_conditionQueryMessage == null) { - _conditionQueryMessage = createQueryMessage(); - setupOuterJoin_Message(); + _conditionQueryMessage = xcreateQueryMessage(); + xsetupOuterJoinMessage(); } return _conditionQueryMessage; } - protected void setupOuterJoin_Message() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MESSAGE_ID"), - getConditionQueryMessage().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMessage(), joinOnMap); - } - - protected MessageCQ createQueryMessage() { + protected MessageCQ xcreateQueryMessage() { String nrp = resolveNextRelationPath("MESSAGE_CONTENT", "message"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageCQ cq = new MessageCQ(this, getSqlClause(), jan, @@ -198,10 +190,42 @@ return cq; } + protected void xsetupOuterJoinMessage() { + MessageCQ cq = getConditionQueryMessage(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MESSAGE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessage() { return _conditionQueryMessage != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, MessageContentCQ> _scalarSubQueryMap; + + public Map<String, MessageContentCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(MessageContentCQ 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 MessageContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageContentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsReplyCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.ReplyCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.ReplyCQ; import jp.sf.pal.board.db.cbean.cq.ciq.ReplyCIQ; @@ -14,7 +15,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsReplyCQ extends AbstractBsReplyCQ { //========================================================================== @@ -60,7 +60,7 @@ public ReplyCIQ on() { if (isBaseQuery(this)) { throw new UnsupportedOperationException( - "Unsupported onClause of Base Table!"); + "Unsupported on-clause for local table!"); } ReplyCIQ inlineQuery = inline(); inlineQuery.xsetOnClauseInline(true); @@ -304,7 +304,6 @@ // ========= // Foreign Query // ============= - public MessageCQ queryMessage() { return getConditionQueryMessage(); } @@ -313,20 +312,13 @@ public MessageCQ getConditionQueryMessage() { if (_conditionQueryMessage == null) { - _conditionQueryMessage = createQueryMessage(); - setupOuterJoin_Message(); + _conditionQueryMessage = xcreateQueryMessage(); + xsetupOuterJoinMessage(); } return _conditionQueryMessage; } - protected void setupOuterJoin_Message() { - Map<String, String> joinOnMap = newLinkedHashMap(); - joinOnMap.put(getRealColumnName("MESSAGE_ID"), - getConditionQueryMessage().getRealColumnName("ID")); - registerOuterJoin(getConditionQueryMessage(), joinOnMap); - } - - protected MessageCQ createQueryMessage() { + protected MessageCQ xcreateQueryMessage() { String nrp = resolveNextRelationPath("REPLY", "message"); String jan = resolveJoinAliasName(nrp, getNextNestLevel()); MessageCQ cq = new MessageCQ(this, getSqlClause(), jan, @@ -336,10 +328,42 @@ return cq; } + protected void xsetupOuterJoinMessage() { + MessageCQ cq = getConditionQueryMessage(); + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("MESSAGE_ID"), cq + .getRealColumnName("ID")); + registerOuterJoin(cq, joinOnMap); + } + public boolean hasConditionQueryMessage() { return _conditionQueryMessage != null; } + //========================================================================== + // ========= + // Derived Query + // ============= + protected Map<String, ReplyCQ> _scalarSubQueryMap; + + public Map<String, ReplyCQ> getScalarSubQuery() { + return _scalarSubQueryMap; + } + + public String keepScalarSubQuery(ReplyCQ 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 ReplyCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return ReplyCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/bs/BsUserInfoCQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.ConditionQuery; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; @@ -17,7 +18,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class BsUserInfoCQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -63,7 +63,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); @@ -224,38 +224,38 @@ 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, 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() { @@ -622,6 +622,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() { @@ -819,7 +842,6 @@ // ========= // Foreign Query // ============= - public GroupInfoCQ queryGroupInfo() { return getConditionQueryGroupInfo(); } @@ -828,20 +850,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, @@ -851,6 +866,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; } @@ -863,20 +886,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, @@ -886,10 +902,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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/AttachmentCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.AttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsAttachmentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class AttachmentCIQ extends AbstractBsAttachmentCQ { //========================================================================== @@ -117,10 +117,10 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueData() { @@ -147,6 +147,20 @@ return _myCQ.getCreatedBy(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(AttachmentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return AttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return AttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryAccessCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryAccessCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsCategoryAccessCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class CategoryAccessCIQ extends AbstractBsCategoryAccessCQ { //========================================================================== @@ -131,6 +131,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(CategoryAccessCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CategoryAccessCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryAccessCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/CategoryCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.CategoryCB; import jp.sf.pal.board.db.cbean.cq.CategoryAccessCQ; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class CategoryCIQ extends AbstractBsCategoryCQ { //========================================================================== @@ -136,15 +136,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_CategoryAccessList( + public String keepId_DerivedReferrer_CategoryAccessList( CategoryAccessCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MessageList(MessageCQ subQuery) { + public String keepId_DerivedReferrer_MessageList(MessageCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueName() { @@ -183,6 +183,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(CategoryCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return CategoryCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return CategoryCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.GroupMappingCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageAttachmentCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageAttachmentCB; import jp.sf.pal.board.db.cbean.cq.AttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -16,7 +17,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageAttachmentCIQ extends AbstractBsMessageAttachmentCQ { //========================================================================== @@ -149,6 +149,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MessageAttachmentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageAttachmentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageAttachmentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageCB; import jp.sf.pal.board.db.cbean.cq.CategoryCQ; import jp.sf.pal.board.db.cbean.cq.MessageAttachmentCQ; import jp.sf.pal.board.db.cbean.cq.MessageCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageCIQ extends AbstractBsMessageCQ { //========================================================================== @@ -160,15 +160,15 @@ "NotExistsSubQuery at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_MessageAttachmentList( + public String keepId_DerivedReferrer_MessageAttachmentList( MessageAttachmentCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } - public String keepId_DeriveSubQuery_ReplyList(ReplyCQ subQuery) { + public String keepId_DerivedReferrer_ReplyList(ReplyCQ subQuery) { throw new UnsupportedOperationException( - "DeriveSubQuery at inline() is unsupported! Sorry!"); + "DerivedReferrer at inline() is unsupported! Sorry!"); } protected ConditionValue getCValueDisplayName() { @@ -231,6 +231,20 @@ return _myCQ.getVersionno(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MessageCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/MessageContentCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.MessageContentCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.MessageContentCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsMessageContentCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageContentCIQ extends AbstractBsMessageContentCQ { //========================================================================== @@ -103,6 +103,20 @@ return _myCQ.getContent(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(MessageContentCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return MessageContentCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return MessageContentCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/ReplyCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.ReplyCB; import jp.sf.pal.board.db.cbean.cq.MessageCQ; import jp.sf.pal.board.db.cbean.cq.ReplyCQ; import jp.sf.pal.board.db.cbean.cq.bs.AbstractBsReplyCQ; @@ -15,7 +16,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class ReplyCIQ extends AbstractBsReplyCQ { //========================================================================== @@ -127,6 +127,20 @@ return _myCQ.getDeletedBy(); } + //========================================================================== + // ========= + // Derived Query + // ============= + public String keepScalarSubQuery(ReplyCQ subQuery) { + throw new UnsupportedOperationException( + "ScalarSubQuery at inline() is unsupported! Sorry!"); + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return ReplyCB.class.getName(); + } + protected String getConditionQueryClassNameInternally() { return ReplyCQ.class.getName(); } Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleInfoCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.RoleMappingCB; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; import jp.sf.pal.board.db.cbean.cq.RoleMappingCQ; import jp.sf.pal.board.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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/cq/ciq/UserInfoCIQ.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,6 +5,7 @@ import jp.sf.pal.board.db.allcommon.cbean.coption.ConditionOption; import jp.sf.pal.board.db.allcommon.cbean.cvalue.ConditionValue; import jp.sf.pal.board.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.board.db.cbean.UserInfoCB; import jp.sf.pal.board.db.cbean.cq.GroupInfoCQ; import jp.sf.pal.board.db.cbean.cq.GroupMappingCQ; import jp.sf.pal.board.db.cbean.cq.RoleInfoCQ; @@ -18,7 +19,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoCIQ extends AbstractBsUserInfoCQ { //========================================================================== @@ -142,16 +142,16 @@ "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_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() { @@ -218,6 +218,10 @@ return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); } + protected ConditionValue getCValueStatus() { + return _myCQ.getStatus(); + } + protected ConditionValue getCValueCreatedTime() { return _myCQ.getCreatedTime(); } @@ -246,6 +250,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: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/AttachmentNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class AttachmentNss { protected AttachmentCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryAccessNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class CategoryAccessNss { protected CategoryAccessCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/CategoryNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class CategoryNss { protected CategoryCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupInfoNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupInfoNss { protected GroupInfoCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/GroupMappingNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class GroupMappingNss { protected GroupMappingCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageAttachmentNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageAttachmentNss { protected MessageAttachmentCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageContentNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageContentNss { protected MessageContentCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/MessageNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class MessageNss { protected MessageCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/ReplyNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class ReplyNss { protected ReplyCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleInfoNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -7,7 +7,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleInfoNss { protected RoleInfoCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/RoleMappingNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class RoleMappingNss { protected RoleMappingCQ _query; Modified: board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java =================================================================== --- board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/java/jp/sf/pal/board/db/cbean/nss/UserInfoNss.java 2008-12-27 22:09:08 UTC (rev 1625) @@ -8,7 +8,6 @@ * * @author DBFlute(AutoGenerator) */ - @ SuppressWarnings("unchecked") public class UserInfoNss { protected UserInfoCQ _query; Modified: board/trunk/src/main/resources/dbflute.dicon =================================================================== --- board/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:06:42 UTC (rev 1624) +++ board/trunk/src/main/resources/dbflute.dicon 2008-12-27 22:09:08 UTC (rev 1625) @@ -5,113 +5,44 @@ <components namespace="dbflute"> <include path="j2ee.dicon"/> - <!-- S2Dao component. --> - <component class="jp.sf.pal.board.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.board.db.allcommon.bhv.core.BehaviorInitializer"/> + <component name="behaviorCommandInvoker" class="jp.sf.pal.board.db.allcommon.bhv.core.BehaviorCommandInvoker"/> + <component name="commonColumnAutoSetupper" class="jp.sf.pal.board.db.allcommon.CommonColumnBasicAutoSetupper"/> + <component name="behaviorSelector" class="jp.sf.pal.board.db.allcommon.CacheBehaviorSelector"> + <destroyMethod name="destroy"/> </component> - <component name="interceptor" class="jp.sf.pal.board.db.allcommon.s2dao.S2DaoInterceptor"/> + + <!-- The component of S2Dao. --> + <component class="jp.sf.pal.board.db.allcommon.s2dao.BeanMetaDataFactoryExtension"/> + <component class="jp.sf.pal.board.db.allcommon.s2dao.PropertyTypeFactoryBuilderExtension"/> + <component class="jp.sf.pal.board.db.allcommon.s2dao.SqlLogRegistryLatestSqlProvider"/> <component class="org.seasar.dao.impl.AnnotationReaderFactoryImpl"/> <component class="org.seasar.dao.impl.ValueTypeFactoryImpl"/> - <component class="jp.sf.pal.board.db.allcommon.s2dao.S2BeanMetaDataFactoryImpl"/> <component class="org.seasar.dao.impl.DaoNamingConventionImpl"/> <component class="org.seasar.dao.impl.NullBeanEnhancer"/> - <component class="jp.sf.pal.board.db.allcommon.s2dao.S2DaoMetaDataExtension$ResultSetHandlerFactoryExtension"/> <component class="org.seasar.dao.impl.DtoMetaDataFactoryImpl"/> - <component class="jp.sf.pal.board.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.board.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.board.db.allcommon.s2dao.internal.valuetype.InternalBytesOidType" /> - <!-- The selector of behavior. --> - <component name="behaviorSelector" class="jp.sf.pal.board.db.allcommon.CacheBehaviorSelector"> - <destroyMethod name="destroy"/> - </component> - <!-- The selector of DAO. --> - <component name="daoSelector" class="jp.sf.pal.board.db.allcommon.CacheDaoSelector"> - <destroyMethod name="destroy"/> - </component> - - <!-- The dao of outsideSql. --> - <component class="jp.sf.pal.board.db.allcommon.cbean.outsidesql.OutsideSqlDao"> - <aspect>dbflute.interceptor</aspect> - </component> - - - <!-- ATTACHMENT --> - <component name="attachmentDao" class="jp.sf.pal.board.db.exdao.AttachmentDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="attachmentBhv" class="jp.sf.pal.board.db.exbhv.AttachmentBhv"/> - - <!-- CATEGORY --> - <component name="categoryDao" class="jp.sf.pal.board.db.exdao.CategoryDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="categoryBhv" class="jp.sf.pal.board.db.exbhv.CategoryBhv"/> - - <!-- CATEGORY_ACCESS --> - <component name="categoryAccessDao" class="jp.sf.pal.board.db.exdao.CategoryAccessDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="categoryAccessBhv" class="jp.sf.pal.board.db.exbhv.CategoryAccessBhv"/> - - <!-- GROUP_INFO --> - <component name="groupInfoDao" class="jp.sf.pal.board.db.exdao.GroupInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="groupInfoBhv" class="jp.sf.pal.board.db.exbhv.GroupInfoBhv"/> - - <!-- GROUP_MAPPING --> - <component name="groupMappingDao" class="jp.sf.pal.board.db.exdao.GroupMappingDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="groupMappingBhv" class="jp.sf.pal.board.db.exbhv.GroupMappingBhv"/> - - <!-- MESSAGE --> - <component name="messageDao" class="jp.sf.pal.board.db.exdao.MessageDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="messageBhv" class="jp.sf.pal.board.db.exbhv.MessageBhv"/> - - <!-- MESSAGE_ATTACHMENT --> - <component name="messageAttachmentDao" class="jp.sf.pal.board.db.exdao.MessageAttachmentDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="messageAttachmentBhv" class="jp.sf.pal.board.db.exbhv.MessageAttachmentBhv"/> - - <!-- MESSAGE_CONTENT --> - <component name="messageContentDao" class="jp.sf.pal.board.db.exdao.MessageContentDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="messageContentBhv" class="jp.sf.pal.board.db.exbhv.MessageContentBhv"/> - - <!-- REPLY --> - <component name="replyDao" class="jp.sf.pal.board.db.exdao.ReplyDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="replyBhv" class="jp.sf.pal.board.db.exbhv.ReplyBhv"/> - - <!-- ROLE_INFO --> - <component name="roleInfoDao" class="jp.sf.pal.board.db.exdao.RoleInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="roleInfoBhv" class="jp.sf.pal.board.db.exbhv.RoleInfoBhv"/> - - <!-- ROLE_MAPPING --> - <component name="roleMappingDao" class="jp.sf.pal.board.db.exdao.RoleMappingDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="roleMappingBhv" class="jp.sf.pal.board.db.exbhv.RoleMappingBhv"/> - - <!-- USER_INFO --> - <component name="userInfoDao" class="jp.sf.pal.board.db.exdao.UserInfoDao"> - <aspect>dbflute.interceptor</aspect> - </component> <component name="userInfoBhv" class="jp.sf.pal.board.db.exbhv.UserInfoBhv"/> </components> Modified: board/trunk/src/main/webapp/WEB-INF/db/board.data.db =================================================================== (Binary files differ)