svnno****@sourc*****
svnno****@sourc*****
2008年 11月 14日 (金) 18:14:02 JST
Revision: 1350 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1350 Author: shinsuke Date: 2008-11-14 18:14:02 +0900 (Fri, 14 Nov 2008) Log Message: ----------- initial commit(admin tool only..) Added Paths: ----------- scheduler/trunk/.classpath scheduler/trunk/.project scheduler/trunk/.settings/ scheduler/trunk/.settings/org.eclipse.jdt.core.prefs scheduler/trunk/.settings/org.eclipse.jdt.ui.prefs scheduler/trunk/.settings/org.seasar.sastrutsplugin.prefs scheduler/trunk/dbflute/ scheduler/trunk/dbflute/_project.bat scheduler/trunk/dbflute/_project.sh scheduler/trunk/dbflute/build-scheduler.properties scheduler/trunk/dbflute/dfprop/ scheduler/trunk/dbflute/dfprop/databaseInfoMap.dfprop scheduler/trunk/dbflute/doc.bat scheduler/trunk/dbflute/doc.sh scheduler/trunk/dbflute/generate.bat scheduler/trunk/dbflute/generate.sh scheduler/trunk/dbflute/jdbc.bat scheduler/trunk/dbflute/jdbc.sh scheduler/trunk/dbflute/log/ scheduler/trunk/dbflute/log/readme.txt scheduler/trunk/dbflute/output/ scheduler/trunk/dbflute/output/doc/ scheduler/trunk/dbflute/output/doc/readme.txt scheduler/trunk/dbflute/outside-sql-test.bat scheduler/trunk/dbflute/outside-sql-test.sh scheduler/trunk/dbflute/playsql/ scheduler/trunk/dbflute/playsql/replace-schema.sql scheduler/trunk/dbflute/replace-schema.bat scheduler/trunk/dbflute/replace-schema.sh scheduler/trunk/dbflute/schema/ scheduler/trunk/dbflute/schema/readme.txt scheduler/trunk/dbflute/sql2entity.bat scheduler/trunk/dbflute/sql2entity.sh scheduler/trunk/pom.xml scheduler/trunk/src/ scheduler/trunk/src/main/ scheduler/trunk/src/main/config/ scheduler/trunk/src/main/config/erd/ scheduler/trunk/src/main/config/erd/scheduler.erd scheduler/trunk/src/main/config/sql/ scheduler/trunk/src/main/config/sql/scheduler.ddl scheduler/trunk/src/main/java/ scheduler/trunk/src/main/java/jp/ scheduler/trunk/src/main/java/jp/sf/ scheduler/trunk/src/main/java/jp/sf/pal/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/SchedulerConstants.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/ConfigAction.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/RoutineScheduleAction.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/SingleScheduleAction.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonConstants.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/creator/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/creator/PagerCreator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/dxo/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/dxo/PagerDxo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/form/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/form/PagingResultForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/pager/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/pager/DefaultPager.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/ConfigUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/DateUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/PagingResultBeanWrapper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/SAStrutsUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/AccessContext.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheAbstractSelector.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheBehaviorSelector.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheDaoSelector.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CallbackContext.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBFluteConfig.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoReadable.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoSelector.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoWritable.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/Entity.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/EntityDefinedCommonColumn.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/GenMetaData.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/InternalMapContext.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/QLog.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/XLog.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/OutsideSql.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorReadable.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorWritable.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorReadable.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorWritable.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputResult.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionFailure.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionResult.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/load/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/load/LoadReferrerOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ConditionBeanSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/EntityListSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelBox.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionQuery.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBeanContext.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionQuery.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBeanContext.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ListResultBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/MapParameterBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/OrderByBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingInvoker.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingResultBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ResultBeanBuilder.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SelectResource.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimpleOrderByBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimplePagingBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SubQuery.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/UnionQuery.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKey.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyEqual.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyInScope.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNull.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessThan.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/ConditionOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/DateFromToOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/FromToOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/InScopeOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/LikeSearchOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/SimpleStringOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/SplitOptionParts.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/local/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ConditionValue.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowResource.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/mapping/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/mapping/EntityDtoMapper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlContext.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/ProcedurePmb.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLink.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeBean.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/AbstractSqlClause.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByClause.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByElement.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClause.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDb2.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDefault.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDerby.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseH2.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseMySql.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseOracle.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/AbstractDBMeta.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMeta.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMetaInstanceHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ColumnInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ForeignInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ReferrerInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/RelationInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/UniqueInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BatchEntityAlreadyUpdatedException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableParameterNullValueException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/DangerousResultSizeException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueParameterNullValueException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EndCommentNotFoundException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyDeletedException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyExistsException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyUpdatedException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityDuplicatedException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentConditionNotFoundException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentNotBooleanResultException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentWrongExpressionException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/OutsideSqlNotFoundException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasOverlappedException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RequiredOptionNotFoundException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/SQLFailureException.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListString.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListStringImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilder.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilderImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/GeneralCharacter.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/JapaneseCharacter.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/GeneralCharacterImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrder.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/impl/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractingResource.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameResult.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/impl/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/impl/InvokeNameExtractorImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingCallback.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingHeaderInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingRowResource.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingSimpleFacade.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileToken.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingCallback.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingRowResource.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileTokenImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineMakingOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineToken.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineTokenizingOption.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/impl/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/impl/LineTokenImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/CursorHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/LatestSqlProvider.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/SqlLogHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/StatementConfig.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoInterceptor.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoLatestSqlProvider.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataExtension.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractBeanMetaDataResultSetHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/util/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/valuetype/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/valuetype/InternalBytesOidType.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaData.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureParameterType.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRelationRowCreator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRowCreator.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleAssertUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleStringUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleSystemUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/TraceViewUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/ValueLabelUtil.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleContentBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleContentBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsUserInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupInfoDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleInfoDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleContentDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleContentDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsUserInfoDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineSchedule.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleContent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleSchedule.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleContent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsUserInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupInfoDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupMappingDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleInfoDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleMappingDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleContentDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleMappingDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleContentDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleMappingDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/UserInfoDbm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleContentCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleContentCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/UserInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleContentCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleContentCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleMappingCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsUserInfoCB.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/UserInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsUserInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleContentCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleMappingCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsUserInfoCQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupInfoCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupMappingCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleInfoCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleMappingCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleContentCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleMappingCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleContentCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleMappingCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/UserInfoCIQ.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupInfoNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupMappingNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleInfoNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleMappingNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleContentNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleMappingNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleContentNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleMappingNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/UserInfoNss.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleContentBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleContentBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleMappingBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/UserInfoBhv.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupInfoDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleInfoDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleContentDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleContentDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleMappingDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/UserInfoDao.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineSchedule.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleContent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleSchedule.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleContent.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleMapping.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/UserInfo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/RoutineScheduleDxo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/SingleScheduleDxo.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/ConfigForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/RoutineScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/SingleScheduleForm.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/RoutineSchedulePager.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/SingleSchedulePager.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/RoutineScheduleService.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/SingleScheduleService.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/UserInfoService.java scheduler/trunk/src/main/java/jp/sf/pal/scheduler/util/ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/util/SchedulerUtil.java scheduler/trunk/src/main/resources/ scheduler/trunk/src/main/resources/app.dicon scheduler/trunk/src/main/resources/application.properties scheduler/trunk/src/main/resources/application_ja.properties scheduler/trunk/src/main/resources/convention.dicon scheduler/trunk/src/main/resources/creator.dicon scheduler/trunk/src/main/resources/customizer.dicon scheduler/trunk/src/main/resources/dbflute.dicon scheduler/trunk/src/main/resources/env.txt scheduler/trunk/src/main/resources/env_ut.txt scheduler/trunk/src/main/resources/jdbc.dicon scheduler/trunk/src/main/resources/s2container.dicon scheduler/trunk/src/main/webapp/ scheduler/trunk/src/main/webapp/WEB-INF/ scheduler/trunk/src/main/webapp/WEB-INF/db/ scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.1.log.db scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.data.db scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.index.db scheduler/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml scheduler/trunk/src/main/webapp/WEB-INF/portlet.xml scheduler/trunk/src/main/webapp/WEB-INF/scheduler.xml scheduler/trunk/src/main/webapp/WEB-INF/struts-config.xml scheduler/trunk/src/main/webapp/WEB-INF/validator-rules.xml scheduler/trunk/src/main/webapp/WEB-INF/view/ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/confirm.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/error.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/index.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/confirm.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/edit.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/error.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/index.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/userlist.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/common/ scheduler/trunk/src/main/webapp/WEB-INF/view/common/common.jsp scheduler/trunk/src/main/webapp/WEB-INF/view/config/ scheduler/trunk/src/main/webapp/WEB-INF/view/config/index.jsp scheduler/trunk/src/main/webapp/WEB-INF/web.xml -------------- next part -------------- Added: scheduler/trunk/.classpath =================================================================== --- scheduler/trunk/.classpath (rev 0) +++ scheduler/trunk/.classpath 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,46 @@ +<classpath> + <classpathentry kind="src" output="src/main/webapp/WEB-INF/classes" path="src/main/java"/> + <classpathentry kind="src" output="src/main/webapp/WEB-INF/classes" path="src/main/resources"/> + <classpathentry kind="src" path="src/main/webapp/WEB-INF/view"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + + <classpathentry kind="var" path="M2_REPO/portlet-api/portlet-api/1.0/portlet-api-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/portals/bridges/portals-bridges-portletfilter/1.0.4/portals-bridges-portletfilter-1.0.4.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-configuration/commons-configuration/1.5/commons-configuration-1.5.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.1.2/jstl-1.1.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/taglibs/standard/1.1.2/standard-1.1.2.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-el/commons-el/1.0/commons-el-1.0.jar" sourcepath="M2_REPO/commons-el/commons-el/1.0/commons-el-1.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3/commons-io-1.3.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.3/commons-lang-2.3.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-validator/commons-validator/1.2.0/commons-validator-1.2.0.jar" sourcepath="M2_REPO/commons-validator/commons-validator/1.2.0/commons-validator-1.2.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.6/commons-digester-1.6.jar" sourcepath="M2_REPO/commons-digester/commons-digester/1.6/commons-digester-1.6-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/2.1/commons-collections-2.1.jar"/> + <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/oro/oro/2.0.8/oro-2.0.8.jar" sourcepath="M2_REPO/oro/oro/2.0.8/oro-2.0.8-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar" sourcepath="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/portals/jetspeed-2/jetspeed-api/2.1.3/jetspeed-api-2.1.3.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/container/s2-extension/2.4.29/s2-extension-2.4.29.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/container/s2-framework/2.4.29/s2-framework-2.4.29.jar"/> + <classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/jboss/javassist/3.4.ga/javassist-3.4.ga.jar"/> + <classpathentry kind="var" path="M2_REPO/ognl/ognl/2.6.9-patch-20070908/ognl-2.6.9-patch-20070908.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/poi/poi/3.0-FINAL/poi-3.0-FINAL.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/container/s2-tiger/2.4.29/s2-tiger-2.4.29.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/sastruts/sa-struts-portlet/1.0.0-rc3/sa-struts-portlet-1.0.0-rc3.jar" sourcepath="M2_REPO/org/seasar/sastruts/sa-struts-portlet/1.0.0-rc3/sa-struts-portlet-1.0.0-rc3-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/struts/struts/1.2.9/struts-1.2.9.jar"/> + <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.2/antlr-2.7.2.jar" sourcepath="M2_REPO/antlr/antlr/2.7.2/antlr-2.7.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.5.1/xalan-2.5.1.jar" sourcepath="M2_REPO/xalan/xalan/2.5.1/xalan-2.5.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/sastruts/sa-struts/1.0.4-sp1/sa-struts-1.0.4-sp1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-annotation_1.0_spec/1.1.1/geronimo-annotation_1.0_spec-1.1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-ejb_3.0_spec/1.0/geronimo-ejb_3.0_spec-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-interceptor_3.0_spec/1.0/geronimo-interceptor_3.0_spec-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-jta_1.1_spec/1.0/geronimo-jta_1.1_spec-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/dao/s2-dao/1.0.48/s2-dao-1.0.48.jar"/> + <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seasar/dao/s2-dao-tiger/1.0.48/s2-dao-tiger-1.0.48.jar"/> + <classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.0.79/h2-1.0.79.jar"/> +</classpath> Property changes on: scheduler/trunk/.classpath ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/.project =================================================================== --- scheduler/trunk/.project (rev 0) +++ scheduler/trunk/.project 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +<projectDescription> + <name>scheduler</name> + <comment></comment> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.seasar.dolteng.eclipse.nature</nature> + </natures> +</projectDescription> \ No newline at end of file Property changes on: scheduler/trunk/.project ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/.settings/org.eclipse.jdt.core.prefs =================================================================== --- scheduler/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ scheduler/trunk/.settings/org.eclipse.jdt.core.prefs 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,261 @@ +#Mon Sep 15 07:23:10 JST 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=true +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true Added: scheduler/trunk/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- scheduler/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ scheduler/trunk/.settings/org.eclipse.jdt.ui.prefs 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ +#Mon Sep 15 07:23:26 JST 2008 +eclipse.preferences.version=1 +formatter_profile=_Seasar +formatter_settings_version=11 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> Added: scheduler/trunk/.settings/org.seasar.sastrutsplugin.prefs =================================================================== --- scheduler/trunk/.settings/org.seasar.sastrutsplugin.prefs (rev 0) +++ scheduler/trunk/.settings/org.seasar.sastrutsplugin.prefs 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,3 @@ +#Tue Sep 16 06:52:57 JST 2008 +WebContentsRoot=/src/main/webapp +eclipse.preferences.version=1 Added: scheduler/trunk/dbflute/_project.bat =================================================================== --- scheduler/trunk/dbflute/_project.bat (rev 0) +++ scheduler/trunk/dbflute/_project.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ + @ echo off + +set MY_PROJECT_NAME=scheduler + +set DBFLUTE_HOME=..\mydbflute\dbflute-0.8.2 Property changes on: scheduler/trunk/dbflute/_project.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/_project.sh =================================================================== --- scheduler/trunk/dbflute/_project.sh (rev 0) +++ scheduler/trunk/dbflute/_project.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ +#!/bin/sh + +export MY_PROJECT_NAME=scheduler + +export DBFLUTE_HOME=../mydbflute/dbflute-0.8.2 Property changes on: scheduler/trunk/dbflute/_project.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/dbflute/build-scheduler.properties =================================================================== --- scheduler/trunk/dbflute/build-scheduler.properties (rev 0) +++ scheduler/trunk/dbflute/build-scheduler.properties 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,161 @@ +# ======================================================================================= +# for All +# ======= + +# ------------------------------------------------------------------- +# P R O J E C T +# ------------------------------------------------------------------- +# @FirstProperty +# @Required +torque.project = scheduler + +# ------------------------------------------------------------------- +# T A R G E T D A T A B A S E +# ------------------------------------------------------------------- +# This is the target database, only considered when generating +# the SQL for your Torque project. Your possible choices are: +# +# axion, cloudscape, db2, db2400, hypersonic, interbase, mssql, +# mysql, oracle, postgresql, sapdb, sybase, firebird, derby, h2 +# ------------------------------------------------------------------- +# @FirstProperty +# @Required +torque.database = h2 + +# ------------------------------------------------------------------- +# T A R G E T L A N G U A G E +# ------------------------------------------------------------------- +# (Default 'java') +# The target language. Your possible choices are: +# java, csharp +# ------------------------------------------------------------------- +# @FirstProperty +#torque.targetLanguage = java + + + +# ======================================================================================= +# for OM task +# =========== + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# Basic +# _/_/_/_/ +# /--------------------------------------------------------------------------- +# [Output Directory] +# java.dir: (Default '../src/main/java') +# The base output directory. +# +# If this value is '../src/main/java' and your project stype is under maven, +# you don't need to set up this property! +# +# {project} +# | +# |-dbflute_ldb +# | |-build-ldb.properties +# | |-... +# | +# |-src/main/java // *Here! +# |-src/main/resources +# |-... +# +# +# @FirstProperty +#torque.java.dir = ../src/main/java +# ----------------/ + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# Package +# _/_/ +# /--------------------------------------------------------------------------- +# [EntityDao Package] +# packageBase: (Default '') +# The base directory of package. +# +# *If this property is specified and other package properties is not specified, +# Then The packages of generated class are as follows: +# +# ex) packageBase = org.seasar.dbflute.example.dbflute.ldb +# baseCommonPackage --> org.seasar.dbflute.example.dbflute.ldb.allcommon +# baseBehaviorPackage --> org.seasar.dbflute.example.dbflute.ldb.bsbhv +# baseDaoPackage --> org.seasar.dbflute.example.dbflute.ldb.bsdao +# baseEntityPackage --> org.seasar.dbflute.example.dbflute.ldb.bsentity +# conditionBeanPackage --> org.seasar.dbflute.example.dbflute.ldb.cbean +# extendedBehaviorPackage --> org.seasar.dbflute.example.dbflute.ldb.exbhv +# extendedDaoPackage --> org.seasar.dbflute.example.dbflute.ldb.exdao +# extendedEntityPackage --> org.seasar.dbflute.example.dbflute.ldb.exentity +# +# *If this property is not specified, you should specify the other package properties. +# +# +# baseCommonPackage: (Default Java:'allcommon' C#:'allcommon') +# baseBehaviorPackage: (Default Java:'bsbhv' C#:'bsbhv') +# baseDaoPackage: (Default Java:'bsdao' C#:'bsdao') +# baseEntityPackage: (Default Java:'bsentity' C#:'bsentity') +# conditionBeanPackage: (Default Java:'cbean' C#:'cbean') +# extendedBehaviorPackage: (Default Java:'exbhv' C#:'exbhv') +# extendedDaoPackage: (Default Java:'exdao' C#:'exdao') +# extendedEntityPackage: (Default Java:'exentity' C#:'exentity') +# +# @FirstProperty +torque.packageBase = jp.sf.pal.scheduler.db +# ----------------/ + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# S2Dao Adjustment +# _/_/_/_/_/_/ +# /--------------------------------------------------------------------------- +# [S2Dao Version] +# s2daoVersion: (Default [The latest version]) +# +# @JavaOnly +torque.s2daoVersion = 1.0.48 +# ----------------/ + + + +# ======================================================================================= +# for JDBC task +# ============= + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# [Database Informaition] +# +# * * * * * * * * * * * * * * * * * * * * * * * * * +# You shuold use './dfprop/databaseInfoMap.dfprop' +# Look the file! +# * * * * * * * * * * * * * * * * * * * * * * * * * +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ +# Adavance +# _/_/ + +# /--------------------------------------------------------------------------- +# [Sequence] +# sequenceDefinitionMap: (Default 'map:{}') +# The method 'XxxDao#selectNextVal()' is generated for its table primary key. +# +# ex) public String selectNextVal_SQL = "select gen_id(BOOK_BOOK_ID_INC, 1) from RDB$DATABASE"; +# public java.math.BigDecimal selectNextVal(); +# // This example is for the database of Firebird +# +# sequenceReturnType: (Default 'java.math.BigDecimal') +# The return type of The method 'XxxDao#selectNextVal()'. +# + +# +# *Apache Derby does not support Sequence-Object. +# But I want to test this property. +# +#torque.sequenceDefinitionMap = map:{ \ +# prodcts = PRODUCTS_PRODUCTS_ID_INC \ +# } + +#torque.sequenceReturnType = java.lang.Integer +# [Additional ForeignKey] +torque.additionalForeignKeyMap = map:{ \ +} + +#torque.isDeleteOldTableClass = true + Property changes on: scheduler/trunk/dbflute/build-scheduler.properties ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/dfprop/databaseInfoMap.dfprop =================================================================== --- scheduler/trunk/dbflute/dfprop/databaseInfoMap.dfprop (rev 0) +++ scheduler/trunk/dbflute/dfprop/databaseInfoMap.dfprop 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +# /--------------------------------------------------------------------------- +# [Database Information] +# databaseInfoMap: +# driver -- The class name of JDBC-Driver. +# url -- The url for connecting database. +# schema -- The schema name. +# user -- The database user name. +# password -- The database password. +# +# @FirstProperty +map:{ + ; driver = org.h2.Driver + ; url = jdbc:h2:file:../src/main/webapp/WEB-INF/db/scheduler + ; schema = + ; user = sa + ; password = +} +# ----------------/ Added: scheduler/trunk/dbflute/doc.bat =================================================================== --- scheduler/trunk/dbflute/doc.bat (rev 0) +++ scheduler/trunk/dbflute/doc.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Document}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-doc.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: scheduler/trunk/dbflute/doc.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/doc.sh =================================================================== --- scheduler/trunk/dbflute/doc.sh (rev 0) +++ scheduler/trunk/dbflute/doc.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Document}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-doc.sh $MY_PROPERTIES_PATH + Property changes on: scheduler/trunk/dbflute/doc.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/dbflute/generate.bat =================================================================== --- scheduler/trunk/dbflute/generate.bat (rev 0) +++ scheduler/trunk/dbflute/generate.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Generate}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-generate.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: scheduler/trunk/dbflute/generate.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/generate.sh =================================================================== --- scheduler/trunk/dbflute/generate.sh (rev 0) +++ scheduler/trunk/dbflute/generate.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,16 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Generate}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-generate.sh $MY_PROPERTIES_PATH + + + Property changes on: scheduler/trunk/dbflute/generate.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/dbflute/jdbc.bat =================================================================== --- scheduler/trunk/dbflute/jdbc.bat (rev 0) +++ scheduler/trunk/dbflute/jdbc.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {JDBC and Document}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-jdbc.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: scheduler/trunk/dbflute/jdbc.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/jdbc.sh =================================================================== --- scheduler/trunk/dbflute/jdbc.sh (rev 0) +++ scheduler/trunk/dbflute/jdbc.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH="build-${MY_PROJECT_NAME}.properties" + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {JDBC and Document}." +echo "nnnnnnnnnn/" +sh ${DBFLUTE_HOME}/etc/cmd/_df-jdbc.sh ${MY_PROPERTIES_PATH} + + Property changes on: scheduler/trunk/dbflute/jdbc.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/dbflute/log/readme.txt =================================================================== --- scheduler/trunk/dbflute/log/readme.txt (rev 0) +++ scheduler/trunk/dbflute/log/readme.txt 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1 @@ +Directory for LogFile Property changes on: scheduler/trunk/dbflute/log/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/output/doc/readme.txt =================================================================== --- scheduler/trunk/dbflute/output/doc/readme.txt (rev 0) +++ scheduler/trunk/dbflute/output/doc/readme.txt 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1 @@ +Directory for Document Property changes on: scheduler/trunk/dbflute/output/doc/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/outside-sql-test.bat =================================================================== --- scheduler/trunk/dbflute/outside-sql-test.bat (rev 0) +++ scheduler/trunk/dbflute/outside-sql-test.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Outsite-Sql-Test}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-outside-sql-test.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: scheduler/trunk/dbflute/outside-sql-test.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/outside-sql-test.sh =================================================================== --- scheduler/trunk/dbflute/outside-sql-test.sh (rev 0) +++ scheduler/trunk/dbflute/outside-sql-test.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Outsite-Sql-Test}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-outside-sql-test.sh $MY_PROPERTIES_PATH + + Property changes on: scheduler/trunk/dbflute/outside-sql-test.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/dbflute/playsql/replace-schema.sql =================================================================== --- scheduler/trunk/dbflute/playsql/replace-schema.sql (rev 0) +++ scheduler/trunk/dbflute/playsql/replace-schema.sql 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,418 @@ +ALTER TABLE BLACK_ACTION DROP CONSTRAINT FK_BLACK_ACTION_BLACK_LIST +; + +ALTER TABLE BLACK_ACTION DROP CONSTRAINT FK_BLACK_ACTION_LOOKUP +; + +ALTER TABLE BLACK_LIST DROP CONSTRAINT FK_BLACK_LIST_LB_USER +; + +ALTER TABLE BOOK DROP CONSTRAINT FK_BOOK_AUTHOR +; + +ALTER TABLE BOOK DROP CONSTRAINT FK_BOOK_PUBLISHER +; + +ALTER TABLE BOOK DROP CONSTRAINT FK_BOOK_GENRE +; + +ALTER TABLE COLLECTION DROP CONSTRAINT FK_COLLECTION_BOOK +; + +ALTER TABLE COLLECTION DROP CONSTRAINT FK_COLLECTION_LIBRARY +; + +ALTER TABLE COLLECTION_STATUS DROP CONSTRAINT FK_COLLECTION_STATUS_COLLECTION +; + +ALTER TABLE COLLECTION_STATUS DROP CONSTRAINT FK_COLLECTION_STATUS_LOOKUP +; + +ALTER TABLE GENRE DROP CONSTRAINT FK_GENRE_GENRE +; + +ALTER TABLE LB_USER DROP CONSTRAINT FK_LB_USER_LIBRARY +; + +ALTER TABLE LENDING DROP CONSTRAINT FK_LENDING_LIBRARY +; + +ALTER TABLE LENDING DROP CONSTRAINT FK_LENDING_LB_USER +; + +ALTER TABLE LENDING_COLLECTION DROP CONSTRAINT FK_LENDING_COLLECTION_LENDING +; + +ALTER TABLE LENDING_COLLECTION DROP CONSTRAINT FK_LENDING_COLLECTION_COL +; + +ALTER TABLE NEXT_LIBRARY DROP CONSTRAINT FK_NEXT_LIBRARY_LIBRARY_ID +; + +ALTER TABLE NEXT_LIBRARY DROP CONSTRAINT FK_NEXT_LIBRARY_NEXT_LIBRARY_ID +; + + +DROP TABLE AUTHOR +; +DROP TABLE BLACK_ACTION +; +DROP TABLE BLACK_ACTION_LOOKUP +; +DROP TABLE BLACK_LIST +; +DROP TABLE BOOK +; +DROP TABLE COLLECTION +; +DROP TABLE COLLECTION_STATUS +; +DROP TABLE COLLECTION_STATUS_LOOKUP +; +DROP TABLE GARBAGE +; +DROP TABLE GENRE +; +DROP TABLE LB_USER +; +DROP TABLE LENDING +; +DROP TABLE LENDING_COLLECTION +; +DROP TABLE LIBRARY +; +DROP TABLE NEXT_LIBRARY +; +DROP TABLE PUBLISHER +; + +CREATE TABLE AUTHOR ( + AUTHOR_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + AUTHOR_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BLACK_ACTION ( + BLACK_ACTION_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + BLACK_LIST_ID integer NOT NULL, + BLACK_ACTION_CODE char(3) NOT NULL, + BLACK_LEVEL smallint NOT NULL, + EVIDENCE_PHOTOGRAPH blob, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BLACK_ACTION_LOOKUP ( + BLACK_ACTION_CODE char(3) NOT NULL, + BLACK_ACTION_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BLACK_LIST ( + BLACK_LIST_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LB_USER_ID integer NOT NULL, + BLACK_RANK char(3) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE BOOK ( + BOOK_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + ISBN_NO varchar(20) NOT NULL, + BOOK_NAME varchar(80) NOT NULL, + AUTHOR_ID integer NOT NULL, + PUBLISHER_ID integer NOT NULL, + MAX_LENDING_DATE_COUNT smallint NOT NULL, + GENRE_CODE varchar(12), + OPENING_PART clob, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE COLLECTION ( + COLLECTION_ID integer NOT NULL, + LIBRARY_ID smallint NOT NULL, + BOOK_ID integer NOT NULL, + ARRIVAL_DATE timestamp NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE COLLECTION_STATUS ( + COLLECTION_ID integer NOT NULL, + COLLECTION_STATUS_CODE char(3) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE COLLECTION_STATUS_LOOKUP ( + COLLECTION_STATUS_CODE char(3) NOT NULL, + COLLECTION_STATUS_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE GARBAGE ( + GARBAGE_MEMO varchar(50), + GARBAGE_TIME timestamp +) +; + +CREATE TABLE GENRE ( + GENRE_CODE varchar(12) NOT NULL, + GENRE_NAME varchar(80) NOT NULL, + PARENT_GENRE_CODE varchar(12), + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LB_USER ( + LB_USER_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LB_USER_NAME varchar(80) NOT NULL, + LIBRARY_ID smallint NOT NULL, + USER_PASSWORD varchar(50) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LENDING ( + LENDING_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LIBRARY_ID smallint NOT NULL, + LB_USER_ID integer NOT NULL, + LENDING_DATE timestamp NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LENDING_COLLECTION ( + LENDING_ID integer NOT NULL, + COLLECTION_ID integer NOT NULL, + RETURN_LIMIT_DATE timestamp NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE LIBRARY ( + LIBRARY_ID smallint NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + LIBRARY_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE NEXT_LIBRARY ( + LIBRARY_ID smallint NOT NULL, + NEXT_LIBRARY_ID smallint NOT NULL, + DISTANCE_KM integer NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + +CREATE TABLE PUBLISHER ( + PUBLISHER_ID integer NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + PUBLISHER_NAME varchar(80) NOT NULL, + R_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + U_TIME timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL, + R_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL, + U_STAFF varchar(50) DEFAULT 'DefaultStaff' NOT NULL +) +; + + +ALTER TABLE AUTHOR ADD CONSTRAINT PK_AUTHOR + PRIMARY KEY (AUTHOR_ID) +; + +ALTER TABLE BLACK_ACTION ADD CONSTRAINT PK_BLACK_ACTION + PRIMARY KEY (BLACK_ACTION_ID) +; + +ALTER TABLE BLACK_ACTION_LOOKUP ADD CONSTRAINT PK_BLACK_ACTION_LOOKUP + PRIMARY KEY (BLACK_ACTION_CODE) +; + +ALTER TABLE BLACK_LIST ADD CONSTRAINT PK_BLACK_LIST + PRIMARY KEY (BLACK_LIST_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT PK_BOOK + PRIMARY KEY (BOOK_ID) +; + +ALTER TABLE COLLECTION ADD CONSTRAINT PK_COLLECTION + PRIMARY KEY (COLLECTION_ID) +; + +ALTER TABLE COLLECTION_STATUS ADD CONSTRAINT PK_COLLECTION_STATUS + PRIMARY KEY (COLLECTION_ID) +; + +ALTER TABLE COLLECTION_STATUS_LOOKUP ADD CONSTRAINT PK_COLLECTION_STATUS_LOOKUP + PRIMARY KEY (COLLECTION_STATUS_CODE) +; + +ALTER TABLE GENRE ADD CONSTRAINT PK_GENRE + PRIMARY KEY (GENRE_CODE) +; + +ALTER TABLE LB_USER ADD CONSTRAINT PK_LB_USER + PRIMARY KEY (LB_USER_ID) +; + +ALTER TABLE LENDING ADD CONSTRAINT PK_LENDING + PRIMARY KEY (LENDING_ID) +; + +ALTER TABLE LENDING_COLLECTION ADD CONSTRAINT PK_LENDING_COLLECTION + PRIMARY KEY (LENDING_ID, COLLECTION_ID) +; + +ALTER TABLE LIBRARY ADD CONSTRAINT PK_LIBRARY + PRIMARY KEY (LIBRARY_ID) +; + +ALTER TABLE NEXT_LIBRARY ADD CONSTRAINT PK_NEXT_LIBRARY + PRIMARY KEY (LIBRARY_ID, NEXT_LIBRARY_ID) +; + +ALTER TABLE PUBLISHER ADD CONSTRAINT PK_PUBLISHER + PRIMARY KEY (PUBLISHER_ID) +; + + +ALTER TABLE BOOK + ADD CONSTRAINT UQ_BOOK_ISBN_NO UNIQUE (ISBN_NO) +; + +ALTER TABLE COLLECTION + ADD CONSTRAINT UQ_COLLECTION_Primary UNIQUE (LIBRARY_ID, BOOK_ID) +; + +ALTER TABLE LENDING + ADD CONSTRAINT UQ_LENDING_Primary UNIQUE (LIBRARY_ID, LB_USER_ID) +; + +ALTER TABLE BLACK_LIST + ADD CONSTRAINT UQ_BLACK_LIST_LB_USER_ID UNIQUE (LB_USER_ID) +; + +ALTER TABLE LIBRARY + ADD CONSTRAINT UQ_LIBRARY_LIBRARY_NAME UNIQUE (LIBRARY_NAME) +; + + + +ALTER TABLE BLACK_ACTION ADD CONSTRAINT FK_BLACK_ACTION_BLACK_LIST + FOREIGN KEY (BLACK_LIST_ID) REFERENCES BLACK_LIST (BLACK_LIST_ID) +; + +ALTER TABLE BLACK_ACTION ADD CONSTRAINT FK_BLACK_ACTION_LOOKUP + FOREIGN KEY (BLACK_ACTION_CODE) REFERENCES BLACK_ACTION_LOOKUP (BLACK_ACTION_CODE) +; + +ALTER TABLE BLACK_LIST ADD CONSTRAINT FK_BLACK_LIST_LB_USER + FOREIGN KEY (LB_USER_ID) REFERENCES LB_USER (LB_USER_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT FK_BOOK_AUTHOR + FOREIGN KEY (AUTHOR_ID) REFERENCES AUTHOR (AUTHOR_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT FK_BOOK_PUBLISHER + FOREIGN KEY (PUBLISHER_ID) REFERENCES PUBLISHER (PUBLISHER_ID) +; + +ALTER TABLE BOOK ADD CONSTRAINT FK_BOOK_GENRE + FOREIGN KEY (GENRE_CODE) REFERENCES GENRE (GENRE_CODE) +; + +ALTER TABLE COLLECTION ADD CONSTRAINT FK_COLLECTION_BOOK + FOREIGN KEY (BOOK_ID) REFERENCES BOOK (BOOK_ID) +; + +ALTER TABLE COLLECTION ADD CONSTRAINT FK_COLLECTION_LIBRARY + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE COLLECTION_STATUS ADD CONSTRAINT FK_COLLECTION_STATUS_COLLECTION + FOREIGN KEY (COLLECTION_ID) REFERENCES COLLECTION (COLLECTION_ID) +; + +ALTER TABLE COLLECTION_STATUS ADD CONSTRAINT FK_COLLECTION_STATUS_LOOKUP + FOREIGN KEY (COLLECTION_STATUS_CODE) REFERENCES COLLECTION_STATUS_LOOKUP (COLLECTION_STATUS_CODE) +; + +ALTER TABLE GENRE ADD CONSTRAINT FK_GENRE_GENRE + FOREIGN KEY (PARENT_GENRE_CODE) REFERENCES GENRE (GENRE_CODE) +; + +ALTER TABLE LB_USER ADD CONSTRAINT FK_LB_USER_LIBRARY + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE LENDING ADD CONSTRAINT FK_LENDING_LIBRARY + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE LENDING ADD CONSTRAINT FK_LENDING_LB_USER + FOREIGN KEY (LB_USER_ID) REFERENCES LB_USER (LB_USER_ID) +; + +ALTER TABLE LENDING_COLLECTION ADD CONSTRAINT FK_LENDING_COLLECTION_LENDING + FOREIGN KEY (LENDING_ID) REFERENCES LENDING (LENDING_ID) +; + +ALTER TABLE LENDING_COLLECTION ADD CONSTRAINT FK_LENDING_COLLECTION_COL + FOREIGN KEY (COLLECTION_ID) REFERENCES COLLECTION (COLLECTION_ID) +; + +ALTER TABLE NEXT_LIBRARY ADD CONSTRAINT FK_NEXT_LIBRARY_LIBRARY_ID + FOREIGN KEY (LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; + +ALTER TABLE NEXT_LIBRARY ADD CONSTRAINT FK_NEXT_LIBRARY_NEXT_LIBRARY_ID + FOREIGN KEY (NEXT_LIBRARY_ID) REFERENCES LIBRARY (LIBRARY_ID) +; Added: scheduler/trunk/dbflute/replace-schema.bat =================================================================== --- scheduler/trunk/dbflute/replace-schema.bat (rev 0) +++ scheduler/trunk/dbflute/replace-schema.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Replace-Schema}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-replace-schema.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: scheduler/trunk/dbflute/replace-schema.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/replace-schema.sh =================================================================== --- scheduler/trunk/dbflute/replace-schema.sh (rev 0) +++ scheduler/trunk/dbflute/replace-schema.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Replace-Schema}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-replace-schema.sh $MY_PROPERTIES_PATH + + Property changes on: scheduler/trunk/dbflute/replace-schema.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/dbflute/schema/readme.txt =================================================================== --- scheduler/trunk/dbflute/schema/readme.txt (rev 0) +++ scheduler/trunk/dbflute/schema/readme.txt 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1 @@ +Directory for SchemaFile Property changes on: scheduler/trunk/dbflute/schema/readme.txt ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/sql2entity.bat =================================================================== --- scheduler/trunk/dbflute/sql2entity.bat (rev 0) +++ scheduler/trunk/dbflute/sql2entity.bat 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ + @ echo off + +%~d0 +cd %~p0 +call _project.bat + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Specify the file path to be used as build-properties. +rem nnnnnnnnnn/ +set MY_PROPERTIES_PATH=build-%MY_PROJECT_NAME%.properties + +rem /nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn +rem Execute {Invoke Sql Directory}. +rem nnnnnnnnnn/ +call %DBFLUTE_HOME%\etc\cmd\_df-sql2entity.cmd %MY_PROPERTIES_PATH% + +pause + + Property changes on: scheduler/trunk/dbflute/sql2entity.bat ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/dbflute/sql2entity.sh =================================================================== --- scheduler/trunk/dbflute/sql2entity.sh (rev 0) +++ scheduler/trunk/dbflute/sql2entity.sh 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +#!/bin/sh + +. _project.sh + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Specify the file path to be used as build-properties." +echo "nnnnnnnnnn/" +export MY_PROPERTIES_PATH=build-${MY_PROJECT_NAME}.properties + +echo "/nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" +echo "Execute {Invoke Sql Directory}." +echo "nnnnnnnnnn/" +sh $DBFLUTE_HOME/etc/cmd/_df-sql2entity.sh $MY_PROPERTIES_PATH + + Property changes on: scheduler/trunk/dbflute/sql2entity.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: scheduler/trunk/pom.xml =================================================================== --- scheduler/trunk/pom.xml (rev 0) +++ scheduler/trunk/pom.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,302 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>jp.sf.pal</groupId> + <artifactId>scheduler</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>war</packaging> + <name>Scheduler</name> + <description/> + <build> + <finalName>scheduler</finalName> + <defaultGoal>validate</defaultGoal> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.3</version> + </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <configuration> + <updateReleaseInfo>true</updateReleaseInfo> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.0-SNAPSHOT</version> + <executions> + <execution> + <goals> + <goal>clean</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>source-jar</id> + <phase>package</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <repositories> + <repository> + <id>mvnrepository.com</id> + <name>Maven2 Repository on mvnrepository.com</name> + <url>http://mvnrepository.com/artifact/</url> + </repository> + <repository> + <id>maven.marevol.com</id> + <name>Maven2 Repository on marevol.com</name> + <url>http://maven2.marevol.com/</url> + </repository> + <repository> + <id>maven.seasar.org</id> + <name>The Seasar Foundation Maven2 Repository</name> + <url>http://maven.seasar.org/maven2</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>portlet-api</groupId> + <artifactId>portlet-api</artifactId> + <version>1.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.portals.bridges</groupId> + <artifactId>portals-bridges-portletfilter</artifactId> + <version>1.0.4</version> + <exclusions> + <exclusion> + <groupId>logkit</groupId> + <artifactId>logkit</artifactId> + </exclusion> + <exclusion> + <groupId>avalon-framework</groupId> + <artifactId>avalon-framework</artifactId> + </exclusion> + <exclusion> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2</version> + </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + <version>1.5</version> + </dependency> + <dependency> + <groupId>jstl</groupId> + <artifactId>jstl</artifactId> + <version>1.1.2</version> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + </dependency> + <dependency> + <groupId>commons-el</groupId> + <artifactId>commons-el</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2.1</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.3</version> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.3</version> + </dependency> + <dependency> + <groupId>commons-validator</groupId> + <artifactId>commons-validator</artifactId> + <version>1.2.0</version> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.4</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.13</version> + <type>jar</type> + </dependency> +<!-- Jetspeed2 --> + <dependency> + <groupId>org.apache.portals.jetspeed-2</groupId> + <artifactId>jetspeed-api</artifactId> + <version>2.1.3</version> + <scope>provided</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.3</version> + <scope>provided</scope> + </dependency> +<!-- SAStruts --> + <dependency> + <groupId>org.seasar.container</groupId> + <artifactId>s2-extension</artifactId> + <version>2.4.29</version> + <exclusions> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.seasar.container</groupId> + <artifactId>s2-tiger</artifactId> + <version>2.4.29</version> + <exclusions> + <exclusion> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.seasar.sastruts</groupId> + <artifactId>sa-struts-portlet</artifactId> + <version>1.0.0-rc3</version> + <exclusions> + <exclusion> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + </exclusion> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-annotation_1.0_spec</artifactId> + <version>1.1.1</version> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-ejb_3.0_spec</artifactId> + <version>1.0</version> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-interceptor_3.0_spec</artifactId> + <version>1.0</version> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jta_1.1_spec</artifactId> + <version>1.0</version> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> +<!-- DB --> + <dependency> + <groupId>org.seasar.dao</groupId> + <artifactId>s2-dao</artifactId> + <version>1.0.48</version> + </dependency> + <dependency> + <groupId>org.seasar.dao</groupId> + <artifactId>s2-dao-tiger</artifactId> + <version>1.0.48</version> + </dependency> + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <version>1.0.79</version> + </dependency> +<!-- + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.6</version> + </dependency> +--> + </dependencies> +</project> Property changes on: scheduler/trunk/pom.xml ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/config/erd/scheduler.erd =================================================================== --- scheduler/trunk/src/main/config/erd/scheduler.erd (rev 0) +++ scheduler/trunk/src/main/config/erd/scheduler.erd 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1683 @@ +<?xml version="1.0" encoding="UTF-8"?> +<net.java.amateras.db.visual.model.RootModel> + <children> + <net.java.amateras.db.visual.model.TableModel> + <error></error> + <linkedPath></linkedPath> + <tableName>user_info</tableName> + <logicalName>User Information</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>user_id</columnName> + <logicalName>User ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>255</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>given_name</columnName> + <logicalName>Given Name</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>100</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>family_name</columnName> + <logicalName>Family Name</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</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>middle_name</columnName> + <logicalName>Middle Name</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>50</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>given_name_desc</columnName> + <logicalName>Given Name Descritpion</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</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>family_name_desc</columnName> + <logicalName>Family Name Description</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</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>nickname</columnName> + <logicalName>Nickname</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>100</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>gender</columnName> + <logicalName>Gender</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[7]/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>birth_date</columnName> + <logicalName>Birth Date</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>DATE</name> + <logicalName>Date</logicalName> + <supportSize>false</supportSize> + <type>91</type> + </columnType> + <size>10</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>email</columnName> + <logicalName>Email</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>url</columnName> + <logicalName>URL</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>telephone</columnName> + <logicalName>Telephone</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>40</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>role_id</columnName> + <logicalName>Default Role ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>255</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>group_id</columnName> + <logicalName>Default Group ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>255</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"> + <name>TIMESTAMP</name> + <logicalName>Datetime</logicalName> + <supportSize>false</supportSize> + <type>93</type> + </columnType> + <size>10</size> + <notNull>true</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_by</columnName> + <logicalName>Created By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>updated_time</columnName> + <logicalName>Updated Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</size> + <notNull>true</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>updated_by</columnName> + <logicalName>Updated By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>deleted_time</columnName> + <logicalName>Deleted Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</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>deleted_by</columnName> + <logicalName>Deleted By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>versionNo</columnName> + <logicalName>Version No.</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>INTEGER</name> + <logicalName>Integer</logicalName> + <supportSize>false</supportSize> + <type>4</type> + </columnType> + <size>10</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>442</x> + <y>199</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_user_to_group</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>group_id</columnName> + <logicalName>Group ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>255</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[14]"/> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <target class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>group_info</tableName> + <logicalName>Group Information</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>name</columnName> + <logicalName>Name</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>100</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>description</columnName> + <logicalName>Description</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>255</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>email</columnName> + <logicalName>Email</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>url</columnName> + <logicalName>URL</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>telephone</columnName> + <logicalName>Telephone</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>40</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" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</size> + <notNull>true</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_by</columnName> + <logicalName>Created By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>updated_time</columnName> + <logicalName>Updated Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</size> + <notNull>true</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>updated_by</columnName> + <logicalName>Updated By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>deleted_time</columnName> + <logicalName>Deleted Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</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>deleted_by</columnName> + <logicalName>Deleted By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>versionNo</columnName> + <logicalName>Version No.</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[21]/columnType"/> + <size>10</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>40</x> + <y>700</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections/> + <targetConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_mapping_to_group</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>group_id</columnName> + <logicalName>Group ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>255</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>group_mapping</tableName> + <logicalName>Group Mapping</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>INTEGER</name> + <logicalName>Integer</logicalName> + <supportSize>false</supportSize> + <type>4</type> + </columnType> + <size>10</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>true</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>user_id</columnName> + <logicalName>User ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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 reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </columns> + <indices/> + <constraint> + <x>44</x> + <y>40</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_mapping_to_user</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../../../../../../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + </sourceConnections> + <targetConnections/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </source> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </targetConnections> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </target> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_user_to_role</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>role_id</columnName> + <logicalName>Role ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>255</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[13]"/> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <target class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>role_info</tableName> + <logicalName>Role Information</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>name</columnName> + <logicalName>Name</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>100</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>description</columnName> + <logicalName>Description</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>255</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>email</columnName> + <logicalName>Email</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>url</columnName> + <logicalName>URL</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>telephone</columnName> + <logicalName>Telephone</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>40</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" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</size> + <notNull>true</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_by</columnName> + <logicalName>Created By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>updated_time</columnName> + <logicalName>Updated Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</size> + <notNull>true</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>updated_by</columnName> + <logicalName>Updated By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>deleted_time</columnName> + <logicalName>Deleted Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[15]/columnType"/> + <size>10</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>deleted_by</columnName> + <logicalName>Deleted By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>versionNo</columnName> + <logicalName>Version No.</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[21]/columnType"/> + <size>10</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>308</x> + <y>700</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections/> + <targetConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_mapping_to_role</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>role_id</columnName> + <logicalName>Role ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>role_mapping</tableName> + <logicalName>Role Mapping</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>INT</name> + <logicalName>Integer</logicalName> + <supportSize>false</supportSize> + <type>4</type> + </columnType> + <size>10</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>true</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>user_id</columnName> + <logicalName>User ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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 reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </columns> + <indices/> + <constraint> + <x>305</x> + <y>40</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_mapping_to_user</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../../../../../../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + </sourceConnections> + <targetConnections/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </source> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </targetConnections> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </target> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </sourceConnections> + <targetConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel"/> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel"/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_single_schedule_mapping_to_user</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>user_id</columnName> + <logicalName>User ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>VARCHAR</name> + <logicalName>String</logicalName> + <supportSize>true</supportSize> + <type>12</type> + </columnType> + <size>255</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>single_schedule_mapping</tableName> + <logicalName>Single Schedule Mapping</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>BIGINT</name> + <logicalName>Integer</logicalName> + <supportSize>true</supportSize> + <type>-5</type> + </columnType> + <size>20</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>true</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>schedule_id</columnName> + <logicalName>Schedule ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>BIGINT</name> + <logicalName>Integer</logicalName> + <supportSize>true</supportSize> + <type>-5</type> + </columnType> + <size>20</size> + <notNull>true</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 reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </columns> + <indices/> + <constraint> + <x>839</x> + <y>40</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_single_schedule_mapping_to_schedule</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>20</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>true</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <target class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>single_schedule</tableName> + <logicalName>Single Schedule</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>title</columnName> + <logicalName>Title</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</size> + <notNull>true</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>location</columnName> + <logicalName>Location</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</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>start_date</columnName> + <logicalName>Start Date</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>DATE</name> + <logicalName>Date</logicalName> + <supportSize>false</supportSize> + <type>91</type> + </columnType> + <size>10</size> + <notNull>true</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>start_time</columnName> + <logicalName>Start Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>TIME</name> + <logicalName>Time</logicalName> + <supportSize>false</supportSize> + <type>92</type> + </columnType> + <size>10</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>end_date</columnName> + <logicalName>End Date</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/> + <size>10</size> + <notNull>true</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>end_time</columnName> + <logicalName>End Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/> + <size>10</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"> + <name>TIMESTAMP</name> + <logicalName>Datetime</logicalName> + <supportSize>false</supportSize> + <type>93</type> + </columnType> + <size>10</size> + <notNull>true</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_by</columnName> + <logicalName>Created By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>updated_time</columnName> + <logicalName>Updated Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/> + <size>10</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>updated_by</columnName> + <logicalName>Updated By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>deleted_time</columnName> + <logicalName>Deleted Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/> + <size>10</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>deleted_by</columnName> + <logicalName>Deleted By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>versionNo</columnName> + <logicalName>Version No</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType"> + <name>INTEGER</name> + <logicalName>Integer</logicalName> + <supportSize>false</supportSize> + <type>4</type> + </columnType> + <size>10</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>1104</x> + <y>199</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections/> + <targetConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_content_to_single_schedule</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>20</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>single_schedule_content</tableName> + <logicalName>Single Schedule Content</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>content</columnName> + <logicalName>Content</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>1000</size> + <notNull>false</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>1371</x> + <y>40</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + </sourceConnections> + <targetConnections/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </source> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </targetConnections> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </target> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </sourceConnections> + <targetConnections/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </source> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_routine_schedule_mapping_to_user</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>user_id</columnName> + <logicalName>User ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>routine_schedule_mapping</tableName> + <logicalName>Routine Schedule Mapping</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>20</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>true</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>schedule_id</columnName> + <logicalName>Schedule ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>20</size> + <notNull>true</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 reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </columns> + <indices/> + <constraint> + <x>557</x> + <y>40</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_routine_schedule_mapping_to_schedule</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/columns/net.java.amateras.db.visual.model.ColumnModel/columnType"/> + <size>20</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>true</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../columns/net.java.amateras.db.visual.model.ColumnModel[2]"/> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <target class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>routine_schedule</tableName> + <logicalName>Routine Schedule</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>title</columnName> + <logicalName>Title</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</size> + <notNull>true</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>location</columnName> + <logicalName>Location</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>100</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>start_date</columnName> + <logicalName>Start Date</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/> + <size>10</size> + <notNull>true</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>start_time</columnName> + <logicalName>Start Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/> + <size>10</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>end_date</columnName> + <logicalName>End Date</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[4]/columnType"/> + <size>10</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>end_time</columnName> + <logicalName>End Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[5]/columnType"/> + <size>10</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>type</columnName> + <logicalName>Type</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>10</size> + <notNull>true</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" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/> + <size>10</size> + <notNull>true</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_by</columnName> + <logicalName>Created By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>updated_time</columnName> + <logicalName>Updated Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/> + <size>10</size> + <notNull>true</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>updated_by</columnName> + <logicalName>Updated By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</size> + <notNull>true</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>deleted_time</columnName> + <logicalName>Deleted Time</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[8]/columnType"/> + <size>10</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>deleted_by</columnName> + <logicalName>Deleted By</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>255</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>versionNo</columnName> + <logicalName>Version No.</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/columns/net.java.amateras.db.visual.model.ColumnModel[14]/columnType"/> + <size>10</size> + <notNull>true</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>836</x> + <y>199</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections/> + <targetConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + <net.java.amateras.db.visual.model.ForeignKeyModel> + <foreignKeyName>FK_from_content_to_routine_schedule</foreignKeyName> + <references> + <entry> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../../../../references/entry/net.java.amateras.db.visual.model.ColumnModel"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>id</columnName> + <logicalName>ID</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/columns/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>20</size> + <notNull>true</notNull> + <primaryKey>true</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </entry> + </references> + <source class="net.java.amateras.db.visual.model.TableModel"> + <error></error> + <linkedPath></linkedPath> + <tableName>routine_schedule_content</tableName> + <logicalName>Routine Schedule Content</logicalName> + <description></description> + <columns> + <net.java.amateras.db.visual.model.ColumnModel reference="../../../references/entry/net.java.amateras.db.visual.model.ColumnModel[2]"/> + <net.java.amateras.db.visual.model.ColumnModel> + <columnName>content</columnName> + <logicalName>Content</logicalName> + <columnType class="net.java.amateras.db.dialect.ColumnType" reference="../../../../../../../../../../../net.java.amateras.db.visual.model.ForeignKeyModel[3]/references/entry/net.java.amateras.db.visual.model.ColumnModel[2]/columnType"/> + <size>1000</size> + <notNull>false</notNull> + <primaryKey>false</primaryKey> + <description></description> + <autoIncrement>false</autoIncrement> + <defaultValue></defaultValue> + </net.java.amateras.db.visual.model.ColumnModel> + </columns> + <indices/> + <constraint> + <x>1121</x> + <y>40</y> + <width>-1</width> + <height>-1</height> + </constraint> + <sourceConnections> + <net.java.amateras.db.visual.model.ForeignKeyModel reference="../../.."/> + </sourceConnections> + <targetConnections/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </source> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </targetConnections> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </target> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </sourceConnections> + <targetConnections/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </source> + <target class="net.java.amateras.db.visual.model.TableModel" reference="../../.."/> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.ForeignKeyModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.ForeignKeyModel> + </targetConnections> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.TableModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> + </net.java.amateras.db.visual.model.TableModel> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]/source"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[4]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[4]/source"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[3]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source"/> + <net.java.amateras.db.visual.model.TableModel reference="../net.java.amateras.db.visual.model.TableModel/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[4]/source/sourceConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/target/targetConnections/net.java.amateras.db.visual.model.ForeignKeyModel[2]/source"/> + </children> + <dommains/> + <dialectName>hsqldb</dialectName> + <logicalMode>false</logicalMode> + <jarFile>/home/taro/.m2/repository/com/h2database/h2/1.0.79/h2-1.0.79.jar</jarFile> + <jdbcDriver>org.h2.Driver</jdbcDriver> + <jdbcUrl>jdbc:h2:tcp://localhost:9092/scheduler</jdbcUrl> + <jdbcUser>sa</jdbcUser> + <jdbcPassword></jdbcPassword> + <jdbcSchema></jdbcSchema> + <jdbcCatalog></jdbcCatalog> + <includeView>false</includeView> + <listeners serialization="custom"> + <java.beans.PropertyChangeSupport> + <default> + <propertyChangeSupportSerializedDataVersion>2</propertyChangeSupportSerializedDataVersion> + <source class="net.java.amateras.db.visual.model.RootModel" reference="../../../.."/> + </default> + <null/> + </java.beans.PropertyChangeSupport> + </listeners> +</net.java.amateras.db.visual.model.RootModel> \ No newline at end of file Added: scheduler/trunk/src/main/config/sql/scheduler.ddl =================================================================== --- scheduler/trunk/src/main/config/sql/scheduler.ddl (rev 0) +++ scheduler/trunk/src/main/config/sql/scheduler.ddl 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,182 @@ +DROP TABLE routine_schedule_content; +DROP TABLE single_schedule_content; +DROP TABLE routine_schedule_mapping; +DROP TABLE routine_schedule; +DROP TABLE single_schedule_mapping; +DROP TABLE single_schedule; +DROP TABLE role_mapping; +DROP TABLE group_mapping; +DROP TABLE user_info; +DROP TABLE role_info; +DROP TABLE group_info; + +/********************************** +Table Name: Group Information +**********************************/ +CREATE TABLE group_info( + group_id VARCHAR(255) NOT NULL PRIMARY KEY, + name VARCHAR(100), + description VARCHAR(255), + email VARCHAR(255), + url VARCHAR(255), + telephone VARCHAR(40), + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + versionNo INTEGER NOT NULL +); + +/********************************** +Table Name: Role Information +**********************************/ +CREATE TABLE role_info( + role_id VARCHAR(255) NOT NULL PRIMARY KEY, + name VARCHAR(100), + description VARCHAR(255), + email VARCHAR(255), + url VARCHAR(255), + telephone VARCHAR(40), + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + versionNo INTEGER NOT NULL +); + +/********************************** +Table Name: User Information +**********************************/ +CREATE TABLE user_info( + user_id VARCHAR(255) NOT NULL PRIMARY KEY, + given_name VARCHAR(100), + family_name VARCHAR(100), + middle_name VARCHAR(50), + given_name_desc VARCHAR(100), + family_name_desc VARCHAR(100), + nickname VARCHAR(100), + gender VARCHAR(1), + birth_date DATE, + email VARCHAR(255), + url VARCHAR(255), + telephone VARCHAR(40), + role_id VARCHAR(255), + group_id VARCHAR(255), + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + versionNo INTEGER NOT NULL, + FOREIGN KEY (group_id) REFERENCES group_info (group_id), + FOREIGN KEY (role_id) REFERENCES role_info (role_id) +); + +/********************************** +Table Name: Group Mapping +**********************************/ +CREATE TABLE group_mapping( + id INTEGER NOT NULL IDENTITY PRIMARY KEY, + user_id VARCHAR(255) NOT NULL, + group_id VARCHAR(255) NOT NULL, + FOREIGN KEY (user_id) REFERENCES user_info (user_id), + FOREIGN KEY (group_id) REFERENCES group_info (group_id) +); + +/********************************** +Table Name: Role Mapping +**********************************/ +CREATE TABLE role_mapping( + id INT NOT NULL IDENTITY PRIMARY KEY, + user_id VARCHAR(255) NOT NULL, + role_id VARCHAR(255) NOT NULL, + FOREIGN KEY (user_id) REFERENCES user_info (user_id), + FOREIGN KEY (role_id) REFERENCES role_info (role_id) +); + +/********************************** +Table Name: Single Schedule +**********************************/ +CREATE TABLE single_schedule( + id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, + title VARCHAR(100) NOT NULL, + location VARCHAR(100), + start_date DATE NOT NULL, + start_time TIME, + end_date DATE NOT NULL, + end_time TIME, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP, + updated_by VARCHAR(255), + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + versionNo INTEGER NOT NULL +); + +/********************************** +Table Name: Single Schedule Mapping +**********************************/ +CREATE TABLE single_schedule_mapping( + id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, + schedule_id BIGINT(20) NOT NULL, + user_id VARCHAR(255) NOT NULL, + FOREIGN KEY (user_id) REFERENCES user_info (user_id), + FOREIGN KEY (schedule_id) REFERENCES single_schedule (id) +); + +/********************************** +Table Name: Routine Schedule +**********************************/ +CREATE TABLE routine_schedule( + id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, + title VARCHAR(100) NOT NULL, + location VARCHAR(100), + start_date DATE NOT NULL, + start_time TIME, + end_date DATE, + end_time TIME, + type VARCHAR(10) NOT NULL, + created_time TIMESTAMP NOT NULL, + created_by VARCHAR(255) NOT NULL, + updated_time TIMESTAMP NOT NULL, + updated_by VARCHAR(255) NOT NULL, + deleted_time TIMESTAMP, + deleted_by VARCHAR(255), + versionNo INTEGER NOT NULL +); + +/********************************** +Table Name: Routine Schedule Mapping +**********************************/ +CREATE TABLE routine_schedule_mapping( + id BIGINT(20) NOT NULL IDENTITY PRIMARY KEY, + schedule_id BIGINT(20) NOT NULL, + user_id VARCHAR(255) NOT NULL, + FOREIGN KEY (user_id) REFERENCES user_info (user_id), + FOREIGN KEY (schedule_id) REFERENCES routine_schedule (id) +); + +/********************************** +Table Name: Single Schedule Content +**********************************/ +CREATE TABLE single_schedule_content( + id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(1000), + FOREIGN KEY (id) REFERENCES single_schedule (id) +); + +/********************************** +Table Name: Routine Schedule Content +**********************************/ +CREATE TABLE routine_schedule_content( + id BIGINT(20) NOT NULL PRIMARY KEY, + content VARCHAR(1000), + FOREIGN KEY (id) REFERENCES routine_schedule (id) +); + Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/SchedulerConstants.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/SchedulerConstants.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/SchedulerConstants.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,9 @@ +package jp.sf.pal.scheduler; + +public class SchedulerConstants { + + public static final String ROLE_AVAILABLE = "features.role"; + + public static final String GROUP_AVAILABLE = "features.group"; + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/SchedulerConstants.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/ConfigAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/ConfigAction.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/ConfigAction.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,78 @@ +package jp.sf.pal.scheduler.action; + +import java.io.Serializable; + +import javax.servlet.http.HttpServletRequest; + +import jp.sf.pal.scheduler.SchedulerConstants; +import jp.sf.pal.scheduler.common.util.ConfigUtil; +import jp.sf.pal.scheduler.common.util.SAStrutsUtil; +import jp.sf.pal.scheduler.form.ConfigForm; + +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.seasar.struts.annotation.ActionForm; +import org.seasar.struts.annotation.Execute; +import org.seasar.struts.exception.ActionMessagesException; + +public class ConfigAction implements Serializable { + + private static final long serialVersionUID = 1L; + + private static final Log log = LogFactory.getLog(ConfigAction.class); + + @ActionForm + private ConfigForm configForm; + + private transient HttpServletRequest request; + + protected String displayIndex() { + configForm.roleAvailable = ConfigUtil.getString( + SchedulerConstants.ROLE_AVAILABLE, "true"); + configForm.groupAvailable = ConfigUtil.getString( + SchedulerConstants.GROUP_AVAILABLE, "true"); + return "index.jsp"; + } + + @Execute(validator = false, input = "index.jsp") + public String index() { + ConfigUtil.init(request); + return displayIndex(); + } + + @Execute(validator = false, input = "index.jsp") + public String update() { + ConfigUtil.init(request); + ConfigUtil.setProperty(SchedulerConstants.ROLE_AVAILABLE, + configForm.roleAvailable); + ConfigUtil.setProperty(SchedulerConstants.GROUP_AVAILABLE, + configForm.groupAvailable); + try { + ConfigUtil.save(); + SAStrutsUtil.addMessage(request, "success.update_config"); + + return displayIndex(); + } catch (ConfigurationException e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException("errors.failed_to_update_config"); + } + } + + public ConfigForm getConfigForm() { + return configForm; + } + + public void setConfigForm(ConfigForm configForm) { + this.configForm = configForm; + } + + public HttpServletRequest getRequest() { + return request; + } + + public void setRequest(HttpServletRequest request) { + this.request = request; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/ConfigAction.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/RoutineScheduleAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/RoutineScheduleAction.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/RoutineScheduleAction.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,424 @@ +package jp.sf.pal.scheduler.action.admin; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import jp.sf.pal.scheduler.common.CommonConstants; +import jp.sf.pal.scheduler.common.dxo.PagerDxo; +import jp.sf.pal.scheduler.common.util.ConfigUtil; +import jp.sf.pal.scheduler.common.util.SAStrutsUtil; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.db.exentity.UserInfo; +import jp.sf.pal.scheduler.dxo.RoutineScheduleDxo; +import jp.sf.pal.scheduler.form.admin.RoutineScheduleForm; +import jp.sf.pal.scheduler.pager.RoutineSchedulePager; +import jp.sf.pal.scheduler.service.RoutineScheduleService; +import jp.sf.pal.scheduler.service.UserInfoService; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.seasar.struts.annotation.ActionForm; +import org.seasar.struts.annotation.Execute; +import org.seasar.struts.exception.ActionMessagesException; + +public class RoutineScheduleAction implements Serializable { + + private static final long serialVersionUID = 1L; + + private static final Log log = LogFactory + .getLog(RoutineScheduleAction.class); + + // for list + + public List<RoutineSchedule> routineScheduleItems; + + // for edit/confirm/delete + + @ActionForm + private RoutineScheduleForm routineScheduleForm; + + private RoutineScheduleService routineScheduleService; + + private UserInfoService userInfoService; + + private RoutineSchedulePager routineSchedulePager; + + private PagerDxo pagerDxo; + + private RoutineScheduleDxo routineScheduleDxo; + + private transient HttpServletRequest request; + + protected String displayList() { + // page navi + routineScheduleItems = routineScheduleService.getRoutineScheduleList( + routineSchedulePager, null); + + // restore from pager + // routineScheduleForm.routineSchedulename = + // routineSchedulePager.getGroupInfoname(); + + return "index.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String index() { + ConfigUtil.init(request); + return displayList(); + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + public String list() { + // page navi + pagerDxo.convert(routineScheduleForm, routineSchedulePager); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String search() { + // routineSchedulePager.setGroupInfoname(routineScheduleForm. + // routineSchedulename); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String reset() { + routineSchedulePager.clear(); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String back() { + // reset edit page + loadListPageParameters(); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String editagain() { + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{mode}/{id}") + public String confirmpage() { + if (routineScheduleForm.mode != CommonConstants.CONFIRM_MODE) { + throw new ActionMessagesException("errors.invalid.mode", + new Object[] { CommonConstants.CONFIRM_MODE, + routineScheduleForm.mode }); + } + + // update edit page + loadDetailsPageParameters(); + + loadRoutineSchedule(); + + return "confirm.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String createpage() { + // page navi + routineScheduleForm.initialize(); + routineScheduleForm.mode = CommonConstants.CREATE_MODE; + + // update edit page + loadDetailsPageParameters(); + + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{mode}/{id}") + public String editpage() { + if (routineScheduleForm.mode != CommonConstants.EDIT_MODE) { + throw new ActionMessagesException("errors.invalid.mode", + new Object[] { CommonConstants.EDIT_MODE, + routineScheduleForm.mode }); + } + + // update edit page + loadDetailsPageParameters(); + + loadRoutineSchedule(); + + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String editpagefromconfirm() { + routineScheduleForm.mode = CommonConstants.EDIT_MODE; + + // update edit page + loadDetailsPageParameters(); + + loadRoutineSchedule(); + + return "edit.jsp"; + } + + @Execute(validator = true, input = "edit.jsp") + public String confirm() { + return "confirm.jsp"; + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{mode}/{id}") + public String deletepage() { + if (routineScheduleForm.mode != CommonConstants.DELETE_MODE) { + throw new ActionMessagesException("errors.invalid.mode", + new Object[] { CommonConstants.DELETE_MODE, + routineScheduleForm.mode }); + } + + // update edit page + loadDetailsPageParameters(); + + loadRoutineSchedule(); + + return "confirm.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String deletepagefromconfirm() { + routineScheduleForm.mode = CommonConstants.DELETE_MODE; + + // update edit page + loadDetailsPageParameters(); + + loadRoutineSchedule(); + + return "confirm.jsp"; + } + + @Execute(validator = true, input = "edit.jsp") + public String create() { + try { + RoutineSchedule routineSchedule = createRoutineSchedule(); + routineScheduleService.store(routineSchedule); + SAStrutsUtil.addMessage(request, "success.create_routineSchedule"); + + // reset edit page + loadListPageParameters(); + + return displayList(); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException( + "errors.failed_to_create_routineSchedule"); + } + } + + @Execute(validator = true, input = "edit.jsp") + public String update() { + try { + RoutineSchedule routineSchedule = createRoutineSchedule(); + routineScheduleService.store(routineSchedule); + SAStrutsUtil.addMessage(request, "success.update_routineSchedule"); + + // reset edit page + loadListPageParameters(); + + return displayList(); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException( + "errors.failed_to_update_routineSchedule"); + } + } + + @Execute(validator = false, input = "error.jsp") + public String delete() { + try { + routineScheduleService + .disable(Long.parseLong(routineScheduleForm.id), request + .getRemoteUser()); + SAStrutsUtil.addMessage(request, "success.delete_routineSchedule"); + + // reset edit page + loadListPageParameters(); + + return displayList(); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException( + "errors.failed_to_delete_routineSchedule"); + } + } + + @Execute(validator = false, input = "error.jsp") + public String selectusers() { + return "userlist.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String setusers() { + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String addusers() { + List<String> userList = new ArrayList<String>(); + if (routineScheduleForm.selectedUsers != null) { + for (String userId : routineScheduleForm.selectedUsers) { + userList.add(userId); + } + } + if (routineScheduleForm.addedUsers != null) { + for (String userId : routineScheduleForm.addedUsers) { + userList.add(userId); + } + } + if (!userList.isEmpty()) { + routineScheduleForm.selectedUsers = userList.toArray(new String[0]); + } else { + routineScheduleForm.selectedUsers = null; + } + return "userlist.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String removeusers() { + List<String> userList = new ArrayList<String>(); + if (routineScheduleForm.selectedUsers != null) { + for (String userId : routineScheduleForm.selectedUsers) { + userList.add(userId); + } + } + if (routineScheduleForm.removedUsers != null) { + for (String userId : routineScheduleForm.removedUsers) { + userList.remove(userId); + } + } + if (!userList.isEmpty()) { + routineScheduleForm.selectedUsers = userList.toArray(new String[0]); + } else { + routineScheduleForm.selectedUsers = null; + } + return "userlist.jsp"; + } + + private void loadRoutineSchedule() { + + RoutineSchedule routineSchedule = routineScheduleService + .getRoutineSchedule(Long.parseLong(routineScheduleForm.id), + null); + if (routineSchedule == null) { + // throw an exception + throw new ActionMessagesException( + "errors.could_not_find_routineSchedule", + new Object[] { routineScheduleForm.id }); + } + routineScheduleDxo.convertFromRoutineScheduleToForm(routineSchedule, + routineScheduleForm); + + routineScheduleForm.selectedUsers = routineSchedule.getSelectedUsers(); + } + + private RoutineSchedule createRoutineSchedule() { + String userId = request.getRemoteUser(); + RoutineSchedule routineSchedule; + if (routineScheduleForm.mode == CommonConstants.EDIT_MODE) { + routineSchedule = routineScheduleService.getRoutineSchedule(Long + .parseLong(routineScheduleForm.id), null); + routineSchedule.setUpdatedBy(userId); + } else { + routineSchedule = new RoutineSchedule(); + routineSchedule.setUpdatedBy(userId); + routineSchedule.setCreatedBy(userId); + } + routineScheduleDxo.convertFromFormToRoutineSchedule( + routineScheduleForm, routineSchedule); + + return routineSchedule; + } + + private void loadListPageParameters() { + } + + private void loadDetailsPageParameters() { + } + + public List<UserInfo> getAvailableUserItems() { + // TODO should not get all user + return userInfoService.getAvailableUserList( + routineScheduleForm.selectedUsers, null); + } + + public List<UserInfo> getSelectedUserItems() { + if (routineScheduleForm.selectedUsers == null) { + return null; + } + return userInfoService + .getSelectedUserList(routineScheduleForm.selectedUsers); + } + + /** + * @return the request + */ + public HttpServletRequest getRequest() { + return request; + } + + /** + * @param request the request to set + */ + public void setRequest(HttpServletRequest request) { + this.request = request; + } + + public RoutineScheduleForm getRoutineScheduleForm() { + return routineScheduleForm; + } + + public void setRoutineScheduleForm(RoutineScheduleForm routineScheduleForm) { + this.routineScheduleForm = routineScheduleForm; + } + + public RoutineScheduleService getRoutineScheduleService() { + return routineScheduleService; + } + + public void setRoutineScheduleService( + RoutineScheduleService routineScheduleService) { + this.routineScheduleService = routineScheduleService; + } + + public RoutineSchedulePager getRoutineSchedulePager() { + return routineSchedulePager; + } + + public void setRoutineSchedulePager( + RoutineSchedulePager routineSchedulePager) { + this.routineSchedulePager = routineSchedulePager; + } + + public PagerDxo getPagerDxo() { + return pagerDxo; + } + + public void setPagerDxo(PagerDxo pagerDxo) { + this.pagerDxo = pagerDxo; + } + + public RoutineScheduleDxo getRoutineScheduleDxo() { + return routineScheduleDxo; + } + + public void setRoutineScheduleDxo(RoutineScheduleDxo routineScheduleDxo) { + this.routineScheduleDxo = routineScheduleDxo; + } + + public UserInfoService getUserInfoService() { + return userInfoService; + } + + public void setUserInfoService(UserInfoService userInfoService) { + this.userInfoService = userInfoService; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/RoutineScheduleAction.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/SingleScheduleAction.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/SingleScheduleAction.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/SingleScheduleAction.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,422 @@ +package jp.sf.pal.scheduler.action.admin; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import jp.sf.pal.scheduler.common.CommonConstants; +import jp.sf.pal.scheduler.common.dxo.PagerDxo; +import jp.sf.pal.scheduler.common.util.ConfigUtil; +import jp.sf.pal.scheduler.common.util.SAStrutsUtil; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.db.exentity.UserInfo; +import jp.sf.pal.scheduler.dxo.SingleScheduleDxo; +import jp.sf.pal.scheduler.form.admin.SingleScheduleForm; +import jp.sf.pal.scheduler.pager.SingleSchedulePager; +import jp.sf.pal.scheduler.service.SingleScheduleService; +import jp.sf.pal.scheduler.service.UserInfoService; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.seasar.struts.annotation.ActionForm; +import org.seasar.struts.annotation.Execute; +import org.seasar.struts.exception.ActionMessagesException; + +public class SingleScheduleAction implements Serializable { + + private static final long serialVersionUID = 1L; + + private static final Log log = LogFactory + .getLog(SingleScheduleAction.class); + + // for list + + public List<SingleSchedule> singleScheduleItems; + + // for edit/confirm/delete + + @ActionForm + private SingleScheduleForm singleScheduleForm; + + private SingleScheduleService singleScheduleService; + + private UserInfoService userInfoService; + + private SingleSchedulePager singleSchedulePager; + + private PagerDxo pagerDxo; + + private SingleScheduleDxo singleScheduleDxo; + + private transient HttpServletRequest request; + + protected String displayList() { + // page navi + singleScheduleItems = singleScheduleService.getSingleScheduleList( + singleSchedulePager, null); + + // restore from pager + // singleScheduleForm.singleSchedulename = + // singleSchedulePager.getGroupInfoname(); + + return "index.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String index() { + ConfigUtil.init(request); + return displayList(); + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}") + public String list() { + // page navi + pagerDxo.convert(singleScheduleForm, singleSchedulePager); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String search() { + // singleSchedulePager.setGroupInfoname(singleScheduleForm. + // singleSchedulename); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String reset() { + singleSchedulePager.clear(); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String back() { + // reset edit page + loadListPageParameters(); + + return displayList(); + } + + @Execute(validator = false, input = "error.jsp") + public String editagain() { + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{mode}/{id}") + public String confirmpage() { + if (singleScheduleForm.mode != CommonConstants.CONFIRM_MODE) { + throw new ActionMessagesException("errors.invalid.mode", + new Object[] { CommonConstants.CONFIRM_MODE, + singleScheduleForm.mode }); + } + + // update edit page + loadDetailsPageParameters(); + + loadSingleSchedule(); + + return "confirm.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String createpage() { + // page navi + singleScheduleForm.initialize(); + singleScheduleForm.mode = CommonConstants.CREATE_MODE; + + // update edit page + loadDetailsPageParameters(); + + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{mode}/{id}") + public String editpage() { + if (singleScheduleForm.mode != CommonConstants.EDIT_MODE) { + throw new ActionMessagesException("errors.invalid.mode", + new Object[] { CommonConstants.EDIT_MODE, + singleScheduleForm.mode }); + } + + // update edit page + loadDetailsPageParameters(); + + loadSingleSchedule(); + + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String editpagefromconfirm() { + singleScheduleForm.mode = CommonConstants.EDIT_MODE; + + // update edit page + loadDetailsPageParameters(); + + loadSingleSchedule(); + + return "edit.jsp"; + } + + @Execute(validator = true, input = "edit.jsp") + public String confirm() { + return "confirm.jsp"; + } + + @Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{mode}/{id}") + public String deletepage() { + if (singleScheduleForm.mode != CommonConstants.DELETE_MODE) { + throw new ActionMessagesException("errors.invalid.mode", + new Object[] { CommonConstants.DELETE_MODE, + singleScheduleForm.mode }); + } + + // update edit page + loadDetailsPageParameters(); + + loadSingleSchedule(); + + return "confirm.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String deletepagefromconfirm() { + singleScheduleForm.mode = CommonConstants.DELETE_MODE; + + // update edit page + loadDetailsPageParameters(); + + loadSingleSchedule(); + + return "confirm.jsp"; + } + + @Execute(validator = true, input = "edit.jsp") + public String create() { + try { + SingleSchedule singleSchedule = createSingleSchedule(); + singleScheduleService.store(singleSchedule); + SAStrutsUtil.addMessage(request, "success.create_singleSchedule"); + + // reset edit page + loadListPageParameters(); + + return displayList(); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException( + "errors.failed_to_create_singleSchedule"); + } + } + + @Execute(validator = true, input = "edit.jsp") + public String update() { + try { + SingleSchedule singleSchedule = createSingleSchedule(); + singleScheduleService.store(singleSchedule); + SAStrutsUtil.addMessage(request, "success.update_singleSchedule"); + + // reset edit page + loadListPageParameters(); + + return displayList(); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException( + "errors.failed_to_update_singleSchedule"); + } + } + + @Execute(validator = false, input = "error.jsp") + public String delete() { + try { + singleScheduleService.disable( + Long.parseLong(singleScheduleForm.id), request + .getRemoteUser()); + SAStrutsUtil.addMessage(request, "success.delete_singleSchedule"); + + // reset edit page + loadListPageParameters(); + + return displayList(); + } catch (Exception e) { + log.error(e.getMessage(), e); + throw new ActionMessagesException( + "errors.failed_to_delete_singleSchedule"); + } + } + + @Execute(validator = false, input = "error.jsp") + public String selectusers() { + return "userlist.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String setusers() { + return "edit.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String addusers() { + List<String> userList = new ArrayList<String>(); + if (singleScheduleForm.selectedUsers != null) { + for (String userId : singleScheduleForm.selectedUsers) { + userList.add(userId); + } + } + if (singleScheduleForm.addedUsers != null) { + for (String userId : singleScheduleForm.addedUsers) { + userList.add(userId); + } + } + if (!userList.isEmpty()) { + singleScheduleForm.selectedUsers = userList.toArray(new String[0]); + } else { + singleScheduleForm.selectedUsers = null; + } + return "userlist.jsp"; + } + + @Execute(validator = false, input = "error.jsp") + public String removeusers() { + List<String> userList = new ArrayList<String>(); + if (singleScheduleForm.selectedUsers != null) { + for (String userId : singleScheduleForm.selectedUsers) { + userList.add(userId); + } + } + if (singleScheduleForm.removedUsers != null) { + for (String userId : singleScheduleForm.removedUsers) { + userList.remove(userId); + } + } + if (!userList.isEmpty()) { + singleScheduleForm.selectedUsers = userList.toArray(new String[0]); + } else { + singleScheduleForm.selectedUsers = null; + } + return "userlist.jsp"; + } + + private void loadSingleSchedule() { + + SingleSchedule singleSchedule = singleScheduleService + .getSingleSchedule(Long.parseLong(singleScheduleForm.id), null); + if (singleSchedule == null) { + // throw an exception + throw new ActionMessagesException( + "errors.could_not_find_singleSchedule", + new Object[] { singleScheduleForm.id }); + } + singleScheduleDxo.convertFromSingleScheduleToForm(singleSchedule, + singleScheduleForm); + + singleScheduleForm.selectedUsers = singleSchedule.getSelectedUsers(); + } + + private SingleSchedule createSingleSchedule() { + String userId = request.getRemoteUser(); + SingleSchedule singleSchedule; + if (singleScheduleForm.mode == CommonConstants.EDIT_MODE) { + singleSchedule = singleScheduleService.getSingleSchedule(Long + .parseLong(singleScheduleForm.id), null); + singleSchedule.setUpdatedBy(userId); + } else { + singleSchedule = new SingleSchedule(); + singleSchedule.setUpdatedBy(userId); + singleSchedule.setCreatedBy(userId); + } + singleScheduleDxo.convertFromFormToSingleSchedule(singleScheduleForm, + singleSchedule); + + return singleSchedule; + } + + private void loadListPageParameters() { + } + + private void loadDetailsPageParameters() { + } + + public List<UserInfo> getAvailableUserItems() { + // TODO should not get all user + return userInfoService.getAvailableUserList( + singleScheduleForm.selectedUsers, null); + } + + public List<UserInfo> getSelectedUserItems() { + if (singleScheduleForm.selectedUsers == null) { + return null; + } + return userInfoService + .getSelectedUserList(singleScheduleForm.selectedUsers); + } + + /** + * @return the request + */ + public HttpServletRequest getRequest() { + return request; + } + + /** + * @param request the request to set + */ + public void setRequest(HttpServletRequest request) { + this.request = request; + } + + public SingleScheduleForm getSingleScheduleForm() { + return singleScheduleForm; + } + + public void setSingleScheduleForm(SingleScheduleForm singleScheduleForm) { + this.singleScheduleForm = singleScheduleForm; + } + + public SingleScheduleService getSingleScheduleService() { + return singleScheduleService; + } + + public void setSingleScheduleService( + SingleScheduleService singleScheduleService) { + this.singleScheduleService = singleScheduleService; + } + + public SingleSchedulePager getSingleSchedulePager() { + return singleSchedulePager; + } + + public void setSingleSchedulePager(SingleSchedulePager singleSchedulePager) { + this.singleSchedulePager = singleSchedulePager; + } + + public PagerDxo getPagerDxo() { + return pagerDxo; + } + + public void setPagerDxo(PagerDxo pagerDxo) { + this.pagerDxo = pagerDxo; + } + + public SingleScheduleDxo getSingleScheduleDxo() { + return singleScheduleDxo; + } + + public void setSingleScheduleDxo(SingleScheduleDxo singleScheduleDxo) { + this.singleScheduleDxo = singleScheduleDxo; + } + + public UserInfoService getUserInfoService() { + return userInfoService; + } + + public void setUserInfoService(UserInfoService userInfoService) { + this.userInfoService = userInfoService; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/action/admin/SingleScheduleAction.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonConstants.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonConstants.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonConstants.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.common; + +public class CommonConstants { + public static final int LIST_MODE = 0; + + public static final int CREATE_MODE = 1; + + public static final int EDIT_MODE = 2; + + public static final int DELETE_MODE = 3; + + public static final int CONFIRM_MODE = 4; + + public static final String TIMESTAMP_PATTERN = "yyyy/MM/dd HH:mm:ss"; + + public static final String TRUE = "T"; + + public static final String FALSE = "F"; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonConstants.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law + * or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package jp.sf.pal.scheduler.common; + +/** + * @author shinsuke + */ +public class CommonException extends Exception { + + /** + * Serial Version UID + */ + private static final long serialVersionUID = 4564000116499132363L; + + private String messageId; + + private Object[] args; + + /** + * @return Returns the messageId. + */ + public String getMessageId() { + return messageId; + } + + /** + * @param messageId The messageId to set. + */ + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + /** + * @return Returns the args. + */ + public Object[] getArgs() { + return args; + } + + /** + * @param args The args to set. + */ + public void setArgs(Object[] args) { + this.args = args; + } + + public CommonException(String messageId) { + super(messageId); + this.messageId = messageId; + } + + public CommonException(String messageId, Object[] args) { + super(messageId); + this.messageId = messageId; + this.args = args; + } + + public CommonException(String messageId, String message, Throwable cause) { + super(message, cause); + this.messageId = messageId; + } + + public CommonException(String messageId, Object[] args, String message, + Throwable cause) { + super(message, cause); + this.messageId = messageId; + this.args = args; + } + + public CommonException(String messageId, String message) { + super(message); + this.messageId = messageId; + } + + public CommonException(String messageId, Object[] args, String message) { + super(message); + this.messageId = messageId; + this.args = args; + } + + public CommonException(String messageId, Throwable cause) { + super(cause); + this.messageId = messageId; + } + + public CommonException(String messageId, Object[] args, Throwable cause) { + super(cause); + this.messageId = messageId; + this.args = args; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/CommonException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/creator/PagerCreator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/creator/PagerCreator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/creator/PagerCreator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,29 @@ +package jp.sf.pal.scheduler.common.creator; + +import org.seasar.framework.container.ComponentCustomizer; +import org.seasar.framework.container.assembler.AutoBindingDefFactory; +import org.seasar.framework.container.creator.ComponentCreatorImpl; +import org.seasar.framework.container.deployer.InstanceDefFactory; +import org.seasar.framework.convention.NamingConvention; + +/** + * @author shinsuke + */ +public class PagerCreator extends ComponentCreatorImpl { + public static final String SUFFIX = "Pager"; + + public PagerCreator(NamingConvention namingConvention) { + super(namingConvention); + setNameSuffix(SUFFIX); + setInstanceDef(InstanceDefFactory.SESSION); + setAutoBindingDef(AutoBindingDefFactory.NONE); + } + + public ComponentCustomizer getPagerCustomizer() { + return getCustomizer(); + } + + public void setPagerCustomizer(ComponentCustomizer customizer) { + setCustomizer(customizer); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/creator/PagerCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/dxo/PagerDxo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/dxo/PagerDxo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/dxo/PagerDxo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,24 @@ +package jp.sf.pal.scheduler.common.dxo; + +import java.io.Serializable; + +import jp.sf.pal.scheduler.common.form.PagingResultForm; +import jp.sf.pal.scheduler.common.pager.DefaultPager; +import jp.sf.pal.scheduler.common.util.PagingResultBeanWrapper; + +import org.seasar.extension.dxo.annotation.ConversionRule; +import org.seasar.extension.dxo.annotation.ExcludeNull; + +public interface PagerDxo extends Serializable { + + @ConversionRule("allRecordCount : allRecordCount" + ",pageSize : pageSize" + + ",currentPageNumber : currentPageNumber" + + ",allPageCount : allPageCount" + ",existPrePage : existPrePage" + + ",existNextPage : existNextPage") + public void convert(PagingResultBeanWrapper result, DefaultPager pager); + + @ExcludeNull + @ConversionRule(// "pageSize : pageSize, " + + "currentPageNumber : pageNumber") + public void convert(PagingResultForm page, DefaultPager pager); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/dxo/PagerDxo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/form/PagingResultForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/form/PagingResultForm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/form/PagingResultForm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ +package jp.sf.pal.scheduler.common.form; + +public interface PagingResultForm { + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/form/PagingResultForm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/pager/DefaultPager.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/pager/DefaultPager.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/pager/DefaultPager.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,101 @@ +package jp.sf.pal.scheduler.common.pager; + +import java.io.Serializable; +import java.util.List; + +public abstract class DefaultPager implements Serializable { + private static final long serialVersionUID = 1L; + + public static final int DEFAULT_PAGE_SIZE = 50; + + public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1; + + private int allRecordCount; + + private int allPageCount; + + private boolean existPrePage; + + private boolean existNextPage; + + private List<Integer> pageNumberList; + + private int pageSize; + + private int currentPageNumber; + + public void clear() { + pageSize = getDefaultPageSize(); + currentPageNumber = getDefaultCurrentPageNumber(); + } + + protected int getDefaultPageSize() { + return DEFAULT_PAGE_SIZE; + } + + protected int getDefaultCurrentPageNumber() { + return DEFAULT_CURRENT_PAGE_NUMBER; + } + + public int getAllRecordCount() { + return allRecordCount; + } + + public void setAllRecordCount(int allRecordCount) { + this.allRecordCount = allRecordCount; + } + + public int getAllPageCount() { + return allPageCount; + } + + public void setAllPageCount(int allPageCount) { + this.allPageCount = allPageCount; + } + + public boolean isExistPrePage() { + return existPrePage; + } + + public void setExistPrePage(boolean existPrePage) { + this.existPrePage = existPrePage; + } + + public boolean isExistNextPage() { + return existNextPage; + } + + public void setExistNextPage(boolean existNextPage) { + this.existNextPage = existNextPage; + } + + public int getPageSize() { + if (pageSize <= 0) { + pageSize = getDefaultPageSize(); + } + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getCurrentPageNumber() { + if (currentPageNumber <= 0) { + currentPageNumber = getDefaultCurrentPageNumber(); + } + return currentPageNumber; + } + + public void setCurrentPageNumber(int currentPageNumber) { + this.currentPageNumber = currentPageNumber; + } + + public List<Integer> getPageNumberList() { + return pageNumberList; + } + + public void setPageNumberList(List<Integer> pageNumberList) { + this.pageNumberList = pageNumberList; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/pager/DefaultPager.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/ConfigUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/ConfigUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/ConfigUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,207 @@ +package jp.sf.pal.scheduler.common.util; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.XMLConfiguration; + +public class ConfigUtil { + + public static final String CONFIG_PATH = "/WEB-INF/scheduler.xml"; + + private static XMLConfiguration config; + + public static void init(HttpServletRequest request) { + if (config == null) { + synchronized (ConfigUtil.class) { + if (config == null) { + try { + config = new XMLConfiguration(SAStrutsUtil.getRealPath( + request, CONFIG_PATH)); + } catch (ConfigurationException e) { + throw new IllegalStateException( + "Could not load a config file: " + + SAStrutsUtil.getRealPath(request, + CONFIG_PATH), e); + } + } + } + } + } + + public static void save() throws ConfigurationException { + config.save(); + } + + public static void addProperty(String s, Object obj) { + config.addProperty(s, obj); + } + + public static void clear() { + config.clear(); + } + + public static void clearProperty(String s) { + config.clearProperty(s); + } + + public static boolean containsKey(String s) { + return config.containsKey(s); + } + + public static BigDecimal getBigDecimal(String s, BigDecimal bigdecimal) { + return config.getBigDecimal(s, bigdecimal); + } + + public static BigDecimal getBigDecimal(String s) { + return config.getBigDecimal(s); + } + + public static BigInteger getBigInteger(String s, BigInteger biginteger) { + return config.getBigInteger(s, biginteger); + } + + public static BigInteger getBigInteger(String s) { + return config.getBigInteger(s); + } + + public static boolean getBoolean(String s, boolean flag) { + return config.getBoolean(s, flag); + } + + public static Boolean getBoolean(String s, Boolean boolean1) { + return config.getBoolean(s, boolean1); + } + + public static boolean getBoolean(String s) { + return config.getBoolean(s); + } + + public static byte getByte(String s, byte byte0) { + return config.getByte(s, byte0); + } + + public static Byte getByte(String s, Byte byte1) { + return config.getByte(s, byte1); + } + + public static byte getByte(String s) { + return config.getByte(s); + } + + public static double getDouble(String s, double d) { + return config.getDouble(s, d); + } + + public static Double getDouble(String s, Double double1) { + return config.getDouble(s, double1); + } + + public static double getDouble(String s) { + return config.getDouble(s); + } + + public static float getFloat(String s, float f) { + return config.getFloat(s, f); + } + + public static Float getFloat(String s, Float float1) { + return config.getFloat(s, float1); + } + + public static float getFloat(String s) { + return config.getFloat(s); + } + + public static int getInt(String s, int i) { + return config.getInt(s, i); + } + + public static int getInt(String s) { + return config.getInt(s); + } + + public static Integer getInteger(String s, Integer integer) { + return config.getInteger(s, integer); + } + + public static Iterator getKeys() { + return config.getKeys(); + } + + public static Iterator getKeys(String s) { + return config.getKeys(s); + } + + public static List getList(String s, List list) { + return config.getList(s, list); + } + + public static List getList(String s) { + return config.getList(s); + } + + public static long getLong(String s, long l) { + return config.getLong(s, l); + } + + public static Long getLong(String s, Long long1) { + return config.getLong(s, long1); + } + + public static long getLong(String s) { + return config.getLong(s); + } + + public static Properties getProperties(String s) { + return config.getProperties(s); + } + + public static Object getProperty(String s) { + return config.getProperty(s); + } + + public static short getShort(String s, short word0) { + return config.getShort(s, word0); + } + + public static Short getShort(String s, Short short1) { + return config.getShort(s, short1); + } + + public static short getShort(String s) { + return config.getShort(s); + } + + public static String getString(String s, String s1) { + return config.getString(s, s1); + } + + public static String getString(String s) { + return config.getString(s); + } + + public static String[] getStringArray(String s) { + return config.getStringArray(s); + } + + public static boolean isEmpty() { + return config.isEmpty(); + } + + public static void setProperty(String s, Object obj) { + config.setProperty(s, obj); + } + + public static Configuration subset(String s) { + return config.subset(s); + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/ConfigUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/DateUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/DateUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/DateUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,251 @@ +/* + * Copyright 2004-2007 The Portal Application Laboratory Team. Licensed under + * the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License + * at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable + * law or agreed to in writing, software distributed under the License is + * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package jp.sf.pal.scheduler.common.util; + +import java.util.Calendar; +import java.util.Date; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class DateUtil { + /** + * Logger for this class + */ + private static final Log log = LogFactory.getLog(DateUtil.class); + + /** + * Allocates a Date object and initializes it so that it represents + * midnight, local time, at the beginning of the day specified by the year, + * month, and date arguments. + * + * @param year + * @param month + * @param date + * @return + */ + public static Date get(int year, int month, int date) { + if (log.isDebugEnabled()) { + log.debug("get(int, int, int) - : year=" + year + ", month=" + + month + ", date=" + date); + } + + return get(year, month, date, 0, 0); + } + + /** + * Allocates a Date object and initializes it so that it represents the + * instant at the start of the minute specified by the year, month, date, + * hrs, and min arguments, in the local time zone. + * + * @param year + * @param month + * @param date + * @param hrs + * @param min + * @return + */ + public static Date get(int year, int month, int date, int hrs, int min) { + if (log.isDebugEnabled()) { + log.debug("get(int, int, int, int, int) - : year=" + year + + ", month=" + month + ", date=" + date + ", hrs=" + hrs + + ", min=" + min); + } + + return get(year, month, date, hrs, min, 0); + } + + /** + * Allocates a Date object and initializes it so that it represents the + * instant at the start of the second specified by the year, month, date, + * hrs, min, and sec arguments, in the local time zone. + * + * @param year + * @param month + * @param date + * @param hrs + * @param min + * @param sec + * @return + */ + public static Date get(int year, int month, int date, int hrs, int min, + int sec) { + if (log.isDebugEnabled()) { + log.debug("get(int, int, int, int, int, int) - : year=" + year + + ", month=" + month + ", date=" + date + ", hrs=" + hrs + + ", min=" + min + ", sec=" + sec); + } + + return get(year, month, date, hrs, min, sec, 0); + + } + + /** + * Allocates a Date object and initializes it so that it represents the + * instant at the start of the second specified by the year, month, date, + * hrs, min, sec and millisec arguments, in the local time zone. + * + * @param year + * @param month + * @param date + * @param hrs + * @param min + * @param sec + * @param millisec + * @return + */ + public static Date get(int year, int month, int date, int hrs, int min, + int sec, int millisec) { + if (log.isDebugEnabled()) { + log.debug("get(int, int, int, int, int, int) - : year=" + year + + ", month=" + month + ", date=" + date + ", hrs=" + hrs + + ", min=" + min + ", sec=" + sec + ", millisec=" + + millisec); + } + + Calendar cal = Calendar.getInstance(); + cal.set(year + 1900, month, date, hrs, min, sec); + cal.set(Calendar.MILLISECOND, millisec); + return cal.getTime(); + + } + + /** + * Returns a value that is the result of subtracting 1900 from the year that + * contains or begins with the instant in time represented by this Date + * object, as interpreted in the local time zone. + * + * @param d + * @return + */ + public static int getYear(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.YEAR) - 1900; + } + + /** + * Returns a number representing the month that contains or begins with the + * instant in time represented by this Date object. The value returned is + * between 0 and 11, with the value 0 representing January. + * + * @param d + * @return + */ + public static int getMonth(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.MONTH); + } + + /** + * Returns the day of the month represented by this Date object. The value + * returned is between 1 and 31 representing the day of the month that + * contains or begins with the instant in time represented by this Date + * object, as interpreted in the local time zone. + * + * @param d + * @return + */ + public static int getDate(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.DAY_OF_MONTH); + } + + /** + * Returns the day of the week represented by this date. The returned value + * (0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = + * Friday, 6 = Saturday) represents the day of the week that contains or + * begins with the instant in time represented by this Date object, as + * interpreted in the local time zone. + * + * @param d + * @return + */ + public static int getDay(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.DAY_OF_WEEK) - 1; + } + + /** + * Returns the hour represented by this Date object. The returned value is a + * number (0 through 23) representing the hour within the day that contains + * or begins with the instant in time represented by this Date object, as + * interpreted in the local time zone. + * + * @param d + * @return + */ + public static int getHours(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.HOUR_OF_DAY); + } + + /** + * Returns the number of minutes past the hour represented by this date, as + * interpreted in the local time zone. The value returned is between 0 and + * 59. + * + * @param d + * @return + */ + public static int getMinutes(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.MINUTE); + } + + /** + * Returns the number of seconds past the minute represented by this date. + * The value returned is between 0 and 61. The values 60 and 61 can only + * occur on those Java Virtual Machines that take leap seconds into account. + * + * @param d + * @return + */ + public static int getSeconds(Date d) { + Calendar cal = Calendar.getInstance(); + cal.setTime(d); + return cal.get(Calendar.SECOND); + } + + public static Integer calculateAge(Date date) { + if (date == null) { + return null; + } + Date now = Calendar.getInstance().getTime(); + int age = DateUtil.getYear(now) - DateUtil.getYear(date); + if (age > 0) { + if (DateUtil.getMonth(now) < DateUtil.getMonth(date)) { + if (DateUtil.getDate(now) < DateUtil.getDate(date)) { + age--; + } + } + return new Integer(age); + } + return null; + } + + public static Date calculateDate(Integer age) { + if (age == null) { + return null; + } + Date now = Calendar.getInstance().getTime(); + int year = DateUtil.getYear(now) - age.intValue(); + + return DateUtil.get(year, DateUtil.getMonth(now), + DateUtil.getDate(now), 0, 0, 0, 0); + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/DateUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/PagingResultBeanWrapper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/PagingResultBeanWrapper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/PagingResultBeanWrapper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,68 @@ +package jp.sf.pal.scheduler.common.util; + +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; + +public class PagingResultBeanWrapper { + private PagingResultBean<?> pagingResultBean; + + public PagingResultBeanWrapper(PagingResultBean<?> pagingResultBean) { + this.pagingResultBean = pagingResultBean; + } + + public PagingResultBean<?> getPagingResultBean() { + return pagingResultBean; + } + + public void setPagingResultBean(PagingResultBean<?> pagingResultBean) { + this.pagingResultBean = pagingResultBean; + } + + public int getAllRecordCount() { + return pagingResultBean.getAllRecordCount(); + } + + public void setAllRecordCount(int allRecordCount) { + pagingResultBean.setAllRecordCount(allRecordCount); + } + + public int getPageSize() { + return pagingResultBean.getPageSize(); + } + + public void setPageSize(int pageSize) { + pagingResultBean.setPageSize(pageSize); + } + + public int getCurrentPageNumber() { + return pagingResultBean.getCurrentPageNumber(); + } + + public void setCurrentPageNumber(int currentPageNumber) { + pagingResultBean.setCurrentPageNumber(currentPageNumber); + } + + public int getAllPageCount() { + return pagingResultBean.getAllPageCount(); + } + + public void setAllPageCount(int allPageCount) { + // nothing + } + + public boolean isExistPrePage() { + return pagingResultBean.isExistPrePage(); + } + + public void setExistPrePage(boolean existPrePage) { + // nothing + } + + public boolean isExistNextPage() { + return pagingResultBean.isExistNextPage(); + } + + public void setExistNextPage(boolean existNextPage) { + // nothing + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/PagingResultBeanWrapper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/SAStrutsUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/SAStrutsUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/SAStrutsUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,76 @@ +package jp.sf.pal.scheduler.common.util; + +import javax.portlet.PortletConfig; +import javax.portlet.PortletContext; +import javax.portlet.PortletRequest; +import javax.portlet.PortletSession; +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.seasar.struts.portlet.util.PortletUtil; +import org.seasar.struts.util.ActionMessagesUtil; + +public class SAStrutsUtil { + + public static void addMessage(HttpServletRequest request, String key) { + ActionMessages msgs = new ActionMessages(); + msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(key)); + ActionMessagesUtil.saveMessages(request, msgs); + } + + public static PortletRequest getPortletRequest(HttpServletRequest request) { + PortletRequest portletRequest = (PortletRequest) request + .getAttribute(PortletUtil.PORTLET_REQUEST); + if (portletRequest != null) { + return portletRequest; + } + return null; + } + + public static PortletConfig getPortletConfig(HttpServletRequest request) { + PortletConfig portletConfig = (PortletConfig) request + .getAttribute(PortletUtil.PORTLET_CONFIG); + if (portletConfig != null) { + return portletConfig; + } + return null; + } + + public static PortletContext getPortletContext(HttpServletRequest request) { + PortletConfig portletConfig = (PortletConfig) request + .getAttribute(PortletUtil.PORTLET_CONFIG); + if (portletConfig != null) { + return portletConfig.getPortletContext(); + } + return null; + } + + public static String getRealPath(HttpServletRequest request, String path) { + PortletContext portletContext = getPortletContext(request); + if (portletContext != null) { + return portletContext.getRealPath(path); + } + return path; + } + + public static String getRequestParameter(HttpServletRequest request, + String key) { + PortletRequest portletRequest = (PortletRequest) request + .getAttribute(PortletUtil.PORTLET_REQUEST); + if (portletRequest != null) { + return portletRequest.getParameter(key); + } + return null; + } + + public static PortletSession getPortletSession(HttpServletRequest request) { + PortletRequest portletRequest = (PortletRequest) request + .getAttribute(PortletUtil.PORTLET_REQUEST); + if (portletRequest != null) { + return portletRequest.getPortletSession(); + } + return null; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/common/util/SAStrutsUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/AccessContext.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/AccessContext.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/AccessContext.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,315 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import java.util.HashMap; +import java.util.Map; + +/** + * The context of DB access. + * + * @author DBFlute(AutoGenerator) + */ +public class AccessContext { + + //========================================================================== + // ========= + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal<AccessContext> _threadLocal = new ThreadLocal<AccessContext>(); + + /** + * Get access-context on thread. + * + * @return The context of DB access.. (Nullable) + */ + public static AccessContext getAccessContextOnThread() { + return (AccessContext) _threadLocal.get(); + } + + /** + * Set access-context on thread. + * + * @param accessContext The context of DB access.. (NotNull) + */ + public static void setAccessContextOnThread(AccessContext accessContext) { + if (accessContext == null) { + String msg = "The argument[accessContext] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(accessContext); + } + + /** + * Is existing access-context on thread? + * + * @return Determination. + */ + public static boolean isExistAccessContextOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear access-context on thread. + */ + public static void clearAccessContextOnThread() { + _threadLocal.set(null); + } + + //========================================================================== + // ========= + // Access Information + // ================== + /** + * Get access user on thread. + * <p> + * If it can't get access user from access-context, returns 'Anonymous' as + * default value! + * </p> + * + * @return Access user. (NotNull) + */ + public static String getAccessUserOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final String accessUser = userContextOnThread.getAccessUser(); + if (accessUser != null) { + return accessUser; + } + } + return "Anonymous";// as Default + } + + /** + * Get access process on thread. + * <p> + * If it can't get access process from access-context, returns 'Anonymous' + * as default value! + * </p> + * + * @return Access process. (NotNull) + */ + public static String getAccessProcessOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final String accessProcess = userContextOnThread.getAccessProcess(); + if (accessProcess != null) { + return accessProcess; + } + } + return "Anonymous";// as Default + } + + /** + * Get access module on thread. + * <p> + * If it can't get access module from access-context, returns 'Anonymous' as + * default value! + * </p> + * + * @return Access module. (NotNull) + */ + public static String getAccessModuleOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final String accessModule = userContextOnThread.getAccessModule(); + if (accessModule != null) { + return accessModule; + } + } + return "Anonymous";// as Default + } + + /** + * Get access date on thread. + * <p> + * If it can't get access date from access-context, returns application + * current time as default value! + * </p> + * + * @return Access date. (NotNull) + */ + public static java.util.Date getAccessDateOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final java.util.Date accessDate = userContextOnThread + .getAccessDate(); + if (accessDate != null) { + return accessDate; + } + if (userContextOnThread.getAccessDateProvider() != null) { + return userContextOnThread.getAccessDateProvider() + .getAccessDate(); + } + } + return new java.util.Date();// as Default + } + + /** + * Get access timestamp on thread. + * <p> + * If it can't get access timestamp from access-context, returns application + * current time as default value! + * </p> + * + * @return Access timestamp. (NotNull) + */ + public static java.sql.Timestamp getAccessTimestampOnThread() { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final java.sql.Timestamp accessTimestamp = userContextOnThread + .getAccessTimestamp(); + if (accessTimestamp != null) { + return accessTimestamp; + } + if (userContextOnThread.getAccessTimestampProvider() != null) { + return userContextOnThread.getAccessTimestampProvider() + .getAccessTimestamp(); + } + } + return new java.sql.Timestamp(System.currentTimeMillis());// as Default + } + + /** + * Get access value on thread. + * <p> + * If it can't get access value from access-context, returns null as default + * value! + * </p> + * + * @param key Key. (NotNull) + * @return Access value. (Nullable) + */ + public static Object getAccessValueOnThread(String key) { + if (isExistAccessContextOnThread()) { + final AccessContext userContextOnThread = getAccessContextOnThread(); + final Map<String, Object> accessValueMap = userContextOnThread + .getAccessValueMap(); + if (accessValueMap != null) { + return accessValueMap.get(key); + } + } + return null;// as Default + } + + //========================================================================== + // ========= + // Attribute + // ========= + protected String accessUser; + + protected String accessProcess; + + protected String accessModule; + + protected java.util.Date accessDate; + + protected AccessDateProvider accessDateProvider; + + protected java.sql.Timestamp accessTimestamp; + + protected AccessTimestampProvider accessTimestampProvider; + + protected Map<String, Object> accessValueMap; + + //========================================================================== + // ========= + // Accessor + // ======== + public String getAccessUser() { + return accessUser; + } + + public void setAccessUser(String accessUser) { + this.accessUser = accessUser; + } + + public String getAccessProcess() { + return accessProcess; + } + + public void setAccessProcess(String accessProcess) { + this.accessProcess = accessProcess; + } + + public String getAccessModule() { + return accessModule; + } + + public void setAccessModule(String accessModule) { + this.accessModule = accessModule; + } + + public java.util.Date getAccessDate() { + return accessDate; + } + + public void setAccessDate(java.util.Date accessDate) { + this.accessDate = accessDate; + } + + public AccessDateProvider getAccessDateProvider() { + return accessDateProvider; + } + + public void setAccessDateProvider(AccessDateProvider accessDateProvider) { + this.accessDateProvider = accessDateProvider; + } + + public java.sql.Timestamp getAccessTimestamp() { + return accessTimestamp; + } + + public void setAccessTimestamp(java.sql.Timestamp accessTimestamp) { + this.accessTimestamp = accessTimestamp; + } + + public AccessTimestampProvider getAccessTimestampProvider() { + return accessTimestampProvider; + } + + public void setAccessTimestampProvider( + AccessTimestampProvider accessTimestampProvider) { + this.accessTimestampProvider = accessTimestampProvider; + } + + public Map<String, Object> getAccessValueMap() { + return accessValueMap; + } + + public void registerAccessValue(String key, Object value) { + if (accessValueMap == null) { + accessValueMap = new HashMap<String, Object>(); + } + accessValueMap.put(key, value); + } + + //========================================================================== + // ========= + // Provider Interface + // ================== + /** + * The provider interface of access date. + */ + public static interface AccessDateProvider { + + /** + * Get access date. + * + * @return Access date. (NotNull) + */ + public java.util.Date getAccessDate(); + } + + /** + * The provider interface of access date. + */ + public static interface AccessTimestampProvider { + + /** + * Get access timestamp. + * + * @return Access timestamp. (NotNull) + */ + public java.sql.Timestamp getAccessTimestamp(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/AccessContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,110 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import jp.sf.pal.scheduler.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); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BFinder.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,35 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import jp.sf.pal.scheduler.db.allcommon.bhv.BehaviorReadable; + +/** + * The interface of behavior-selector. + * + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorSelector { + + /** + * Initialize condition-bean meta data. <br /> If you call this, Hot Deploy + * of OutsideSql becomes Cool! + */ + public void initializeConditionBeanMetaData(); + + /** + * Select behavior. + * + * @param <BEHAVIOR> The type of behavior. + * @param behaviorType Behavior type. (NotNull) + * @return Behavior. (NotNull) + */ + public <BEHAVIOR extends BehaviorReadable> BEHAVIOR select( + Class<BEHAVIOR> behaviorType); + + /** + * Select behavior-readable. + * + * @param tableFlexibleName Table flexible-name. (NotNull) + * @return Behavior-readable. (NotNull) + */ + public BehaviorReadable byName(String tableFlexibleName); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/BehaviorSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheAbstractSelector.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheAbstractSelector.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheAbstractSelector.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,115 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import org.seasar.framework.container.ComponentNotFoundRuntimeException; +import org.seasar.framework.container.S2Container; + +/** + * The abstract class of cache-selector. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class CacheAbstractSelector { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The container of Seasar. */ + protected S2Container _container; + + //========================================================================== + // ========= + // Component + // ========= + public <COMPONENT> COMPONENT getComponent(Class<COMPONENT> componentType) { + assertObjectNotNull("componentType", componentType); + assertObjectNotNull("_container", _container); + try { + return (COMPONENT) _container.getComponent(componentType); + } catch (ComponentNotFoundRuntimeException e) { // Normally it doesn't + // come. + final COMPONENT component; + try { + // for HotDeploy Mode + component = (COMPONENT) _container.getRoot().getComponent( + componentType); + } catch (ComponentNotFoundRuntimeException ignored) { + throw e; + } + _container = _container.getRoot(); // Change container. + return component; + } + } + + //========================================================================== + // ========= + // Destroy + // ======= + public void destroy() { + _container = null; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected String initUncap(String str) { + return str.substring(0, 1).toLowerCase() + str.substring(1); + } + + //========================================================================== + // ========= + // Assert + // ====== + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setContainer(S2Container container) { + this._container = container; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheAbstractSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheBehaviorSelector.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheBehaviorSelector.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheBehaviorSelector.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,131 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.bhv.BehaviorReadable; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.util.TraceViewUtil; + +/** + * The implementation of behavior-selector. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class CacheBehaviorSelector extends CacheAbstractSelector implements + BehaviorSelector { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log-instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(CacheBehaviorSelector.class); + + //========================================================================== + // ========= + // Attribute + // ========= + /** The cache of behavior. (It's the generic hell!) */ + protected Map<Class<? extends BehaviorReadable>, BehaviorReadable> _behaviorCache = new LinkedHashMap<Class<? extends BehaviorReadable>, BehaviorReadable>(); + + //========================================================================== + // ========= + // Initialize + // ========== + /** + * Initialize condition-bean meta data. <br /> If you call this, Hot Deploy + * of OutsideSql becomes Cool! + */ + public void initializeConditionBeanMetaData() { + final Map<String, DBMeta> dbmetaMap = DBMetaInstanceHandler + .getDBMetaMap(); + final Collection<DBMeta> dbmetas = dbmetaMap.values(); + long before = 0; + if (_log.isInfoEnabled()) { + before = System.currentTimeMillis(); + _log + .info("/= = = = = = = = = = = = = = = = = initializeConditionBeanMetaData()"); + } + for (DBMeta dbmeta : dbmetas) { + final BehaviorReadable bhv = byName(dbmeta.getTableDbName()); + final DaoReadable dao = bhv.getDaoReadable(); + dao.initializeDaoMetaData("selectList"); + } + if (_log.isInfoEnabled()) { + long after = System.currentTimeMillis(); + _log.info("Initialized Count: " + dbmetas.size()); + _log.info("= = = = = = = = = =/ [" + + TraceViewUtil.convertToPerformanceView(after - before) + + "]"); + } + } + + //========================================================================== + // ========= + // Selector + // ======== + /** + * Select behavior. + * + * @param <BEHAVIOR> The type of behavior. + * @param behaviorType Behavior type. (NotNull) + * @return Behavior. (NotNull) + */ + public <BEHAVIOR extends BehaviorReadable> BEHAVIOR select( + Class<BEHAVIOR> behaviorType) { + if (_behaviorCache.containsKey(behaviorType)) { + return (BEHAVIOR) _behaviorCache.get(behaviorType); + } + synchronized (_behaviorCache) { + if (_behaviorCache.containsKey(behaviorType)) { + return (BEHAVIOR) _behaviorCache.get(behaviorType); + } + final BEHAVIOR bhv = (BEHAVIOR) getComponent(behaviorType); + _behaviorCache.put(behaviorType, bhv); + return bhv; + } + } + + /** + * Select behavior-readable by name. + * + * @param tableFlexibleName Table flexible-name. (NotNull) + * @return Behavior-readable. (NotNull) + */ + public BehaviorReadable byName(String tableFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("tableFlexibleName", + tableFlexibleName); + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(tableFlexibleName); + return select(getBehaviorType(dbmeta)); + } + + /** + * Get behavior-type by dbmeta. + * + * @param dbmeta Dbmeta. (NotNull) + * @return Behavior-type. (NotNull) + */ + protected Class<BehaviorReadable> getBehaviorType(DBMeta dbmeta) { + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + if (behaviorTypeName == null) { + String msg = "The dbmeta.getBehaviorTypeName() should not return null: dbmeta=" + + dbmeta; + throw new IllegalStateException(msg); + } + final Class<BehaviorReadable> behaviorType; + try { + behaviorType = (Class<BehaviorReadable>) Class + .forName(behaviorTypeName); + } catch (ClassNotFoundException e) { + throw new RuntimeException("The class does not exist: " + + behaviorTypeName, e); + } + return behaviorType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheBehaviorSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheDaoSelector.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheDaoSelector.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheDaoSelector.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,66 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.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; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CacheDaoSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CallbackContext.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CallbackContext.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CallbackContext.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,75 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import jp.sf.pal.scheduler.db.allcommon.jdbc.SqlLogHandler; + +/** + * The context of callback. + * + * @author DBFlute(AutoGenerator) + */ +public class CallbackContext { + + //========================================================================== + // ========= + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal<CallbackContext> _threadLocal = new ThreadLocal<CallbackContext>(); + + /** + * Get callback-context on thread. + * + * @return The context of callback. (Nullable) + */ + public static CallbackContext getCallbackContextOnThread() { + return (CallbackContext) _threadLocal.get(); + } + + /** + * Set callback-context on thread. + * + * @param callbackContext The context of callback. (NotNull) + */ + public static void setCallbackContextOnThread( + CallbackContext callbackContext) { + if (callbackContext == null) { + String msg = "The argument[callbackContext] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(callbackContext); + } + + /** + * Is existing callback-context on thread? + * + * @return Determination. + */ + public static boolean isExistCallbackContextOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear callback-context on thread. + */ + public static void clearCallbackContextOnThread() { + _threadLocal.set(null); + } + + //========================================================================== + // ========= + // Attribute + // ========= + protected SqlLogHandler _sqlLogHandler; + + //========================================================================== + // ========= + // Accessor + // ======== + public SqlLogHandler getSqlLogHandler() { + return _sqlLogHandler; + } + + public void setSqlLogHandler(SqlLogHandler sqlLogHandler) { + this._sqlLogHandler = sqlLogHandler; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/CallbackContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBFluteConfig.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBFluteConfig.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBFluteConfig.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,314 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; + +/** + * @author DBFlute(AutoGenerator) + */ +public class DBFluteConfig { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(DBFluteConfig.class); + + /** Singleton instance. */ + private static final DBFluteConfig _instance = new DBFluteConfig(); + + //========================================================================== + // ========= + // Attribute + // ========= + protected StatementConfig _defaultStatementConfig; + + protected boolean _conditionBeanFormatSql = true;// This is for + + // compatibility! + + protected boolean _queryLogLevelInfo; + + protected boolean _executeStatusLogLevelInfo; + + protected boolean _useSqlLogRegistry; + + protected UniqueConstraintDeterminator _uniqueConstraintDeterminator; + + protected boolean _sqlExceptionOldStyleHandling = false;// This is for + + // compatibility! + + protected String _logDateFormat; + + protected String _logTimestampFormat; + + protected String _outsideSqlPackage; + + protected boolean _internalDebug; + + protected boolean _locked = true; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + */ + private DBFluteConfig() { + } + + //========================================================================== + // ========= + // Singleton + // ========= + /** + * Get instance. + * + * @return Singleton instance. (NotNull) + */ + public static DBFluteConfig getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Default Statement Config + // ======================== + public StatementConfig getDefaultStatementConfig() { + return _defaultStatementConfig; + } + + public void setDefaultStatementConfig(StatementConfig defaultStatementConfig) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting defaultStatementConfig: " + + defaultStatementConfig); + } + _defaultStatementConfig = defaultStatementConfig; + } + + //========================================================================== + // ========= + // 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() { + return _queryLogLevelInfo; + } + + public void setQueryLogLevelInfo(boolean queryLogLevelInfo) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting queryLogLevelInfo: " + queryLogLevelInfo); + } + _queryLogLevelInfo = queryLogLevelInfo; + } + + //========================================================================== + // ========= + // Execute Status Log Level Info + // ============================= + public boolean isExecuteStatusLogLevelInfo() { + return _executeStatusLogLevelInfo; + } + + public void setExecuteStatusLogLevelInfo(boolean executeStatusLogLevelInfo) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting executeStatusLogLevelInfo: " + + executeStatusLogLevelInfo); + } + _executeStatusLogLevelInfo = executeStatusLogLevelInfo; + } + + // [DBFlute-0.8.2] + //========================================================================== + // ========= + // Sql Log Registry + // ================ + public boolean isUseSqlLogRegistry() { + return _useSqlLogRegistry; + } + + public void setUseSqlLogRegistry(boolean useSqlLogRegistry) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting useSqlLogRegistry: " + useSqlLogRegistry); + } + _useSqlLogRegistry = useSqlLogRegistry; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint + // ================= + public UniqueConstraintDeterminator getUniqueConstraintDeterminator() { + return _uniqueConstraintDeterminator; + } + + public void setUniqueConstraintDeterminator( + UniqueConstraintDeterminator uniqueConstraintDeterminator) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting uniqueConstraintDeterminator: " + + uniqueConstraintDeterminator); + } + _uniqueConstraintDeterminator = uniqueConstraintDeterminator; + } + + public static interface UniqueConstraintDeterminator { + 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() { + return _logDateFormat; + } + + public void setLogDateFormat(String logDateFormat) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting logDateFormat: " + logDateFormat); + } + _logDateFormat = logDateFormat; + } + + public String getLogTimestampFormat() { + return _logTimestampFormat; + } + + public void setLogTimestampFormat(String logTimestampFormat) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting logTimestampFormat: " + logTimestampFormat); + } + _logTimestampFormat = logTimestampFormat; + } + + //========================================================================== + // ========= + // OutsideSql Package + // ================== + public String getOutsideSqlPackage() { + return _outsideSqlPackage; + } + + public void setOutsideSqlPackage(String outsideSqlPackage) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting outsideSqlPackage: " + outsideSqlPackage); + } + _outsideSqlPackage = outsideSqlPackage; + } + + //========================================================================== + // ========= + // Internal Debug + // ============== + public boolean isInternalDebug() { + return _internalDebug; + } + + public void setInternalDebug(boolean internalDebug) { + assertNotLocked(); + if (_log.isInfoEnabled()) { + _log.info("...Setting internalDebug: " + internalDebug); + } + _internalDebug = internalDebug; + } + + //========================================================================== + // ========= + // Config Lock + // =========== + public boolean isLocked() { + return _locked; + } + + public void lock() { + if (_log.isInfoEnabled()) { + _log.info("...Locking the config of dbflute!"); + } + _locked = true; + } + + public void unlock() { + if (_log.isInfoEnabled()) { + _log.info("...Unlocking the config of dbflute!"); + } + _locked = false; + } + + protected void assertNotLocked() { + if (!isLocked()) { + return; + } + String msg = "The config of dbflute is locked! Don't access at this timing!"; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Config Clear + // ============ + public void clear() { // the only properties that update OK while executing + _defaultStatementConfig = null; + _conditionBeanFormatSql = true; // as default + _queryLogLevelInfo = false; + _executeStatusLogLevelInfo = false; + _useSqlLogRegistry = false; + _logDateFormat = null; + _logTimestampFormat = null; + _internalDebug = false; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DBFluteConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoReadable.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoReadable.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoReadable.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,11 @@ +package jp.sf.pal.scheduler.db.allcommon; + +/** + * The interface of dao-readable. + * + * @author DBFlute(AutoGenerator) + */ +public interface DaoReadable { + public void initializeDaoMetaData(String methodName);// Very Internal + // Method! +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoReadable.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoSelector.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoSelector.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoSelector.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,26 @@ +package jp.sf.pal.scheduler.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); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoSelector.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoWritable.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoWritable.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoWritable.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,70 @@ +package jp.sf.pal.scheduler.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); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/DaoWritable.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/Entity.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/Entity.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/Entity.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,126 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import java.util.LinkedHashSet; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +/** + * The interface of entity. + * + * @author DBFlute(AutoGenerator) + */ +public interface Entity { + + //========================================================================== + // ========= + // DBMeta + // ====== + /** + * Get the instance of target dbmeta. + * + * @return DBMeta. (NotNull) + */ + public DBMeta getDBMeta(); + + //========================================================================== + // ========= + // Table Name + // ========== + /** + * Get table DB name. + * + * @return Table DB name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table property name. + * + * @return Table property name. (NotNull) + */ + public String getTablePropertyName(); + + //========================================================================== + // ========= + // Determination + // ============= + /** + * Has the value of primary-key? + * + * @return Determination. + */ + public boolean hasPrimaryKeyValue(); + + //========================================================================== + // ========= + // Modified Properties + // =================== + /** + * Get modified property names. (JavaBeansRule) + * + * @return Modified property names. (NotNull) + */ + public Set<String> getModifiedPropertyNames(); + + /** + * Clear modified property names. + */ + public void clearModifiedPropertyNames(); + + /** + * Entity modified properties. + */ + public static class EntityModifiedProperties implements + java.io.Serializable { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** Set of properties. */ + protected Set<String> _propertiesSet = new LinkedHashSet<String>(); + + /** + * Add property name. (JavaBeansRule) + * + * @param propertyName Property name. (Nullable) + */ + public void addPropertyName(String propertyName) { + _propertiesSet.add(propertyName); + } + + /** + * Get the set of properties. + * + * @return The set of properties. (NotNull) + */ + public Set<String> getPropertyNames() { + return _propertiesSet; + } + + /** + * Is empty? + * + * @return Determination. + */ + public boolean isEmpty() { + return _propertiesSet.isEmpty(); + } + + /** + * Clear the set of properties. + */ + public void clear() { + _propertiesSet.clear(); + } + + /** + * Remove property name from the set. (JavaBeansRule) + * + * @param propertyName Property name. (Nullable) + */ + public void remove(String propertyName) { + _propertiesSet.remove(propertyName); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/Entity.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/EntityDefinedCommonColumn.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/EntityDefinedCommonColumn.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/EntityDefinedCommonColumn.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon; + +/** + * The interface of entity defined common column. + * + * @author DBFlute(AutoGenerator) + */ +public interface EntityDefinedCommonColumn extends Entity { + + /** + * Disable common column auto set up. + */ + public void disableCommonColumnAutoSetup(); + + /** + * Can the entity set up common column by auto? + * + * @return Determination. + */ + public boolean canCommonColumnAutoSetup(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/EntityDefinedCommonColumn.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/GenMetaData.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/GenMetaData.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/GenMetaData.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,258 @@ +package jp.sf.pal.scheduler.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.scheduler.db.allcommon"; + } + + /** + * Get the property-value of baseBehaviorPackage. + * + * @return The property-value. + */ + public String getBaseBehaviorPackage() { + return "jp.sf.pal.scheduler.db.bsbhv"; + } + + /** + * Get the property-value of baseDaoPackage. + * + * @return The property-value. + */ + public String getBaseDaoPackage() { + return "jp.sf.pal.scheduler.db.bsdao"; + } + + /** + * Get the property-value of baseEntityPackage. + * + * @return The property-value. + */ + public String getBaseEntityPackage() { + return "jp.sf.pal.scheduler.db.bsentity"; + } + + /** + * Get the property-value of conditionBeanPackage. + * + * @return The property-value. + */ + public String getConditionBeanPackage() { + return "jp.sf.pal.scheduler.db.cbean"; + } + + /** + * Get the property-value of extendedDaoPackage. + * + * @return The property-value. + */ + public String getExtendedDaoPackage() { + return "jp.sf.pal.scheduler.db.exdao"; + } + + /** + * Get the property-value of extendedBehaviorPackage. + * + * @return The property-value. + */ + public String getExtendedBehaviorPackage() { + return "jp.sf.pal.scheduler.db.exbhv"; + } + + /** + * Get the property-value of extendedEntityPackage. + * + * @return The property-value. + */ + public String getExtendedEntityPackage() { + return "jp.sf.pal.scheduler.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 "@="; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/GenMetaData.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/InternalMapContext.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/InternalMapContext.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/InternalMapContext.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,64 @@ +package jp.sf.pal.scheduler.db.allcommon; + +import java.util.HashMap; +import java.util.Map; + +/** + * The context of internal map. + * + * @author DBFlute(AutoGenerator) + */ +public class InternalMapContext { + + //========================================================================== + // ========= + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal<Map<String, Object>> threadLocal = new ThreadLocal<Map<String, Object>>(); + + protected static void initialize() { + if (threadLocal.get() != null) { + return; + } + threadLocal.set(new HashMap<String, Object>()); + } + + /** + * Get the value of the object by the key. + * + * @param key The key of the object. (NotNull) + * @return The value of the object. (Nullable) + */ + public static Object getObject(String key) { + initialize(); + return threadLocal.get().get(key); + } + + /** + * Set the value of the object. + * + * @param key The key of the object. (NotNull) + * @param value The value of the object. (Nullable) + */ + public static void setObject(String key, Object value) { + initialize(); + threadLocal.get().put(key, value); + } + + /** + * Is existing internal-map-context on thread? + * + * @return Determination. + */ + public static boolean isExistInternalMapContextOnThread() { + return (threadLocal.get() != null); + } + + /** + * Clear internal-map-context on thread. + */ + public static void clearInternalMapContextOnThread() { + threadLocal.set(null); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/InternalMapContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/QLog.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/QLog.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/QLog.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,39 @@ +package jp.sf.pal.scheduler.db.allcommon; + +/** + * @author DBFlute(AutoGenerator) + */ +public class QLog { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(QLog.class); + + //========================================================================== + // ========= + // Logging + // ======= + public static void log(String sql) {// Very Internal + if (isQueryLogLevelInfo()) { + _log.info(sql); + } else { + _log.debug(sql); + } + } + + public static boolean isLogEnabled() { + if (isQueryLogLevelInfo()) { + return _log.isInfoEnabled(); + } else { + return _log.isDebugEnabled(); + } + } + + protected static boolean isQueryLogLevelInfo() { + return DBFluteConfig.getInstance().isQueryLogLevelInfo(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/QLog.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/XLog.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/XLog.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/XLog.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,39 @@ +package jp.sf.pal.scheduler.db.allcommon; + +/** + * @author DBFlute(AutoGenerator) + */ +public class XLog { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(XLog.class); + + //========================================================================== + // ========= + // Logging + // ======= + public static void log(String msg) {// Very Internal + if (isExecuteStatusLogLevelInfo()) { + _log.info(msg); + } else { + _log.debug(msg); + } + } + + public static boolean isLogEnabled() {// Very Internal + if (isExecuteStatusLogLevelInfo()) { + return _log.isInfoEnabled(); + } else { + return _log.isDebugEnabled(); + } + } + + protected static boolean isExecuteStatusLogLevelInfo() { + return DBFluteConfig.getInstance().isExecuteStatusLogLevelInfo(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/XLog.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/OutsideSql.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/OutsideSql.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/OutsideSql.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +package jp.sf.pal.scheduler.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; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/annotation/OutsideSql.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorReadable.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorReadable.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorReadable.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,973 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.BehaviorSelector; +import jp.sf.pal.scheduler.db.allcommon.DaoSelector; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.batch.TokenFileOutputOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.batch.TokenFileOutputResult; +import jp.sf.pal.scheduler.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelBox; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.executor.OutsideSqlBasicExecutor; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingHeaderInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingSimpleFacade; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.impl.FileMakingSimpleFacadeImpl; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * The abstract class of behavior-readable. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBehaviorReadable implements BehaviorReadable { + + //========================================================================== + // ========= + // Attribute + // ========= + /** + * Behavior-selector instance. It's basically referred at loadReferrer. + * (Required for loadReferrer) + */ + protected BehaviorSelector _behaviorSelector; + + /** + * Dao-selector instance. It's basically referred at loadReferrer. (Required + * for OutsideSql) + */ + protected DaoSelector _daoSelector; + + //========================================================================== + // =========== + // Basic Get All + // ============= + /** + * Get count all. + * + * @return Count all. + */ + public int getCountAll() { + return callGetCountAll(); + } + + //========================================================================== + // =========== + // Count Read + // ========== + /** + * The implementation. + * + * @param cb Condition-bean. This condition-bean should not be set up about + * fetch-scope. (NotNull) + * @return Read count. (NotNull) + */ + public int readCount(ConditionBean cb) { + assertConditionBeanNotNull(cb); + return callReadCount(cb); + } + + //========================================================================== + // =========== + // Entity Read + // =========== + /** + * The implementation. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public Entity readEntity(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final List<Entity> ls = readList(cb); + if (ls.isEmpty()) { + return null; + } + assertEntitySelectedAsOne(ls, cb); + return (Entity) ls.get(0); + } + + /** + * The implementation. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public Entity readEntityWithDeletedCheck(ConditionBean cb) { + assertConditionBeanNotNull(cb); + final List<Entity> ls = readList(cb); + assertEntityNotDeleted(ls, cb); + assertEntitySelectedAsOne(ls, cb); + return (Entity) ls.get(0); + } + + //========================================================================== + // =========== + // Entity Read Internal Helper + // =========================== + protected <ENTITY extends Entity, CB extends ConditionBean> ENTITY helpSelectEntityInternally( + CB cb, InternalSelectEntityCallback<ENTITY, CB> callback) { + assertConditionBeanNotNull(cb); + cb.checkSafetyResult(1); + List<ENTITY> ls = null; + try { + ls = callback.callbackSelectList(cb); + } catch (jp.sf.pal.scheduler.db.allcommon.exception.DangerousResultSizeException e) { + throwEntityDuplicatedException("{Over safetyMaxResultSize '1'}", + cb, e); + } + if (ls.isEmpty()) { + return null; + } + assertEntitySelectedAsOne(ls, cb); + return (ENTITY) ls.get(0); + } + + protected static interface InternalSelectEntityCallback<ENTITY extends Entity, CB extends ConditionBean> { + public List<ENTITY> callbackSelectList(CB cb); + } + + protected <ENTITY extends Entity, CB extends ConditionBean> ENTITY helpSelectEntityWithDeletedCheckInternally( + CB cb, + InternalSelectEntityWithDeletedCheckCallback<ENTITY, CB> callback) { + assertConditionBeanNotNull(cb); + cb.checkSafetyResult(1); + List<ENTITY> ls = null; + try { + ls = callback.callbackSelectList(cb); + } catch (jp.sf.pal.scheduler.db.allcommon.exception.DangerousResultSizeException e) { + throwEntityDuplicatedException("{Over safetyMaxResultSize '1'}", + cb, e); + } + assertEntityNotDeleted(ls, cb); + assertEntitySelectedAsOne(ls, cb); + return (ENTITY) ls.get(0); + } + + protected static interface InternalSelectEntityWithDeletedCheckCallback<ENTITY extends Entity, CB extends ConditionBean> { + public List<ENTITY> callbackSelectList(CB cb); + } + + //========================================================================== + // =========== + // List Read + // ========= + /** + * The implementation. + * + * @param cb Condition-bean. + * @return List-result-bean. If the select result is zero, it returns empty + * list. (NotNull) + */ + public ListResultBean<Entity> readList(ConditionBean cb) { + assertConditionBeanNotNull(cb); + return new jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder<Entity>( + getTableDbName()).buildListResultBean(cb, callReadList(cb)); + } + + /** + * The implementation. + * + * @param cb Condition-bean. (NotNull) + * @return Read page. (NotNull) + */ + public PagingResultBean<Entity> readPage(final ConditionBean cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<Entity> invoker = new PagingInvoker<Entity>( + getTableDbName()); + final PagingHandler<Entity> handler = new PagingHandler<Entity>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return readCount(cb); + } + + public List<Entity> paging() { + return readList(cb); + } + }; + return invoker.invokePaging(handler); + } + + /** + * Assert that the entity is not deleted. + * + * @param entity Selected entity. (Nullable) + * @param searchKey4Log Search-key for Logging. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + protected void assertEntityNotDeleted( + jp.sf.pal.scheduler.db.allcommon.Entity entity, Object searchKey4Log) { + if (entity == null) { + throwEntityAlreadyDeletedException(searchKey4Log); + } + } + + /** + * Assert that the entity is not deleted. + * + * @param ls Selected list. (Nullable) + * @param searchKey4Log Search-key for Logging. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + */ + protected void assertEntityNotDeleted(List ls, Object searchKey4Log) { + if (ls == null || ls.isEmpty()) { + throwEntityAlreadyDeletedException(searchKey4Log); + } + } + + /** + * Assert that the entity is selected as one. + * + * @param ls Selected list. (NotNull) + * @param searchKey4Log Search-key for Logging. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + */ + protected void assertEntitySelectedAsOne(List ls, Object searchKey4Log) { + if (ls == null || ls.isEmpty()) { + throwEntityAlreadyDeletedException(searchKey4Log); + } + if (ls.size() > 1) { + throwEntityDuplicatedException(ls.size() + "", searchKey4Log, null); + } + } + + private void throwEntityAlreadyDeletedException(Object searchKey4Log) { + ConditionBeanContext.throwEntityAlreadyDeletedException(searchKey4Log); + } + + private void throwEntityDuplicatedException(String resultCountString, + Object searchKey4Log, Throwable cause) { + ConditionBeanContext.throwEntityDuplicatedException(resultCountString, + searchKey4Log, cause); + } + + //========================================================================== + // ========= + // Various Select + // ============== + public OutsideSqlBasicExecutor outsideSql() { + assertDaoSelectorNotNull("outsideSql"); + final OutsideSqlDao outsideSqlDao = _daoSelector + .select(OutsideSqlDao.class); + return new OutsideSqlBasicExecutor(outsideSqlDao, getTableDbName()); + } + + private void assertDaoSelectorNotNull(String methodName) { + if (_daoSelector == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the selector of dao as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + 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 + + getLineSeparator(); + msg = msg + " _daoSelector : " + _daoSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + + /** + * Create value-label list. + * + * @param <ENTITY> The type of entity. + * @param entityList The list of entity. (NotNull) + * @param valueLabelSetupper Value-label-setupper. (NotNull) + * @return Value-label list. (NotNull) + */ + public <ENTITY extends Entity> List<Map<String, Object>> createValueLabelList( + List<ENTITY> entityList, + ValueLabelSetupper<ENTITY> valueLabelSetupper) { + final List<Map<String, Object>> valueLabelList = new ArrayList<Map<String, Object>>(); + final ValueLabelBox box = new ValueLabelBox(); + for (ENTITY entity : entityList) { + final Map<String, Object> valueLabel = new HashMap<String, Object>(); + valueLabelSetupper.setup(box, entity); + valueLabel.put("value", box.getValue()); + valueLabel.put("label", box.getLabel()); + valueLabelList.add(valueLabel); + } + return valueLabelList; + } + + //========================================================================== + // ========= + // Sequence + // ======== + /** + * The implementation. + * + * @return The value of sequence. (NotNull) + */ + public java.math.BigDecimal readNextVal() { + try { + final Method method = getClass().getMethod("selectNextVal", + new Class[] {}); + Object sequenceObject = method.invoke(this, new Object[] {}); + if (sequenceObject instanceof java.math.BigDecimal) { + return (java.math.BigDecimal) sequenceObject; + } + return (java.math.BigDecimal) helpConvertingSequenceObject( + java.math.BigDecimal.class, sequenceObject); + } catch (NoSuchMethodException e) { + throw new RuntimeException("The table does not have sequence: " + + getTableDbName(), e); + } catch (Exception e) { + throw new RuntimeException( + "The selectNextVal() of the table threw the exception: " + + getTableDbName(), e); + } + } + + protected Object helpConvertingSequenceObject(Class resultClass, + Object sequenceObject) { + try { + final Constructor constructor = resultClass + .getConstructor(new Class[] { String.class }); + return constructor.newInstance(new Object[] { sequenceObject + .toString() }); + } catch (NoSuchMethodException e) { + } catch (Exception e) { + throw new RuntimeException( + "The readNextVal() of the table threw the exception: " + + getTableDbName(), e); + } + try { + final Method method = resultClass.getMethod("valueOf", + new Class[] { long.class }); + return method.invoke(null, new Object[] { Long + .valueOf(sequenceObject.toString()) }); + } catch (NoSuchMethodException e) { + } catch (Exception e) { + throw new RuntimeException( + "The readNextVal() of the table threw the exception: " + + getTableDbName(), e); + } + String msg = "Cannot convert sequenceObject to resultClass:"; + msg = msg + " resultClass=" + resultClass + " sequenceObjectType=" + + sequenceObject.getClass(); + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Load Referrer Internal Helper + // ============================= + /** + * Help load referrer internally. About internal policy, the value of + * primary key(and others too) is treated as CaseInsensitive. + * + * @param <LOCAL_ENTITY> The type of base entity. + * @param <PK> The type of primary key. + * @param <REFERRER_CB> The type of referrer condition-bean. + * @param <REFERRER_ENTITY> The type of referrer entity. + * @param localEntityList The list of local entity. (NotNull) + * @param loadReferrerOption The option of loadReferrer. (NotNull) + * @param callback The internal call-back of loadReferrer. (NotNull) + */ + protected <LOCAL_ENTITY extends Entity, PK, REFERRER_CB extends ConditionBean, REFERRER_ENTITY extends Entity> void helpLoadReferrerInternally( + List<LOCAL_ENTITY> localEntityList, + LoadReferrerOption<REFERRER_CB, REFERRER_ENTITY> loadReferrerOption, + InternalLoadReferrerCallback<LOCAL_ENTITY, PK, REFERRER_CB, REFERRER_ENTITY> callback) { + doHelpLoadReferrerInternally(localEntityList, loadReferrerOption, + callback); + } + + /** + * Do help load referrer internally. About internal policy, the value of + * primary key(and others too) is treated as CaseInsensitive. + * + * @param <LOCAL_ENTITY> The type of base entity. + * @param <PK> The type of primary key. + * @param <REFERRER_CB> The type of referrer condition-bean. + * @param <REFERRER_ENTITY> The type of referrer entity. + * @param localEntityList The list of local entity. (NotNull) + * @param loadReferrerOption The option of loadReferrer. (NotNull) + * @param callback The internal call-back of loadReferrer. (NotNull) + */ + protected <LOCAL_ENTITY extends Entity, PK, REFERRER_CB extends ConditionBean, REFERRER_ENTITY extends Entity> void doHelpLoadReferrerInternally( + List<LOCAL_ENTITY> localEntityList, + LoadReferrerOption<REFERRER_CB, REFERRER_ENTITY> loadReferrerOption, + InternalLoadReferrerCallback<LOCAL_ENTITY, PK, REFERRER_CB, REFERRER_ENTITY> callback) { + + // - - - - - - - - - - - + // Assert pre-condition + // - - - - - - - - - - - + assertBehaviorSelectorNotNull("loadReferrer"); + assertObjectNotNull("localEntityList", localEntityList); + assertObjectNotNull("loadReferrerOption", loadReferrerOption); + if (localEntityList.isEmpty()) { + return; + } + + // - - - - - - - - - - - - - - + // Prepare temporary container + // - - - - - - - - - - - - - - + final Map<PK, LOCAL_ENTITY> pkLocalEntityMap = new LinkedHashMap<PK, LOCAL_ENTITY>(); + final List<PK> pkList = new ArrayList<PK>(); + for (LOCAL_ENTITY localEntity : localEntityList) { + final PK primaryKeyValue = callback + .callbackBase_getPrimaryKeyValue(localEntity); + pkList.add(callback.callbackBase_getPrimaryKeyValue(localEntity)); + pkLocalEntityMap + .put(toLowerCasePrimaryKeyIfString(primaryKeyValue), + localEntity); + } + + // - - - - - - - - - - - - - - - - + // Prepare referrer condition bean + // - - - - - - - - - - - - - - - - + final REFERRER_CB cb; + if (loadReferrerOption.getReferrerConditionBean() != null) { + cb = loadReferrerOption.getReferrerConditionBean(); + } else { + cb = callback.callbackReferrer_newMyConditionBean(); + } + + // - - - - - - - - - - - - - - + // Select the list of referrer + // - - - - - - - - - - - - - - + callback.callbackReferrer_queryForeignKeyInScope(cb, pkList); + loadReferrerOption + .delegateKeyConditionExchangingFirstWhereClauseForLastOne(cb); + if (!loadReferrerOption.isStopOrderByKey()) { + callback.callbackReferrer_queryAddOrderByForeignKeyAsc(cb); + cb.getSqlComponentOfOrderByClause() + .exchangeFirstOrderByElementForLastOne(); + } + loadReferrerOption.delegateConditionBeanSettingUp(cb); + final List<REFERRER_ENTITY> referrerList = callback + .callbackReferrer_selectList(cb); + loadReferrerOption.delegateEntitySettingUp(referrerList); + + // - - - - - - - - - - - - - - - - - - - - - - - - + // Create the map of {primary key / referrer list} + // - - - - - - - - - - - - - - - - - - - - - - - - + final Map<PK, List<REFERRER_ENTITY>> pkReferrerListMap = new LinkedHashMap<PK, List<REFERRER_ENTITY>>(); + for (REFERRER_ENTITY referrerEntity : referrerList) { + final PK referrerListKey; + { + final PK foreignKeyValue = callback + .callbackReferrer_getForeignKeyValue(referrerEntity); + referrerListKey = toLowerCasePrimaryKeyIfString(foreignKeyValue); + } + if (!pkReferrerListMap.containsKey(referrerListKey)) { + pkReferrerListMap.put(referrerListKey, + new ArrayList<REFERRER_ENTITY>()); + } + (pkReferrerListMap.get(referrerListKey)).add(referrerEntity); + + // for Reverse Reference. + final LOCAL_ENTITY localEntity = pkLocalEntityMap + .get(referrerListKey); + callback.callbackReferrer_setForeignEntity(referrerEntity, + localEntity); + } + + // - - - - - - - - - - - - - - - - - - + // Relate referrer list to base entity + // - - - - - - - - - - - - - - - - - - + for (LOCAL_ENTITY localEntity : localEntityList) { + final PK referrerListKey; + { + final PK primaryKey = callback + .callbackBase_getPrimaryKeyValue(localEntity); + referrerListKey = toLowerCasePrimaryKeyIfString(primaryKey); + } + if (pkReferrerListMap.containsKey(referrerListKey)) { + callback.callbackBase_setReferrerList(localEntity, + pkReferrerListMap.get(referrerListKey)); + } else { + callback.callbackBase_setReferrerList(localEntity, + new ArrayList<REFERRER_ENTITY>()); + } + } + } + + /** + * To lower case for primary key if the value is string. + * + * @param <PK> The type of primary key. + * @param value The value of primary key. (Nullable) + * @return The value of primary key. (Nullable) + */ + protected <PK> PK toLowerCasePrimaryKeyIfString(PK value) { + return (PK) toLowerCaseIfString(value); + } + + /** + * @param <LOCAL_ENTITY> The type of base entity. + * @param <PK> The type of primary key. + * @param <REFERRER_CB> The type of referrer conditionBean. + * @param <REFERRER_ENTITY> The type of referrer entity. + */ + protected static interface InternalLoadReferrerCallback<LOCAL_ENTITY extends Entity, PK, REFERRER_CB extends ConditionBean, REFERRER_ENTITY extends Entity> { + // For Base + public PK callbackBase_getPrimaryKeyValue(LOCAL_ENTITY entity); + + public void callbackBase_setReferrerList(LOCAL_ENTITY entity, + List<REFERRER_ENTITY> referrerList); + + // For Referrer + public REFERRER_CB callbackReferrer_newMyConditionBean(); + + public void callbackReferrer_queryForeignKeyInScope(REFERRER_CB cb, + List<PK> pkList); + + public void callbackReferrer_queryAddOrderByForeignKeyAsc(REFERRER_CB cb); + + public List<REFERRER_ENTITY> callbackReferrer_selectList(REFERRER_CB cb); + + public PK callbackReferrer_getForeignKeyValue(REFERRER_ENTITY entity); + + public void callbackReferrer_setForeignEntity( + REFERRER_ENTITY referrerEntity, LOCAL_ENTITY localEntity); + } + + protected BehaviorSelector xgetBSFLR() { // getBehaviorSelectorForLoadReferrer + // () as Internal + assertBehaviorSelectorNotNull("loadReferrer"); + return getBehaviorSelector(); + } + + private void assertBehaviorSelectorNotNull(String methodName) { + if (_behaviorSelector == null) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "Not found the selector of behavior as behavior's attributed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the definition of the selector at your 'dbflute.dicon'." + + 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 + + getLineSeparator(); + msg = msg + " _daoSelector : " + _daoSelector + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // Pullout Internal Helper + // ======================= + protected <LOCAL_ENTITY extends Entity, FOREIGN_ENTITY extends Entity> List<FOREIGN_ENTITY> helpPulloutInternally( + List<LOCAL_ENTITY> localEntityList, + InternalPulloutCallback<LOCAL_ENTITY, FOREIGN_ENTITY> callback) { + assertObjectNotNull("localEntityList", localEntityList); + final Set<FOREIGN_ENTITY> foreignSet = new LinkedHashSet<FOREIGN_ENTITY>(); + for (LOCAL_ENTITY entity : localEntityList) { + final FOREIGN_ENTITY foreignEntity = callback + .callbackGetForeignEntity(entity); + if (foreignEntity == null || foreignSet.contains(foreignEntity)) { + continue; + } + foreignSet.add(foreignEntity); + } + return new ArrayList<FOREIGN_ENTITY>(foreignSet); + } + + protected static interface InternalPulloutCallback<LOCAL_ENTITY extends Entity, FOREIGN_ENTITY extends Entity> { + public FOREIGN_ENTITY callbackGetForeignEntity(LOCAL_ENTITY entity); + } + + //========================================================================== + // ========= + // Token File + // ========== + public TokenFileOutputExecutor tokenFileOutput() + throws java.io.FileNotFoundException, java.io.IOException { + return new TokenFileOutputExecutor(); + } + + public class TokenFileOutputExecutor { + /** + * Output token-file from this table records. + * + * @param cb Condition-bean. (NotNull) + * @param filename Name of the file. (NotNull and NotEmpty) + * @param tokenFileOutputOption token-file-output-option. (NotNull and + * Required{delimiter and encoding}) + * @return Token-file-output-result. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public TokenFileOutputResult outputTokenFile(ConditionBean cb, + String filename, TokenFileOutputOption tokenFileOutputOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertConditionBeanNotNull(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(); + final List<String> valueList = getDBMeta() + .convertToColumnStringValueList(entity); + rowList.add(valueList); + } + final FileMakingSimpleFacade fileMakingSimpleFacade = new FileMakingSimpleFacadeImpl(); + final FileMakingOption fileMakingOption = tokenFileOutputOption + .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(); + columnDbNameList.add(columnInfo.getColumnDbName()); + } + fileMakingHeaderInfo.setColumnNameList(columnDbNameList); + fileMakingOption.setFileMakingHeaderInfo(fileMakingHeaderInfo); + fileMakingSimpleFacade.makeFromRowList(filename, rowList, + fileMakingOption); + final TokenFileOutputResult tokeFileOutputResult = new TokenFileOutputResult(); + tokeFileOutputResult.setSelectedList(ls); + return tokeFileOutputResult; + } + } + + //========================================================================== + // ========= + // Delegate Method + // =============== + /** + * The implementation. + * + * @return All count. + */ + protected int callGetCountAll() { + return readCount(newConditionBean()); + } + + /** + * The implementation. + * + * @return All list. (NotNull) + */ + protected List<Entity> callGetListAll() { + return readList(newConditionBean()); + } + + /** + * The implementation. + * + * @param cb Condition-bean that the type is condition-bean-interface. + * (NotNull) + * @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(); + } + + /** + * The implementation. + * + * @param cb Condition-bean that the type is condition-bean-interface. + * (NotNull) + * @return Read list. If the select result is zero, it returns empty list. + * (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; + } + + 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); + } + } + + 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); + } + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + protected abstract boolean hasVersionNoValue(Entity entity); + + protected abstract boolean hasUpdateDateValue(Entity entity); + + //========================================================================== + // ========= + // General Helper + // ============== + /** + * To lower case if the type is String. + * + * @param obj Object. (Nullable) + * @return Lower object. (Nullable) + */ + protected Object toLowerCaseIfString(Object obj) { + if (obj != null && obj instanceof String) { + return ((String) obj).toLowerCase(); + } + return obj; + } + + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + protected <ENTITY extends Entity> ENTITY helpDowncastInternally( + Entity entity, Class<ENTITY> clazz) { + assertObjectNotNull("entity", entity); + assertObjectNotNull("clazz", clazz); + try { + return (ENTITY) entity; + } catch (ClassCastException e) { + String msg = "The entity should be " + clazz.getSimpleName() + + " but it was: " + entity.getClass(); + throw new RuntimeException(msg, e); + } + } + + // ---------------------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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 that the entity is not null. + * + * @param entity Entity. (NotNull) + */ + protected void assertEntityNotNull(Entity entity) { + assertObjectNotNull("entity", entity); + } + + /** + * Assert that the condition-bean is not null. + * + * @param cb Condition-bean. (NotNull) + */ + protected void assertConditionBeanNotNull( + jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean cb) { + assertObjectNotNull("cb", cb); + } + + /** + * Assert that the entity has primary-key value. + * + * @param entity Entity. (NotNull) + */ + protected void assertEntityNotNullAndHasPrimaryKeyValue(Entity entity) { + assertEntityNotNull(entity); + if (!entity.hasPrimaryKeyValue()) { + String msg = "The entity must should primary-key: entity=" + entity; + throw new IllegalArgumentException(msg + entity); + } + } + + // ---------------------------------------------------------------- + // 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(variableName, value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + // ---------------------------------------------------------------- + // Assert List + // ----------- + /** + * Assert that the list is empty. + * + * @param ls List. (NotNull) + */ + protected void assertListNotNullAndEmpty(List ls) { + assertObjectNotNull("ls", ls); + if (!ls.isEmpty()) { + String msg = "The list should be empty: ls=" + ls.toString(); + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the list is not empty. + * + * @param ls List. (NotNull) + */ + protected void assertListNotNullAndNotEmpty(List ls) { + assertObjectNotNull("ls", ls); + if (ls.isEmpty()) { + String msg = "The list should not be empty: ls=" + ls.toString(); + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the list having only one. + * + * @param ls List. (NotNull) + */ + protected void assertListNotNullAndHasOnlyOne(List ls) { + assertObjectNotNull("ls", ls); + if (ls.size() != 1) { + String msg = "The list should contain only one object: ls=" + + ls.toString(); + throw new IllegalArgumentException(msg); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the selector of behavior. + * + * @return The select of behavior. (Nullable: But normally NotNull) + */ + protected BehaviorSelector getBehaviorSelector() { + return _behaviorSelector; + } + + /** + * Set the selector of behavior. + * + * @param behaviorSelector The selector of behavior. (NotNull) + */ + public void setBehaviorSelector(BehaviorSelector behaviorSelector) { + this._behaviorSelector = behaviorSelector; + } + + /** + * Get the selector of DAO. + * + * @return The select of DAO. (Nullable: But normally NotNull) + */ + protected DaoSelector getDaoSelector() { + return _daoSelector; + } + + /** + * Set the selector of DAO. + * + * @param daoSelector The selector of DAO. (NotNull) + */ + public void setDaoSelector(DaoSelector daoSelector) { + _daoSelector = daoSelector; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorReadable.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorWritable.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorWritable.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorWritable.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,997 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.batch.TokenFileReflectionFailure; +import jp.sf.pal.scheduler.db.allcommon.bhv.batch.TokenFileReflectionOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.batch.TokenFileReflectionResult; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.helper.MapStringBuilder; +import jp.sf.pal.scheduler.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileToken; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingCallback; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingHeaderInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingRowResource; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.impl.FileTokenImpl; + +/** + * The abstract class of behavior-writable. + * + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractBehaviorWritable extends AbstractBehaviorReadable + implements BehaviorWritable { + + //========================================================================== + // ========= + // Entity Update + // ============= + // ----------------------------------------------------- + // Create + // ------ + /** + * Create. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void create(Entity entity) { + doCreate(entity); + } + + protected abstract void doCreate(Entity entity); + + // ----------------------------------------------------- + // Modify + // ------ + /** + * Modify. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void modify(Entity entity) { + doModify(entity); + } + + protected abstract void doModify(Entity entity); + + /** + * Modify non strict. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void modifyNonstrict(Entity entity) { + doModifyNonstrict(entity); + } + + protected abstract void doModifyNonstrict(Entity entity); + + // ----------------------------------------------------- + // Create or Modify + // ---------------- + /** + * The implementation. + * + * @param entity Entity. This must contain primary-key value at least(Except + * use identity). (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void createOrModify(jp.sf.pal.scheduler.db.allcommon.Entity entity) { + assertEntityNotNull(entity); + doCreateOrUpdate(entity); + } + + protected abstract void doCreateOrUpdate(Entity entity); + + /** + * The implementation. + * + * @param entity Entity. This must contain primary-key value at least(Except + * use identity). (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void createOrModifyNonstrict( + jp.sf.pal.scheduler.db.allcommon.Entity entity) { + assertEntityNotNull(entity); + doCreateOrUpdateNonstrict(entity); + } + + protected abstract void doCreateOrUpdateNonstrict(Entity entity); + + // ----------------------------------------------------- + // Remove + // ------ + /** + * Remove. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void remove(jp.sf.pal.scheduler.db.allcommon.Entity entity) { + assertEntityNotNull(entity); + callRemove(entity); + } + + protected abstract void doRemove(Entity entity); + + //========================================================================== + // ========= + // Entity Update Internal Helper + // ============================= + // ----------------------------------------------------- + // Update + // ------ + protected <ENTITY extends Entity> void helpUpdateInternally(ENTITY entity, + InternalUpdateCallback<ENTITY> callback) { + assertEntityNotNull(entity); + assertEntityHasVersionNoValue(entity); + assertEntityHasUpdateDateValue(entity); + final int updatedCount = callback.callbackDelegateUpdate(entity); + if (updatedCount == 0) { + String msg = "The entity was Not Found! it has already been deleted: entity=" + + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (updatedCount > 1) { + String msg = "The entity was Too Many! it has been duplicated. It should be the only one! But the updatedCount=" + + updatedCount; + msg = msg + ": entity=" + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + protected static interface InternalUpdateCallback<ENTITY extends Entity> { + public int callbackDelegateUpdate(ENTITY entity); + } + + protected <ENTITY extends Entity> void helpUpdateNonstrictInternally( + ENTITY entity, InternalUpdateNonstrictCallback<ENTITY> callback) { + assertEntityNotNull(entity); + final int updatedCount = callback + .callbackDelegateUpdateNonstrict(entity); + if (updatedCount == 0) { + String msg = "The entity was Not Found! it has already been deleted: entity=" + + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (updatedCount > 1) { + String msg = "The entity was Too Many! it has been duplicated. It should be the only one! But the updatedCount=" + + updatedCount; + msg = msg + ": entity=" + entity; + } + } + + protected static interface InternalUpdateNonstrictCallback<ENTITY extends Entity> { + public int callbackDelegateUpdateNonstrict(ENTITY entity); + } + + // ----------------------------------------------------- + // InsertOrUpdate + // -------------- + protected <ENTITY extends Entity, CB_TYPE extends ConditionBean> void helpInsertOrUpdateInternally( + ENTITY entity, + InternalInsertOrUpdateCallback<ENTITY, CB_TYPE> callback) { + assertEntityNotNull(entity); + if (!entity.hasPrimaryKeyValue()) { + callback.callbackInsert(entity); + } else { + RuntimeException exception = null; + try { + callback.callbackUpdate(entity); + } catch (jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException e) { + if (e.getRows() == 0) { + exception = e; + } + } catch (jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException e) { + exception = e; + } catch (OptimisticLockColumnValueNullException e) { + exception = e; + } + if (exception != null) { + final CB_TYPE cb = callback.callbackNewMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta() + .extractPrimaryKeyMapString(entity)); + if (callback.callbackSelectCount(cb) == 0) { + callback.callbackInsert(entity); + } else { + throw exception; + } + } + } + } + + protected static interface InternalInsertOrUpdateCallback<ENTITY extends Entity, CB_TYPE extends ConditionBean> { + public void callbackInsert(ENTITY entity); + + public void callbackUpdate(ENTITY entity); + + public CB_TYPE callbackNewMyConditionBean(); + + public int callbackSelectCount(CB_TYPE cb); + } + + protected <ENTITY extends Entity> void helpInsertOrUpdateInternally( + ENTITY entity, + InternalInsertOrUpdateNonstrictCallback<ENTITY> callback) { + assertEntityNotNull(entity); + if (!entity.hasPrimaryKeyValue()) { + callback.callbackInsert(entity); + } else { + try { + callback.callbackUpdateNonstrict(entity); + } catch (jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException e) { + callback.callbackInsert(entity); + } catch (jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException e) { + callback.callbackInsert(entity); + } + } + } + + protected static interface InternalInsertOrUpdateNonstrictCallback<ENTITY extends Entity> { + public void callbackInsert(ENTITY entity); + + public void callbackUpdateNonstrict(ENTITY entity); + } + + // ----------------------------------------------------- + // Delete + // ------ + protected <ENTITY extends Entity> void helpDeleteInternally(ENTITY entity, + InternalDeleteCallback<ENTITY> callback) { + assertEntityNotNull(entity); + assertEntityHasVersionNoValue(entity); + assertEntityHasUpdateDateValue(entity); + final int deletedCount = callback.callbackDelegateDelete(entity); + if (deletedCount == 0) { + String msg = "The entity was Not Found! The entity has already been deleted: entity=" + + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (deletedCount > 1) { + String msg = "The deleted entity was duplicated. It should be the only one! But the deletedCount=" + + deletedCount; + msg = msg + ": entity=" + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + protected static interface InternalDeleteCallback<ENTITY extends Entity> { + public int callbackDelegateDelete(ENTITY entity); + } + + protected <ENTITY extends Entity> void helpDeleteNonstrictInternally( + ENTITY entity, InternalDeleteNonstrictCallback<ENTITY> callback) { + assertEntityNotNull(entity); + final int deletedCount = callback + .callbackDelegateDeleteNonstrict(entity); + if (deletedCount == 0) { + String msg = "The entity was Not Found! The entity has already been deleted: entity=" + + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } else if (deletedCount > 1) { + String msg = "The deleted entity was duplicated. It should be the only one! But the deletedCount=" + + deletedCount; + msg = msg + ": entity=" + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + protected static interface InternalDeleteNonstrictCallback<ENTITY extends Entity> { + public int callbackDelegateDeleteNonstrict(ENTITY entity); + } + + protected <ENTITY extends Entity> void helpDeleteNonstrictIgnoreDeletedInternally( + ENTITY entity, + InternalDeleteNonstrictIgnoreDeletedCallback<ENTITY> callback) { + assertEntityNotNull(entity); + final int deletedCount = callback + .callbackDelegateDeleteNonstrict(entity); + if (deletedCount == 0) { + return; + } else if (deletedCount > 1) { + String msg = "The deleted entity was duplicated. It should be the only one! But the deletedCount=" + + deletedCount; + msg = msg + ": entity=" + entity; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + protected static interface InternalDeleteNonstrictIgnoreDeletedCallback<ENTITY extends Entity> { + public int callbackDelegateDeleteNonstrict(ENTITY entity); + } + + //========================================================================== + // ========= + // Lump Update + // =========== + /** + * Lump create the list. + * + * @param entityList Entity list. (NotNull and NotEmpty) + * @return The array of created count. + */ + public int[] lumpCreate(java.util.List<Entity> entityList) { + assertListNotNullAndNotEmpty(entityList); + return callCreateList(entityList); + } + + /** + * Lump Modify the list. + * + * @param entityList Entity list. (NotNull and NotEmpty) + * @return Modified count. + * @exception jp.sf.pal.scheduler.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) { + assertListNotNullAndNotEmpty(entityList); + return callModifyList(entityList); + } + + /** + * Lump remove the list. + * + * @param entityList Entity list. (NotNull and NotEmpty) + * @return Removed count. + * @exception jp.sf.pal.scheduler.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) { + assertListNotNullAndNotEmpty(entityList); + return callRemoveList(entityList); + } + + /** + * Inject sequence to primary key if it needs. + * + * @param entity Entity. (NotNull) + */ + protected void injectSequenceToPrimaryKeyIfNeeds(Entity entity) { + final DBMeta dbmeta = entity.getDBMeta(); + if (!dbmeta.hasSequence() || dbmeta.hasTwoOrMorePrimaryKeys() + || entity.hasPrimaryKeyValue()) { + return; + } + final java.math.BigDecimal sequenceValue = readNextVal(); + final String columnDbName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + final java.util.Map<String, String> map = new java.util.HashMap<String, String>(); + map.put(columnDbName, sequenceValue.toString()); + dbmeta.acceptPrimaryKeyMap(entity, map); + } + + //========================================================================== + // =========== + // Token File + // ========== + public TokenFileReflectionExecutor tokenFileReflection() { + return new TokenFileReflectionExecutor(); + } + + public class TokenFileReflectionExecutor { + + /** + * Reflect(insert or update) token-file to this table. + * + * @param filename Name of the file. (NotNull and NotEmpty) + * @param tokenFileReflectionOption token-file-reflection-option. + * (NotNull and Required{delimiter and encoding}) + * @return Token-file-reflection-result. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public TokenFileReflectionResult reflectTokenFile(String filename, + TokenFileReflectionOption tokenFileReflectionOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + assertFileTokenReflectionOption(tokenFileReflectionOption); + + final TokenFileReflectionResult result = buildTokenFileReflectionResult(); + final FileTokenizingCallback fileTokenizingCallback = buildFileTokenReflectionFileTokenizingCallback( + tokenFileReflectionOption, result); + final FileTokenizingOption fileTokenizingOption = buildFileTokenReflectionFileTokenizingOption(tokenFileReflectionOption); + final FileToken fileToken = new FileTokenImpl(); + fileToken.tokenize(filename, fileTokenizingCallback, + fileTokenizingOption); + return result; + } + + /** + * Reflect(insert or update) token-file to this table. + * + * @param inputStream Input stream. (NotNull and NotClosed) + * @param tokenFileReflectionOption token-file-reflection-option. + * (NotNull and Required{delimiter and encoding}) + * @return Token-file-reflection-result. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public TokenFileReflectionResult reflectTokenFile( + java.io.InputStream inputStream, + TokenFileReflectionOption tokenFileReflectionOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("inputStream", inputStream); + assertFileTokenReflectionOption(tokenFileReflectionOption); + + final TokenFileReflectionResult result = buildTokenFileReflectionResult(); + final FileTokenizingCallback fileTokenizingCallback = buildFileTokenReflectionFileTokenizingCallback( + tokenFileReflectionOption, result); + final FileTokenizingOption fileTokenizingOption = buildFileTokenReflectionFileTokenizingOption(tokenFileReflectionOption); + final FileToken fileToken = new FileTokenImpl(); + fileToken.tokenize(inputStream, fileTokenizingCallback, + fileTokenizingOption); + return result; + } + + protected void assertFileTokenReflectionOption( + TokenFileReflectionOption tokenFileReflectionOption) { + assertObjectNotNull("tokenFileReflectionOption", + tokenFileReflectionOption); + + final String encoding = tokenFileReflectionOption.getEncoding(); + final String delimiter = tokenFileReflectionOption.getDelimiter(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + } + + protected TokenFileReflectionResult buildTokenFileReflectionResult() { + final TokenFileReflectionResult result = new TokenFileReflectionResult(); + final java.util.List<TokenFileReflectionFailure> failureList = new java.util.ArrayList<TokenFileReflectionFailure>(); + result.setFailureList(failureList); + return result; + } + + protected FileTokenizingCallback buildFileTokenReflectionFileTokenizingCallback( + TokenFileReflectionOption tokenFileReflectionOption, + final TokenFileReflectionResult result) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("tokenFileReflectionOption", + tokenFileReflectionOption); + + final String encoding = tokenFileReflectionOption.getEncoding(); + final String delimiter = tokenFileReflectionOption.getDelimiter(); + final boolean interruptIfError = tokenFileReflectionOption + .isInterruptIfError(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + final java.util.List<TokenFileReflectionFailure> failureList = result + .getFailureList(); + assertObjectNotNull("failureList", failureList); + + final FileTokenizingCallback fileTokenizingCallback = new FileTokenizingCallback() { + public void handleRowResource( + FileTokenizingRowResource fileTokenizingRowResource) { + final FileTokenizingHeaderInfo fileTokenizingHeaderInfo = fileTokenizingRowResource + .getFileTokenizingHeaderInfo(); + final java.util.List<String> columnNameList = fileTokenizingHeaderInfo + .getColumnNameList(); + final java.util.List<String> valueList = fileTokenizingRowResource + .getValueList(); + + // Set up columnNameList of result object. + if (result.getColumnNameList() == null) { + result.setColumnNameList(columnNameList); + } + + Entity entity = null; + try { + // Create entity by the list of value composed of + // String. + entity = createEntityByStringValueList(columnNameList, + valueList); + + // Create or modify as non-strict. + doCreateOrUpdateNonstrict(entity); + + // Increment successCount of result object. + result.incrementSuccessCount(); + } catch (RuntimeException e) { + if (interruptIfError) { + throw e; + } + final TokenFileReflectionFailure failure = new TokenFileReflectionFailure(); + failure.setColumnNameList(columnNameList); + failure.setValueList(valueList); + failure.setRowString(fileTokenizingRowResource + .getRowString()); + failure.setRowNumber(fileTokenizingRowResource + .getRowNumber()); + failure.setLineNumber(fileTokenizingRowResource + .getLineNumber()); + if (entity != null) { + failure.setEntity(entity); + } + failure.setException(e); + failureList.add(failure); + } + } + }; + return fileTokenizingCallback; + } + + protected Entity createEntityByStringValueList( + java.util.List<String> columnNameList, + java.util.List<String> valueList) { + final MapStringBuilder builder = new MapStringBuilderImpl(); + builder.setMsMapMark(MAP_STRING_MAP_MARK); + builder.setMsStartBrace(MAP_STRING_START_BRACE); + builder.setMsEndBrace(MAP_STRING_END_BRACE); + builder.setMsDelimiter(MAP_STRING_DELIMITER); + builder.setMsEqual(MAP_STRING_EQUAL); + builder.setColumnNameList(columnNameList); + final String mapString = builder.buildFromList(valueList); + + final Entity entity = getDBMeta().newEntity(); + getDBMeta().acceptColumnValueMapString(entity, mapString); + return entity; + } + + protected FileTokenizingOption buildFileTokenReflectionFileTokenizingOption( + TokenFileReflectionOption tokenFileReflectionOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("tokenFileReflectionOption", + tokenFileReflectionOption); + + final String encoding = tokenFileReflectionOption.getEncoding(); + final String delimiter = tokenFileReflectionOption.getDelimiter(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + + final FileTokenizingOption fileTokenizingOption = new FileTokenizingOption(); + fileTokenizingOption.setEncoding(encoding); + fileTokenizingOption.setDelimiter(delimiter); + if (tokenFileReflectionOption.isHandleEmptyAsNull()) { + fileTokenizingOption.handleEmptyAsNull(); + } + return fileTokenizingOption; + } + } + + //========================================================================== + // =========== + // Delegate Method + // =============== + // ----------------------------------------------------- + // Insert + // ------ + /** + * The implementation. + * + * @param entity Entity that the type is entity interface. (NotNull) + * @return Inserted count. + */ + protected int callCreate(Entity entity) { + if (!processBeforeInsert(entity)) { + return 1;/* as Normal End */ + } + return getDaoWritable().create(entity); + } + + /** + * Process before insert. + * + * @param entity Entity that the type is entity interface. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean processBeforeInsert(Entity entity) { + if (!determineExecuteInsert(entity)) { + return false; + } + assertEntityNotNull(entity);// If this table use identity, the entity + // does not have primary-key. + frameworkFilterEntityOfInsert(entity); + filterEntityOfInsert(entity); + assertEntityOfInsert(entity); + return true; + } + + // ----------------------------------------------------- + // Update + // ------ + /** + * The implementation. {modified only} + * + * @param entity Entity that the type is entity interface. (NotNull) + * @return Updated count. + */ + protected int callModify(Entity entity) { + if (!processBeforeUpdate(entity)) { + return 1;/* as Normal End */ + } + return getDaoWritable().modifyModifiedOnly(entity); + } + + /** + * Process before update. + * + * @param entity Entity that the type is entity interface. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean processBeforeUpdate(Entity entity) { + if (!determineExecuteUpdate(entity)) { + return false; + } + assertEntityNotNullAndHasPrimaryKeyValue(entity); + frameworkFilterEntityOfUpdate(entity); + filterEntityOfUpdate(entity); + assertEntityOfUpdate(entity); + return true; + } + + // ----------------------------------------------------- + // Delete + // ------ + /** + * The implementation. + * + * @param entity Entity that the type is entity interface. (NotNull) + * @return Deleted count. + */ + protected int callRemove(Entity entity) { + if (!processBeforeDelete(entity)) { + return 1;/* as Normal End */ + } + return getDaoWritable().remove(entity); + } + + /** + * Process before delete. + * + * @param entity Entity that the type is entity interface. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean processBeforeDelete(Entity entity) { + if (!determineExecuteDelete(entity)) { + return false; + } + assertEntityNotNullAndHasPrimaryKeyValue(entity); + frameworkFilterEntityOfDelete(entity); + filterEntityOfDelete(entity); + assertEntityOfDelete(entity); + return true; + } + + // ----------------------------------------------------- + // Pre-Process Insert + // ------------------ + /** + * Determine execution of insert. + * + * @param entity Entity. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean determineExecuteInsert(Entity entity) { + return true; + } + + /** + * {Framework Method} Filter the entity of insert. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void frameworkFilterEntityOfInsert(Entity targetEntity) { + injectSequenceToPrimaryKeyIfNeeds(targetEntity); + setupCommonColumnOfInsertIfNeeds(targetEntity); + } + + /** + * Set up common columns of insert if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void setupCommonColumnOfInsertIfNeeds(Entity targetEntity) { + } + + /** + * Filter the entity of insert. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void filterEntityOfInsert(Entity targetEntity) { + } + + /** + * Assert the entity of insert. + * + * @param entity Entity that the type is entity interface. (NotNull) + */ + protected void assertEntityOfInsert(Entity entity) { + } + + // ----------------------------------------------------- + // Pre-Process Update + // ------------------ + /** + * Determine execution of update. + * + * @param entity Entity. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean determineExecuteUpdate(Entity entity) { + return true; + } + + /** + * {Framework Method} Filter the entity of update. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void frameworkFilterEntityOfUpdate(Entity targetEntity) { + setupCommonColumnOfUpdateIfNeeds(targetEntity); + } + + /** + * Set up common columns of update if it needs. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void setupCommonColumnOfUpdateIfNeeds(Entity targetEntity) { + } + + /** + * Filter the entity of update. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void filterEntityOfUpdate(Entity targetEntity) { + } + + /** + * Assert the entity of update. + * + * @param entity Entity that the type is entity interface. (NotNull) + */ + protected void assertEntityOfUpdate(Entity entity) { + } + + // ----------------------------------------------------- + // Pre-Process Delete + // ------------------ + /** + * Determine execution of delete. + * + * @param entity Entity. (NotNull) + * @return Execution Determination. (true: execute / false: non) + */ + protected boolean determineExecuteDelete(Entity entity) { + return true; + } + + /** + * {Framework Method} Filter the entity of delete. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void frameworkFilterEntityOfDelete(Entity targetEntity) { + } + + /** + * Filter the entity of delete. + * + * @param targetEntity Target entity that the type is entity interface. + * (NotNull) + */ + protected void filterEntityOfDelete(Entity targetEntity) { + } + + /** + * Assert the entity of delete. + * + * @param entity Entity that the type is entity interface. (NotNull) + */ + protected void assertEntityOfDelete(Entity entity) { + } + + /** + * The implementation. + * + * @param entityList Entity list that the type is entity interface. + * (NotNull) + * @return Inserted count. + */ + public int[] callCreateList(java.util.List<Entity> entityList) { + assertObjectNotNull("entityList", entityList); + helpFilterBeforeInsertInternally(entityList); + return getDaoWritable().createList(entityList); + } + + /** + * The implementation. + * + * @param entityList Entity list that the type is entity interface. + * (NotNull) + * @return Updated count. + */ + public int[] callModifyList(java.util.List<Entity> entityList) { + assertObjectNotNull("entityList", entityList); + helpFilterBeforeUpdateInternally(entityList); + return getDaoWritable().modifyList(entityList); + } + + /** + * The implementation. + * + * @param entityList Entity list that the type is entity interface. + * (NotNull) + * @return Deleted count. + */ + public int[] callRemoveList(java.util.List<Entity> entityList) { + assertObjectNotNull("entityList", entityList); + helpFilterBeforeDeleteInternally(entityList); + return getDaoWritable().removeList(entityList); + } + + protected void assertEntityHasVersionNoValue(Entity entity) { + if (!getDBMeta().hasVersionNo()) { + return; + } + if (hasVersionNoValue(entity)) { + return; + } + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The value of 'version no' on the entity was Not Found!" + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of the value of 'version no' on the entity." + + getLineSeparator(); + msg = msg + + "You called the method in which the check for optimistic lock is indispensable. " + + getLineSeparator(); + msg = msg + "So 'version no' is required on the entity. " + + getLineSeparator(); + msg = msg + + "In addition, please confirm the necessity of optimistic lock. It might possibly be unnecessary." + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Entity]" + getLineSeparator(); + msg = msg + "entity to string = " + entity + getLineSeparator(); + msg = msg + "entity to map = " + + entity.getDBMeta().convertToColumnValueMap(entity) + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new OptimisticLockColumnValueNullException(msg); + } + + protected void assertEntityHasUpdateDateValue(Entity entity) { + if (!getDBMeta().hasUpdateDate()) { + return; + } + if (hasUpdateDateValue(entity)) { + return; + } + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The value of 'update date' on the entity was Not Found!" + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of the value of 'update date' on the entity." + + getLineSeparator(); + msg = msg + + "You called the method in which the check for optimistic lock is indispensable. " + + getLineSeparator(); + msg = msg + "So 'update date' is required on the entity. " + + getLineSeparator(); + msg = msg + + "In addition, please confirm the necessity of optimistic lock. It might possibly be unnecessary." + + getLineSeparator() + getLineSeparator(); + msg = msg + "[Entity]" + getLineSeparator(); + msg = msg + "entity to string = " + entity + getLineSeparator(); + msg = msg + "entity to map = " + + entity.getDBMeta().convertToColumnValueMap(entity) + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new OptimisticLockColumnValueNullException(msg); + } + + public static class OptimisticLockColumnValueNullException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public OptimisticLockColumnValueNullException(String msg) { + super(msg); + } + } + + //========================================================================== + // ========= + // Delegate Method Internal Helper + // =============================== + protected <ENTITY extends Entity> List<ENTITY> helpFilterBeforeInsertInternally( + List<ENTITY> entityList) { + final List<ENTITY> filteredList = new ArrayList<ENTITY>(); + for (final Iterator<ENTITY> ite = entityList.iterator(); ite.hasNext();) { + final ENTITY entity = ite.next(); + if (!processBeforeInsert(entity)) { + continue; + } + filteredList.add(entity); + } + return filteredList; + } + + protected <ENTITY extends Entity> List<ENTITY> helpFilterBeforeUpdateInternally( + List<ENTITY> entityList) { + final List<ENTITY> filteredList = new ArrayList<ENTITY>(); + for (final Iterator<ENTITY> ite = entityList.iterator(); ite.hasNext();) { + final ENTITY entity = ite.next(); + if (!processBeforeUpdate(entity)) { + continue; + } + filteredList.add(entity); + } + return filteredList; + } + + protected <ENTITY extends Entity> List<ENTITY> helpFilterBeforeDeleteInternally( + List<ENTITY> entityList) { + final List<ENTITY> filteredList = new ArrayList<ENTITY>(); + for (final Iterator<ENTITY> ite = entityList.iterator(); ite.hasNext();) { + final ENTITY entity = ite.next(); + if (!processBeforeDelete(entity)) { + continue; + } + filteredList.add(entity); + } + return filteredList; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/AbstractBehaviorWritable.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorReadable.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorReadable.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorReadable.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,176 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +/** + * The interface of behavior-readable. + * + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorReadable { + + //========================================================================== + // ========= + // 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. + * + * @return Table db-name. (NotNull) + */ + public String getTableDbName(); + + //========================================================================== + // ========= + // DBMeta + // ====== + /** + * Get dbmeta. + * + * @return DBMeta. (NotNull) + */ + public DBMeta getDBMeta(); + + //========================================================================== + // ========= + // Dao Accessor + // ============ + /** + * Get dao-readable. + * + * @return Dao-readable. (NotNull) + */ + public DaoReadable getDaoReadable(); + + //========================================================================== + // ========= + // New Instance + // ============ + /** + * New entity. + * + * @return Entity. (NotNull) + */ + public Entity newEntity(); + + /** + * New condition-bean. + * + * @return Condition-bean. (NotNull) + */ + public ConditionBean newConditionBean(); + + //========================================================================== + // ========= + // Basic Get All + // ============= + /** + * Get count all. + * + * @return Count all. + */ + public int getCountAll(); + + //========================================================================== + // ========= + // Basic Read Count + // ================ + /** + * Read count by condition-bean. + * + * <pre> + * If the argument 'condition-bean' is effective about fetch-scope, + * this method invoke select count ignoring the fetch-scope. + * </pre> + * + * @param cb Condition-bean. This condition-bean should not be set up about + * fetch-scope. (NotNull) + * @return Read count. (NotNull) + */ + public int readCount(ConditionBean cb); + + //========================================================================== + // ========= + // Basic Read Entity + // ================= + /** + * Read entity by condition-bean. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public Entity readEntity(ConditionBean cb); + + /** + * Read simple entity by condition-bean with deleted check. + * + * @param cb Condition-bean. (NotNull) + * @return Read entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public Entity readEntityWithDeletedCheck(ConditionBean cb); + + //========================================================================== + // ========= + // Basic Read List + // =============== + /** + * Read list as result-bean. + * + * @param cb Condition-bean. (NotNull) + * @return List-result-bean. If the select result is zero, it returns empty + * list. (NotNull) + */ + public ListResultBean<Entity> readList(ConditionBean cb); + + /** + * Read page as result-bean. + * + * @param cb Condition-bean. (NotNull) + * @return Read page. (NotNull) + */ + public PagingResultBean<Entity> readPage(final ConditionBean cb); + + //========================================================================== + // ========= + // Sequence + // ======== + /** + * The implementation. + * + * @return The value of sequence. (NotNull) + */ + public java.math.BigDecimal readNextVal(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorReadable.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorWritable.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorWritable.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorWritable.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,149 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv; + +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; + +/** + * The interface of behavior-writable. + * + * @author DBFlute(AutoGenerator) + */ +public interface BehaviorWritable extends BehaviorReadable { + + /** + * Get dao-writable. + * + * @return Dao-writable. (NotNull) + */ + public DaoWritable getDaoWritable(); + + //========================================================================== + // =========== + // Basic Entity Update + // =================== + /** + * Create. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void create(jp.sf.pal.scheduler.db.allcommon.Entity entity); + + /** + * Modify. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void modify(jp.sf.pal.scheduler.db.allcommon.Entity entity); + + /** + * Modify non-strict. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void modifyNonstrict(Entity entity); + + /** + * Create or modify. <br /> {modify: modified only} <br /> This method is + * faster than createOrModifyAfterSelect(). + * + * @param entity Entity. This must contain primary-key value at least(Except + * use identity). (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void createOrModify(jp.sf.pal.scheduler.db.allcommon.Entity entity); + + /** + * Create or modify non-strict. <br /> {modify: modified only} <br /> This + * method is faster than createOrModifyAfterSelect(). + * + * @param entity Entity. This must contain primary-key value at least(Except + * use identity). (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void createOrModifyNonstrict( + jp.sf.pal.scheduler.db.allcommon.Entity entity); + + /** + * Remove. + * + * @param entity Entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void remove(jp.sf.pal.scheduler.db.allcommon.Entity entity); + + //========================================================================== + // =========== + // Basic Batch Update + // ================== + /** + * Lump create the list. + * + * @param entityList Entity-list. (NotNull and NotEmpty) + * @return The array of created count. + */ + public int[] lumpCreate(java.util.List<Entity> entityList); + + /** + * Lump Modify the list. + * + * @param entityList Entity-list. (NotNull and NotEmpty) + * @return Modified count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. And Only when + * s2dao's version is over 1.0.47 (contains 1.0.47). + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public int[] lumpModify(java.util.List<Entity> entityList); + + /** + * Lump remove the list. + * + * @param entityList Entity-list. (NotNull and NotEmpty) + * @return Removed count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. And Only when + * s2dao's version is over 1.0.47 (contains 1.0.47). + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public int[] lumpRemove(java.util.List<Entity> entityList); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/BehaviorWritable.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,90 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.batch; + +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileOutputOption { + + //========================================================================== + // =========== + // Attribute + // ========= + protected FileMakingOption _fileMakingOption = new FileMakingOption(); + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + public TokenFileOutputOption delimitateByComma() { + _fileMakingOption.delimitateByComma(); + return this; + } + + public TokenFileOutputOption delimitateByTab() { + _fileMakingOption.delimitateByTab(); + return this; + } + + public TokenFileOutputOption encodeAsUTF8() { + _fileMakingOption.encodeAsUTF8(); + return this; + } + + public TokenFileOutputOption encodeAsWindows31J() { + _fileMakingOption.encodeAsWindows31J(); + return this; + } + + public TokenFileOutputOption separateCrLf() { + _fileMakingOption.separateCrLf(); + return this; + } + + public TokenFileOutputOption separateLf() { + _fileMakingOption.separateLf(); + return this; + } + + public TokenFileOutputOption goodByeDoubleQuotation() { + _fileMakingOption.goodByeDoubleQuotation(); + return this; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public String getEncoding() { + return _fileMakingOption.getEncoding(); + } + + public void setEncoding(String encoding) { + _fileMakingOption.setDelimiter(encoding); + } + + public String getDelimiter() { + return _fileMakingOption.getDelimiter(); + } + + public void setDelimiter(String delimiter) { + _fileMakingOption.setDelimiter(delimiter); + } + + public String getLineSeparator() { + return _fileMakingOption.getLineSeparator(); + } + + public void setLineSeparator(String lineSeparator) { + _fileMakingOption.setLineSeparator(lineSeparator); + } + + public boolean isGoodByeDoubleQuotation() { + return _fileMakingOption.isGoodByeDoubleQuotation(); + } + + public FileMakingOption getFileMakingOption() { + return _fileMakingOption; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputResult.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputResult.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputResult.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,27 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.batch; + +import jp.sf.pal.scheduler.db.allcommon.Entity; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileOutputResult { + + //========================================================================== + // =========== + // Attribute + // ========= + protected java.util.List<Entity> _selectedList; + + //========================================================================== + // =========== + // Accessor + // ======== + public java.util.List<Entity> getSelectedList() { + return _selectedList; + } + + public void setSelectedList(java.util.List<Entity> selectedList) { + _selectedList = selectedList; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileOutputResult.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionFailure.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionFailure.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionFailure.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,89 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.batch; + +import jp.sf.pal.scheduler.db.allcommon.Entity; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileReflectionFailure { + + //========================================================================== + // =========== + // Attribute + // ========= + protected java.util.List<String> _columnNameList; + + protected java.util.List<String> _valueList; + + protected String rowString; + + /** The row number. */ + protected int _rowNumber; + + /** The line number. */ + protected int _lineNumber; + + protected Entity _entity; + + protected Exception _exception; + + //========================================================================== + // =========== + // Accessor + // ======== + public java.util.List<String> getColumnNameList() { + return _columnNameList; + } + + public void setColumnNameList(java.util.List<String> columnNameList) { + this._columnNameList = columnNameList; + } + + public java.util.List<String> getValueList() { + return _valueList; + } + + public void setValueList(java.util.List<String> valueList) { + this._valueList = valueList; + } + + public String getRowString() { + return rowString; + } + + public void setRowString(String rowString) { + this.rowString = rowString; + } + + public int getRowNumber() { + return _rowNumber; + } + + public void setRowNumber(int rowNumber) { + _rowNumber = rowNumber; + } + + public int getLineNumber() { + return _lineNumber; + } + + public void setLineNumber(int lineNumber) { + _lineNumber = lineNumber; + } + + public Entity getEntity() { + return _entity; + } + + public void setEntity(Entity value) { + _entity = value; + } + + public Exception getException() { + return _exception; + } + + public void setException(Exception value) { + _exception = value; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionFailure.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,79 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.batch; + +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileReflectionOption { + + //========================================================================== + // =========== + // Attribute + // ========= + protected boolean _interruptIfError; + + protected FileTokenizingOption _fileTokenizingOption = new FileTokenizingOption(); + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + public TokenFileReflectionOption delimitateByComma() { + _fileTokenizingOption.delimitateByComma(); + return this; + } + + public TokenFileReflectionOption delimitateByTab() { + _fileTokenizingOption.delimitateByTab(); + return this; + } + + public TokenFileReflectionOption encodeAsUTF8() { + _fileTokenizingOption.encodeAsUTF8(); + return this; + } + + public TokenFileReflectionOption encodeAsWindows31J() { + _fileTokenizingOption.encodeAsWindows31J(); + return this; + } + + public TokenFileReflectionOption handleEmptyAsNull() { + _fileTokenizingOption.handleEmptyAsNull(); + return this; + } + + public TokenFileReflectionOption interruptIfError() { + _interruptIfError = true; + return this; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public String getDelimiter() { + return _fileTokenizingOption.getDelimiter(); + } + + public void setDelimiter(String delimiter) { + _fileTokenizingOption.setDelimiter(delimiter); + } + + public String getEncoding() { + return _fileTokenizingOption.getEncoding(); + } + + public void setEncoding(String encoding) { + _fileTokenizingOption.setDelimiter(encoding); + } + + public boolean isHandleEmptyAsNull() { + return _fileTokenizingOption.isHandleEmptyAsNull(); + } + + public boolean isInterruptIfError() { + return _interruptIfError; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionResult.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionResult.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionResult.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,54 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.batch; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TokenFileReflectionResult { + + //========================================================================== + // =========== + // Attribute + // ========= + protected java.util.List<String> _columnNameList; + + protected int _successCount; + + protected java.util.List<TokenFileReflectionFailure> _failureList; + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + public void incrementSuccessCount() { + ++_successCount; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public java.util.List<String> getColumnNameList() { + return _columnNameList; + } + + public void setColumnNameList(java.util.List<String> columnNameList) { + this._columnNameList = columnNameList; + } + + public int getSuccessCount() { + return _successCount; + } + + public void setSuccessCount(int successCount) { + _successCount = successCount; + } + + public java.util.List<TokenFileReflectionFailure> getFailureList() { + return _failureList; + } + + public void setFailureList( + java.util.List<TokenFileReflectionFailure> failureList) { + this._failureList = failureList; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/batch/TokenFileReflectionResult.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/load/LoadReferrerOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/load/LoadReferrerOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/load/LoadReferrerOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,146 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.load; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.EntityListSetupper; +import jp.sf.pal.scheduler.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 LoadReferrerOption<REFERRER_CONDITION_BEAN extends ConditionBean, REFERRER_ENTITY extends Entity> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ConditionBeanSetupper<REFERRER_CONDITION_BEAN> _conditionBeanSetupper; + + protected EntityListSetupper<REFERRER_ENTITY> _entityListSetupper; + + protected REFERRER_CONDITION_BEAN _referrerConditionBean; + + protected boolean _toLastKeyCondition; + + protected boolean _stopOrderByKey; + + //========================================================================== + // ========= + // Constructor + // =========== + public LoadReferrerOption() { + } + + public LoadReferrerOption( + ConditionBeanSetupper<REFERRER_CONDITION_BEAN> conditionBeanSetupper) { + this._conditionBeanSetupper = conditionBeanSetupper; + } + + public LoadReferrerOption( + ConditionBeanSetupper<REFERRER_CONDITION_BEAN> conditionBeanSetupper, + EntityListSetupper<REFERRER_ENTITY> entityListSetupper) { + this._conditionBeanSetupper = conditionBeanSetupper; + this._entityListSetupper = entityListSetupper; + } + + public LoadReferrerOption( + LoadReferrerOption<REFERRER_CONDITION_BEAN, REFERRER_ENTITY> option) { + this._conditionBeanSetupper = option._conditionBeanSetupper; + this._entityListSetupper = option._entityListSetupper; + this._referrerConditionBean = option._referrerConditionBean; + this._toLastKeyCondition = option._toLastKeyCondition; + this._stopOrderByKey = option._stopOrderByKey; + } + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + /** + * Specify that the key condition is added as last condition. <br /> This + * method is valid only after you use reffererConditionBean and add your + * original condition to it. + * + * @return this. (NotNull) + */ + public LoadReferrerOption<REFERRER_CONDITION_BEAN, REFERRER_ENTITY> toLastKeyCondition() { + _toLastKeyCondition = true; + return this; + } + + /** + * Specify that it stops adding order-by of the key. <br /> This method is + * valid only after you use reffererConditionBean and add your original + * order-by to it. + * + * @return this. (NotNull) + */ + public LoadReferrerOption<REFERRER_CONDITION_BEAN, REFERRER_ENTITY> stopOrderByKey() { + _stopOrderByKey = true; + return this; + } + + public void delegateKeyConditionExchangingFirstWhereClauseForLastOne( + REFERRER_CONDITION_BEAN cb) {// Internal + if (!_toLastKeyCondition) { + cb.getSqlClause().exchangeFirstWhereClauseForLastOne(); + } + } + + public void delegateConditionBeanSettingUp(REFERRER_CONDITION_BEAN cb) {// Internal + if (_conditionBeanSetupper != null) { + _conditionBeanSetupper.setup(cb); + } + } + + public void delegateEntitySettingUp(List<REFERRER_ENTITY> entityList) {// Internal + if (_entityListSetupper != null) { + _entityListSetupper.setup(entityList); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ConditionBeanSetupper<REFERRER_CONDITION_BEAN> getConditionBeanSetupper() { + return _conditionBeanSetupper; + } + + public void setConditionBeanSetupper( + ConditionBeanSetupper<REFERRER_CONDITION_BEAN> conditionBeanSetupper) { + this._conditionBeanSetupper = conditionBeanSetupper; + } + + public EntityListSetupper<REFERRER_ENTITY> getEntityListSetupper() { + return _entityListSetupper; + } + + public void setEntityListSetupper( + EntityListSetupper<REFERRER_ENTITY> entityListSetupper) { + this._entityListSetupper = entityListSetupper; + } + + public REFERRER_CONDITION_BEAN getReferrerConditionBean() { + return _referrerConditionBean; + } + + public void setReferrerConditionBean( + REFERRER_CONDITION_BEAN referrerConditionBean) { + this._referrerConditionBean = referrerConditionBean; + } + + public boolean isToLastKeyCondition() { + return _toLastKeyCondition; + } + + public boolean isStopOrderByKey() { + return _stopOrderByKey; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/load/LoadReferrerOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ConditionBeanSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ConditionBeanSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ConditionBeanSetupper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.setup; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; + +/** + * The interface of condition-bean setupper. + * + * @param <CONDITION_BEAN> The type of condition-bean. + * @author DBFlute(AutoGenerator) + */ +public interface ConditionBeanSetupper<CONDITION_BEAN extends ConditionBean> { + + /** + * Set up condition. + * + * @param cb Condition-bean. (NotNull) + */ + public void setup(CONDITION_BEAN cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ConditionBeanSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/EntityListSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/EntityListSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/EntityListSetupper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.setup; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.Entity; + +/** + * The interface of entity list setupper. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface EntityListSetupper<ENTITY extends Entity> { + + /** + * Set up the list of entity. + * + * @param entityList The list of entity. (NotNull) + */ + public void setup(List<ENTITY> entityList); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/EntityListSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelBox.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelBox.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelBox.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,26 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.setup; + +/** + * The class of Value-Label Box. + * + * @author DBFlute(AutoGenerator) + */ +public class ValueLabelBox { + + protected Object _value; + + protected String _label; + + public void setValueLabel(Object value, String label) { + this._value = value; + this._label = label; + } + + public Object getValue() { + return _value; + } + + public String getLabel() { + return _label; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelBox.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelSetupper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,20 @@ +package jp.sf.pal.scheduler.db.allcommon.bhv.setup; + +import jp.sf.pal.scheduler.db.allcommon.Entity; + +/** + * The interface of Value-Label Setupper. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface ValueLabelSetupper<ENTITY extends Entity> { + + /** + * Set up value-label. + * + * @param box Value-label box. (NotNull) + * @param entity Entity. (NotNull) + */ + public void setup(ValueLabelBox box, ENTITY entity); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/bhv/setup/ValueLabelSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1199 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.OrderByClause; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.WhereClauseSimpleFilter; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.MapListString; +import jp.sf.pal.scheduler.db.allcommon.helper.MapListStringImpl; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * The condition-bean as abstract. + * + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractConditionBean implements ConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + /** SQL clause instance. */ + protected final SqlClause _sqlClause; + { + _sqlClause = ConditionBeanContext.createSqlClause(this); + } + + /** Safety max result size. */ + protected int _safetyMaxResultSize; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + // [DBFlute-0.7.4] @jflute -- At the future, I'll implement some check + // logics by these purpose types. + protected boolean _forDeriveReferrer; + + protected boolean _forUnion; + + protected boolean _forExistsSubQuery; + + protected boolean _forInScopeSubQuery; + + //========================================================================== + // ========= + // SqlClause + // ========= + /** + * The implementation. + * + * @return Sql clause. (NotNull) + */ + public SqlClause getSqlClause() { + return _sqlClause; + } + + //========================================================================== + // ========= + // Where Clause Filter + // =================== + public void addWhereClauseSimpleFilter( + WhereClauseSimpleFilter whereClauseSimpleFilter) { + this._sqlClause.addWhereClauseSimpleFilter(whereClauseSimpleFilter); + } + + //========================================================================== + // ========= + // 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 + // ================= + /** + * The implementation. + * + * @param primaryKeyMapString Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMapString(String primaryKeyMapString) { + if (primaryKeyMapString == null) { + String msg = "The argument[primaryKeyMapString] must not be null."; + throw new IllegalArgumentException(msg); + } + final String prefix = MAP_STRING_MAP_MARK + MAP_STRING_START_BRACE; + final String suffix = MAP_STRING_END_BRACE; + if (!primaryKeyMapString.trim().startsWith(prefix)) { + primaryKeyMapString = prefix + primaryKeyMapString; + } + if (!primaryKeyMapString.trim().endsWith(suffix)) { + primaryKeyMapString = primaryKeyMapString + suffix; + } + MapListString mapListString = new MapListStringImpl(); + mapListString.setMapMark(MAP_STRING_MAP_MARK); + mapListString.setListMark(MAP_STRING_LIST_MARK); + mapListString.setDelimiter(MAP_STRING_DELIMITER); + mapListString.setStartBrace(MAP_STRING_START_BRACE); + mapListString.setEndBrace(MAP_STRING_END_BRACE); + mapListString.setEqual(MAP_STRING_EQUAL); + acceptPrimaryKeyMap(mapListString.generateMap(primaryKeyMapString)); + } + + protected void checkTypeString(Object value, String propertyName, + String typeName) { + if (value == null) { + throw new IllegalArgumentException("The value should not be null: " + + propertyName); + } + if (!(value instanceof String)) { + String msg = "The value of " + propertyName + " should be " + + typeName + " or String: "; + msg = msg + "valueType=" + value.getClass() + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + protected long parseDateStringAsMillis(Object value, String propertyName, + String typeName) { + checkTypeString(value, propertyName, typeName); + try { + final String valueString = (String) value; + if (valueString.indexOf("-") >= 0 + && valueString.indexOf("-") != valueString.lastIndexOf("-")) { + return java.sql.Timestamp.valueOf(valueString).getTime(); + } else { + return getParseDateFormat().parse((String) value).getTime(); + } + } catch (java.text.ParseException e) { + String msg = "The value of " + propertyName + " should be " + + typeName + ". but: " + value; + throw new RuntimeException(msg + " threw the exception: value=[" + + value + "]", e); + } catch (RuntimeException e) { + String msg = "The value of " + propertyName + " should be " + + typeName + ". but: " + value; + throw new RuntimeException(msg + " threw the exception: value=[" + + value + "]", e); + } + } + + private java.text.DateFormat getParseDateFormat() { + return java.text.DateFormat.getDateTimeInstance(); + } + + //========================================================================== + // ========= + // Implementation of PagingBean + // ============================ + // ----------------------------------------------------- + // Paging Determination + // -------------------- + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * The implementation. + * + * @return Determination. + */ + public boolean isPaging() { + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + // * * * * * * * * + // For Framework + // * * * * * * * * + /** + * The implementation. + * + * @return Determination. + */ + public boolean isCountLater() { + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + // ----------------------------------------------------- + // Paging Setting + // -------------- + /** + * The implementation. + * + * @param pageSize The page size per one page. (NotMinus & NotZero) + * @param pageNumber The number of page. It's ONE origin. (NotMinus & + * NotZero: If it's minus or zero, it treats as one.) + */ + public void paging(int pageSize, int pageNumber) { + fetchFirst(pageSize); + fetchPage(pageNumber); + } + + /** + * The implementation. + * + * @param paging Determination. + */ + public void xsetPaging(boolean paging) {// Very Internal! + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + // ----------------------------------------------------- + // Fetch Setting + // ------------- + /** + * The implementation. + * + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNUll) + */ + public PagingBean fetchFirst(int fetchSize) { + getSqlClause().fetchFirst(fetchSize); + return this; + } + + /** + * The implementation. + * + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNUll) + */ + public PagingBean fetchScope(int fetchStartIndex, int fetchSize) { + getSqlClause().fetchScope(fetchStartIndex, fetchSize); + return this; + } + + /** + * The implementation. + * + * @param fetchPageNumber Fetch-page-number. 1 origin. (NotMinus & NotZero: + * If minus or zero, set one.) + * @return this. (NotNull) + */ + public PagingBean fetchPage(int fetchPageNumber) { + getSqlClause().fetchPage(fetchPageNumber); + return this; + } + + // ----------------------------------------------------- + // Fetch Property + // -------------- + /** + * The implementation. + * + * @return Fetch-start-index. + */ + public int getFetchStartIndex() { + return getSqlClause().getFetchStartIndex(); + } + + /** + * The implementation. + * + * @return Fetch-size. + */ + public int getFetchSize() { + return getSqlClause().getFetchSize(); + } + + /** + * The implementation. + * + * @return Fetch-page-number. + */ + public int getFetchPageNumber() { + return getSqlClause().getFetchPageNumber(); + } + + /** + * The implementation. + * + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex() { + return getSqlClause().getPageStartIndex(); + } + + /** + * The implementation. + * + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex() { + return getSqlClause().getPageEndIndex(); + } + + /** + * Is fetch scope effective? + * + * @return Determiantion. + */ + public boolean isFetchScopeEffective() { + return getSqlClause().isFetchScopeEffective(); + } + + // ----------------------------------------------------- + // Hint Property + // ------------- + /** + * Get select-hint. {select [select-hint] * from table...} + * + * @return select-hint. (NotNull) + */ + public String getSelectHint() { + return getSqlClause().getSelectHint(); + } + + /** + * Get from-base-table-hint. {select * from table [from-base-table-hint] + * where ...} + * + * @return from-base-table-hint. (NotNull) + */ + public String getFromBaseTableHint() { + return getSqlClause().getFromBaseTableHint(); + } + + /** + * Get from-hint. {select * from table left outer join ... on ... + * [from-hint] where ...} + * + * @return from-hint. (NotNull) + */ + public String getFromHint() { + return getSqlClause().getFromHint(); + } + + /** + * Get sql-suffix. {select * from table where ... order by ... [sql-suffix]} + * + * @return Sql-suffix. (NotNull) + */ + public String getSqlSuffix() { + return getSqlClause().getSqlSuffix(); + } + + //========================================================================== + // ========= + // Implementation of FetchNarrowingBean + // ==================================== + /** + * The implementation. + * + * @return Fetch start index. + */ + public int getFetchNarrowingSkipStartIndex() { + return getSqlClause().getFetchNarrowingSkipStartIndex(); + } + + /** + * The implementation. + * + * @return Fetch size. + */ + public int getFetchNarrowingLoopCount() { + return getSqlClause().getFetchNarrowingLoopCount(); + } + + /** + * The implementation. + * + * @return Determination. + */ + public boolean isFetchNarrowingSkipStartIndexEffective() { + return !getSqlClause().isFetchStartIndexSupported(); + } + + /** + * The implementation. + * + * @return Determination. + */ + public boolean isFetchNarrowingLoopCountEffective() { + return !getSqlClause().isFetchSizeSupported(); + } + + /** + * The implementation. + * + * @return Determiantion. + */ + public boolean isFetchNarrowingEffective() { + return getSqlClause().isFetchNarrowingEffective(); + } + + /** + * Ignore fetch narrowing. Only checking safety result size is valid. + * {INTERNAL METHOD} + */ + public void ignoreFetchNarrowing() { + String msg = "This method is unsupported on ConditionBean!"; + throw new UnsupportedOperationException(msg); + } + + /** + * Restore ignored fetch narrowing. {INTERNAL METHOD} + */ + public void restoreIgnoredFetchNarrowing() { + // Do nothing! + } + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _safetyMaxResultSize; + } + + /** + * Check safety result. + * + * @param safetyMaxResultSize Safety max result size. (If zero or minus, + * ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize) { + this._safetyMaxResultSize = safetyMaxResultSize; + } + + //========================================================================== + // ========= + // Implementation of OrderByBean + // ============================= + /** + * 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 _sqlClause.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; + } + + //========================================================================== + // ========= + // 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 + // ============ + /** + * The implementation. + * + * @return this. (NotNull) + */ + public ConditionBean lockForUpdate() { + getSqlClause().lockForUpdate(); + return this; + } + + //========================================================================== + // ========= + // Select Count + // ============ + /** + * Set up various things for select-count-ignore-fetch-scope. {Internal} + * This method is for INTERNAL. Don't invoke this! + * + * @return this. (NotNull) + */ + public ConditionBean xsetupSelectCountIgnoreFetchScope() { + _isSelectCountIgnoreFetchScope = true; + + // If the query uses union query, it needs included-select-column. + if (!hasUnionQueryOrUnionAllQuery()) { + getSqlClause().ignoreIncludedSelectColumn(); + } + + getSqlClause().ignoreOrderBy(); + getSqlClause().ignoreFetchScope(); + return this; + } + + /** + * Do after-care for select-count-ignore-fetch-scope. {Internal} This method + * is for INTERNAL. Don't invoke this! + * + * @return this. (NotNull) + */ + public ConditionBean xafterCareSelectCountIgnoreFetchScope() { + _isSelectCountIgnoreFetchScope = false; + + // If the query uses union query, it needs included-select-column. + if (!hasUnionQueryOrUnionAllQuery()) { + getSqlClause().makeIncludedSelectColumnEffective(); + } + + getSqlClause().makeOrderByEffective(); + getSqlClause().makeFetchScopeEffective(); + return this; + } + + /** Is set up various things for select-count-ignore-fetch-scope? */ + protected boolean _isSelectCountIgnoreFetchScope; + + /** + * Is set up various things for select-count-ignore-fetch-scope? This method + * is for INTERNAL. Don't invoke this! + * + * @return Determination. + */ + public boolean isSelectCountIgnoreFetchScope() { + return _isSelectCountIgnoreFetchScope; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected static abstract class AbstractSpecification<CQ extends ConditionQuery> { + protected ConditionBean _baseCB; + + protected SpQyCall<CQ> _qyCall; + + protected CQ _query; + + protected boolean _forDeriveReferrer; + + 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? + */ + protected AbstractSpecification(ConditionBean baseCB, + SpQyCall<CQ> qyCall, boolean forDeriveReferrer) { + _baseCB = baseCB; + _qyCall = qyCall; + _forDeriveReferrer = forDeriveReferrer; + } + + protected void doColumn(String columnName) { + assertColumn(columnName); + if (_query == null) { + _query = _qyCall.qy(); + } + if (!_forDeriveReferrer && !alreadySpecifyRequiredColumn) { + alreadySpecifyRequiredColumn = true; + doSpecifyRequiredColumn(); + } + String relationPath = _query.getRelationPath() != null ? _query + .getRelationPath() : ""; + final String tableAliasName; + if (_query.isBaseQuery(_query)) { + tableAliasName = _baseCB.getSqlClause() + .getLocalTableAliasName(); + } else { + tableAliasName = _baseCB.getSqlClause().resolveJoinAliasName( + relationPath, _query.getNestLevel()); + } + _baseCB.getSqlClause().specifySelectColumn(tableAliasName, + columnName); + } + + protected void assertColumn(String columnName) { + if (_query == null && !_qyCall.has()) { + throwSpecifyColumnNotSetupSelectColumnException(columnName); + } + } + + protected void assertForeign(String foreignPropertyName) { + if (_forDeriveReferrer) { + throwDeriveReferrerInvalidForeignSpecificationException(foreignPropertyName); + } + } + + protected abstract void doSpecifyRequiredColumn(); + + protected abstract String getTableDbName(); + + protected void throwSpecifyColumnNotSetupSelectColumnException( + String columnName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "You specified the column that had Not been Set up!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should call setupSelect_[ForeignTable]() before calling specify[ForeignTable]().column[TargetColumn]()." + + 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.specify().specifyMemberStatus().columnMemberStatusName(); // *No!" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + " cb.setupSelect_MemberStatus(); // *Point!" + + getLineSeparator(); + msg = msg + + " cb.specify().specifyMemberStatus().columnMemberStatusName();" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean]" + getLineSeparator() + + _baseCB.getClass().getName() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Column]" + getLineSeparator() + + getTableDbName() + "." + columnName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new SpecifyColumnNotSetupSelectColumnException(msg); + } + + protected void throwDeriveReferrerInvalidForeignSpecificationException( + 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!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified a local table column at condition-bean for derive-sub-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.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyProduct().columnProductName(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified Foreign Property]" + getLineSeparator() + + foreignPropertyName + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new DeriveReferrerInvalidForeignSpecificationException(msg); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + protected static interface SpQyCall<CQ extends ConditionQuery> { + public boolean has(); + + public CQ qy(); + } + + public static class SpecifyColumnNotSetupSelectColumnException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public SpecifyColumnNotSetupSelectColumnException(String msg) { + super(msg); + } + } + + public static class DeriveReferrerInvalidForeignSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public DeriveReferrerInvalidForeignSpecificationException(String msg) { + super(msg); + } + } + + public static class RAFunction<REFERRER_CB extends ConditionBean, LOCAL_CQ extends ConditionQuery> { + protected ConditionBean _baseCB; + + protected LOCAL_CQ _localCQ; + + protected RAQSetupper<REFERRER_CB, LOCAL_CQ> _querySetupper; + + public RAFunction(ConditionBean baseCB, LOCAL_CQ localCQ, + RAQSetupper<REFERRER_CB, LOCAL_CQ> querySetupper) { + _baseCB = baseCB; + _localCQ = localCQ; + _querySetupper = querySetupper; + } + + public void max(SubQuery<REFERRER_CB> subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("max", subQuery, _localCQ, aliasName.trim()); + } + + public void min(SubQuery<REFERRER_CB> subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("min", subQuery, _localCQ, aliasName.trim()); + } + + public void sum(SubQuery<REFERRER_CB> subQuery, String aliasName) { + assertAliasName(aliasName); + _querySetupper.setup("sum", subQuery, _localCQ, aliasName.trim()); + } + + public void avg(SubQuery<REFERRER_CB> subQuery, String aliasName) { + assertAliasName(aliasName); + _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(); + } + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_baseCB + .getTableDbName()); + Method[] methods = dbmeta.getEntityType().getMethods(); + String targetMethodName = "set" + + replaceString(aliasName, "_", "").toLowerCase(); + boolean existsSetterMethod = false; + for (Method method : methods) { + if (!method.getName().startsWith("set")) { + continue; + } + if (targetMethodName.equals(method.getName().toLowerCase())) { + existsSetterMethod = true; + break; + } + } + if (!existsSetterMethod) { + throwDeriveReferrerEntityPropertyNotFoundException(aliasName, + dbmeta.getEntityType()); + } + } + + protected void throwDeriveReferrerInvalidAliasNameException() { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The alias name for derive-referrer was Invalid!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "You should set valid alias name. {NotNull, NotEmpty}" + + 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.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnPurchaseDatetime();" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, null); // *No! {null, \"\", \" \"} are NG!" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnPurchaseDatetime();" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\"); // *Point!" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Local Table]" + getLineSeparator() + + _localCQ.getTableDbName() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new DeriveReferrerInvalidAliasNameException(msg); + } + + protected void throwDeriveReferrerEntityPropertyNotFoundException( + 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!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should implement a property(setter and getter) in the entity." + + getLineSeparator(); + msg = msg + + "Or you should confirm whether the alias name has typo or not." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [ConditionBean Invoking]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + + getLineSeparator(); + msg = msg + + " cb.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnPurchaseDatetime();" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Extended Entity]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " // At the entity of Purchase..." + + getLineSeparator(); + msg = msg + " protected Date _latestPurchaseDatetime;" + + getLineSeparator(); + msg = msg + " public Date getLatestPurchaseDatetime() {" + + getLineSeparator(); + msg = msg + " return _latestPurchaseDatetime;" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + + " public void setLatestPurchaseDatetime(Date latestPurchaseDatetime) {" + + getLineSeparator(); + msg = msg + + " _latestPurchaseDatetime = latestPurchaseDatetime;" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target Entity]" + getLineSeparator() + entityType + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new DeriveReferrerEntityPropertyNotFoundException(msg); + } + + protected String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + public static interface RAQSetupper<REFERRER_CB extends ConditionBean, LOCAL_CQ extends ConditionQuery> { + public void setup(String function, SubQuery<REFERRER_CB> subQuery, + LOCAL_CQ cq, String aliasName); + } + + public static class DeriveReferrerInvalidAliasNameException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public DeriveReferrerInvalidAliasNameException(String msg) { + super(msg); + } + } + + public static class DeriveReferrerEntityPropertyNotFoundException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public DeriveReferrerEntityPropertyNotFoundException(String msg) { + super(msg); + } + } + + //========================================================================== + // =========== + // Statement Config + // ================ + /** + * @param statementConfig The config of statement. (Nullable) + */ + public void configure(StatementConfig statementConfig) { + _statementConfig = statementConfig; + } + + /** + * @return The config of statement. (Nullable) + */ + public StatementConfig getStatementConfig() { + return _statementConfig; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + 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, + getTableDbName(), foreignPropertyName, localRelationPath); + getSqlClause().registerSelectedForeignInfo( + callback.qf().getRelationPath(), foreignPropertyName); + } + + protected static interface SsCall { + public ConditionQuery qf(); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + protected void assertPrimaryKeyMap( + Map<String, ? extends Object> primaryKeyMap) { + if (primaryKeyMap == null) { + String msg = "The argument[primaryKeyMap] must not be null."; + throw new IllegalArgumentException(msg); + } + if (primaryKeyMap.isEmpty()) { + String msg = "The argument[primaryKeyMap] must not be empty."; + throw new IllegalArgumentException(msg); + } + List<ColumnInfo> columnInfoList = DBMetaInstanceHandler.findDBMeta( + getTableDbName()).getPrimaryUniqueInfo().getUniqueColumnList(); + for (ColumnInfo columnInfo : columnInfoList) { + String columnDbName = columnInfo.getColumnDbName(); + if (!primaryKeyMap.containsKey(columnDbName)) { + String msg = "The primaryKeyMap must have the value of " + + columnDbName; + throw new IllegalStateException(msg + ": primaryKeyMap --> " + + primaryKeyMap); + } + } + } + + protected void assertSetupSelectBeforeUnion(String foreignPropertyName) { + if (hasUnionQueryOrUnionAllQuery()) { + throwSetupSelectAfterUnionException( + this.getClass().getSimpleName(), foreignPropertyName); + } + } + + protected void throwSetupSelectAfterUnionException(String className, + String foreignPropertyName) { + String methodName = "setupSelect_" + initCap(foreignPropertyName) + + "()"; + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "You should NOT call " + methodName + + " after calling union()!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + methodName + " should be called before calling union()." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " " + className + " cb = new " + className + "();" + + getLineSeparator(); + msg = msg + " cb." + methodName + "; // You shuold call here!" + + getLineSeparator(); + msg = msg + " cb.query().setXxx...;" + getLineSeparator(); + msg = msg + " cb.union(new UnionQuery<" + className + ">() {" + + getLineSeparator(); + msg = msg + " public void query(" + className + " unionCB) {" + + getLineSeparator(); + msg = msg + " unionCB.query().setXxx...;" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " });" + getLineSeparator(); + msg = msg + + " // You should not call setupSelect after calling union()!" + + getLineSeparator(); + msg = msg + " // cb." + methodName + ";" + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[SetupSelect Method]" + getLineSeparator() + methodName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean SQL]" + getLineSeparator() + toDisplaySql() + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String initCap(String str) { + return SimpleStringUtil.initCap(str); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Display SQL + // =========== + /** + * Convert this conditionBean to SQL for display. + * + * @return SQL for display. (NotNull and NotEmpty) + */ + public String toDisplaySql() { + return ConditionBeanContext.convertConditionBean2DisplaySql(this); + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Purpose Type + // ============ + public void xsetupForDeriveReferrer() { + _forDeriveReferrer = true; + } + + public void xsetupForUnion() { + _forUnion = true; + } + + public void xsetupForExistsSubQuery() { + _forExistsSubQuery = true; + } + + public void xsetupForInScopeSubQuery() { + _forInScopeSubQuery = true; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * The override. + * + * @return SQL for display. (NotNull) + */ + public String toString() { + try { + return toDisplaySql(); + } catch (RuntimeException e) { + return getSqlClause().getClause(); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionQuery.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionQuery.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionQuery.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1666 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.exception.RequiredOptionNotFoundException; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; +import jp.sf.pal.scheduler.db.allcommon.util.TraceViewUtil; + +/** + * The abstract class of condition-query. + * + * @author DBFlute(AutoGenerator) + */ +public abstract class AbstractConditionQuery implements ConditionQuery { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final ConditionKey CK_EQ = ConditionKey.CK_EQUAL; + + protected static final ConditionKey CK_NE = ConditionKey.CK_NOT_EQUAL; + + protected static final ConditionKey CK_GE = ConditionKey.CK_GREATER_EQUAL; + + protected static final ConditionKey CK_GT = ConditionKey.CK_GREATER_THAN; + + protected static final ConditionKey CK_LE = ConditionKey.CK_LESS_EQUAL; + + protected static final ConditionKey CK_LT = ConditionKey.CK_LESS_THAN; + + 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_ISN = ConditionKey.CK_IS_NULL; + + protected static final ConditionKey CK_ISNN = ConditionKey.CK_IS_NOT_NULL; + + /** Condition value for DUMMY. */ + protected static final ConditionValue DUMMY_CONDITION_VALUE = new ConditionValue(); + + /** Object for DUMMY. */ + protected static final Object DUMMY_OBJECT = new Object(); + + /** The property of condition-query. */ + protected static final String CQ_PROPERTY = "conditionQuery"; + + //========================================================================== + // ========= + // Attribute + // ========= + /** SQL clause. */ + protected final SqlClause _sqlClause; + + /** My alias name. */ + protected final String _aliasName; + + /** The level of nest. */ + protected final int _nestLevel; + + /** The level of subQuery. */ + protected int _subQueryLevel; + + // ----------------------------------------------------- + // Foreign Info + // ------------ + /** The property name of foreign. */ + protected String _foreignPropertyName; + + /** The path of relation. */ + protected String _relationPath; + + /** The query of child. */ + protected final ConditionQuery _childQuery; + + // ----------------------------------------------------- + // Inline + // ------ + /** Is it the inline for on-clause. (Property for Inline Only) */ + protected boolean _onClauseInline; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query. (Nullable: If null, this is base + * instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public AbstractConditionQuery(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + _childQuery = childQuery; + _sqlClause = sqlClause; + _aliasName = aliasName; + _nestLevel = nestLevel; + } + + //========================================================================== + // ========= + // Important Accessor + // ================== + /** + * Get child query. + * + * @return Child query. (Nullable) + */ + public ConditionQuery getChildQuery() { + return _childQuery; + } + + /** + * Get sql clause. + * + * @return Sql clause. (NotNull) + */ + public SqlClause getSqlClause() { + return _sqlClause; + } + + /** + * Get alias name. + * + * @return Alias name. (NotNull) + */ + public String getAliasName() { + return _aliasName; + } + + /** + * Get nest level. + * + * @return Nest level. + */ + public int getNestLevel() { + return _nestLevel; + } + + /** + * Get next nest level. + * + * @return Next nest level. + */ + public int getNextNestLevel() { + return _nestLevel + 1; + } + + /** + * Is base query? + * + * @param query Condition query. (NotNull) + * @return Determination. + */ + public boolean isBaseQuery(ConditionQuery query) { + return (query.getChildQuery() == null); + } + + /** + * Get the level of subQuery. + * + * @return The level of subQuery. + */ + public int getSubQueryLevel() { + return _subQueryLevel; + } + + // ----------------------------------------------------- + // Real Name + // --------- + /** + * Get real alias name(that has nest level mark). + * + * @return Real alias name. + */ + public String getRealAliasName() { + return getAliasName(); + } + + /** + * Get real column name(with real alias name). + * + * @param columnName Column name without alias name. This should not contain + * comma. (NotNull) + * @return Real column name. + */ + public String getRealColumnName(String columnName) { + assertColumnName(columnName); + return buildRealColumnName(getRealAliasName(), columnName); + } + + /** + * Build real column name. + * + * @param aliasName Alias name. (NotNull) + * @param columnName Column name. (NotNull) + * @return Real column name. (NotNull) + */ + protected String buildRealColumnName(String aliasName, String columnName) { + return aliasName + "." + columnName; + } + + // ----------------------------------------------------- + // Foreign Info + // ------------ + public String getForeignPropertyName() { + return _foreignPropertyName; + } + + public void xsetForeignPropertyName(String foreignPropertyName) { + this._foreignPropertyName = foreignPropertyName; + } + + public String getRelationPath() { + return _relationPath; + } + + public void xsetRelationPath(String relationPath) { + this._relationPath = relationPath; + } + + // ----------------------------------------------------- + // Inline + // ------ + public void xsetOnClauseInline(boolean onClauseInline) { + _onClauseInline = onClauseInline; + } + + //========================================================================== + // ========= + // Location + // ======== + /** + * Get location. + * + * @param columnPropertyName Column property name. + * @param key Condition key. + * @return Next nest level. + */ + protected String getLocation(String columnPropertyName, ConditionKey key) { + return getLocationBase(columnPropertyName) + "." + + key.getConditionKey(); + } + + protected String getLocationBase() { + final StringBuffer sb = new StringBuffer(); + ConditionQuery query = this; + while (true) { + if (query.isBaseQuery(query)) { + sb.insert(0, CQ_PROPERTY + "."); + break; + } else { + final String foreignPropertyName = query + .getForeignPropertyName(); + if (foreignPropertyName == null) { + String msg = "The foreignPropertyName of the query should not be null:"; + msg = msg + " query=" + query; + throw new IllegalStateException(msg); + } + sb.insert(0, CQ_PROPERTY + initCap(foreignPropertyName) + "."); + } + query = query.getChildQuery(); + } + return sb.toString(); + } + + protected String getLocationBase(String columnPropertyName) { + return getLocationBase() + columnPropertyName; + } + + //========================================================================== + // ========= + // Union Query + // =========== + /** The map of union query. */ + protected Map<String, ConditionQuery> _unionQueryMap; + + /** + * Get the map of union query. + * + * @return The map of union query. (NotNull) + */ + public Map<String, ConditionQuery> getUnionQueryMap() {// for Internal + if (_unionQueryMap == null) { + _unionQueryMap = new LinkedHashMap<String, ConditionQuery>(); + } + return _unionQueryMap; + } + + /** + * Set union query. {Internal} + * + * @param unionQuery Union query. (NotNull) + */ + public void xsetUnionQuery(ConditionQuery unionQuery) { + xsetupUnion(unionQuery, false, getUnionQueryMap()); + } + + /** The map of union all query. */ + protected Map<String, ConditionQuery> _unionAllQueryMap; + + /** + * Get the map of union all query. + * + * @return The map of union all query. (NotNull) + */ + public Map<String, ConditionQuery> getUnionAllQueryMap() {// for Internal + if (_unionAllQueryMap == null) { + _unionAllQueryMap = new LinkedHashMap<String, ConditionQuery>(); + } + return _unionAllQueryMap; + } + + /** + * Set union all query. {Internal} + * + * @param unionAllQuery Union all query. (NotNull) + */ + public void xsetUnionAllQuery(ConditionQuery unionAllQuery) { + xsetupUnion(unionAllQuery, true, getUnionAllQueryMap()); + } + + protected void xsetupUnion(ConditionQuery unionQuery, boolean unionAll, + Map<String, ConditionQuery> unionQueryMap) { + if (unionQuery == null) { + 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 + // ! + } + String key = (unionAll ? "unionAllQuery" : "unionQuery") + + unionQueryMap.size(); + unionQueryMap.put(key, unionQuery); + registerUnionQuery(unionQuery, unionAll, (unionAll ? "unionAllQueryMap" + : "unionQueryMap") + + "." + key); + } + + /** + * Reflect relation on union query. + * + * @param baseQueryAsSuper Base query as super. (NotNull) + * @param unionQueryAsSuper Union query as super. (NotNull) + */ + abstract protected void reflectRelationOnUnionQuery( + ConditionQuery baseQueryAsSuper, ConditionQuery unionQueryAsSuper); + + /** + * Has union query or union all query? + * + * @return Determination. + */ + public boolean hasUnionQueryOrUnionAllQuery() { + return (_unionQueryMap != null && !_unionQueryMap.isEmpty()) + || (_unionAllQueryMap != null && !_unionAllQueryMap.isEmpty()); + } + + /** + * Get the list of union query. + * + * @return The list of union query. (NotNull) + */ + public List<ConditionQuery> getUnionQueryList() { + if (_unionQueryMap == null) { + return new ArrayList<ConditionQuery>(); + } + return new ArrayList<ConditionQuery>(_unionQueryMap.values()); + } + + /** + * Get the list of union all query. + * + * @return The list of union all query. (NotNull) + */ + public List<ConditionQuery> getUnionAllQueryList() { + if (_unionAllQueryMap == null) { + return new ArrayList<ConditionQuery>(); + } + return new ArrayList<ConditionQuery>(_unionAllQueryMap.values()); + } + + //========================================================================== + // ========= + // 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, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName); + } + } + + protected void registerQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, ConditionOption option) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName, option); + } + } + + // ----------------------------------------------------- + // FromTo Query + // ------------ + protected void registerFromToQuery(java.util.Date fromDate, + java.util.Date toDate, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, FromToOption option) { + { + final java.util.Date filteredFromDate = option + .filterFromDate(fromDate); + final ConditionKey fromKey = option.getFromDateConditionKey(); + if (fromKey.isValidRegistration(cvalue, filteredFromDate, fromKey + .getConditionKey() + + " of " + getRealAliasName() + "." + uncapPropName)) { + setupConditionValueAndRegisterWhereClause(fromKey, + filteredFromDate, cvalue, colName, capPropName, + uncapPropName); + } + } + { + final java.util.Date filteredToDate = option.filterToDate(toDate); + final ConditionKey toKey = option.getToDateConditionKey(); + if (toKey.isValidRegistration(cvalue, filteredToDate, toKey + .getConditionKey() + + " of " + getRealAliasName() + "." + uncapPropName)) { + setupConditionValueAndRegisterWhereClause(toKey, + filteredToDate, cvalue, colName, capPropName, + uncapPropName); + } + } + } + + // ----------------------------------------------------- + // LikeSearch Query + // ---------------- + @SuppressWarnings("deprecation") + protected void registerLikeSearchQuery(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, LikeSearchOption option) { + final String validationMsg = key.getConditionKey() + " of " + + getRealAliasName() + "." + colName; + if (!key.isValidRegistration(cvalue, value, validationMsg)) { + return; + } + if (option == null) { + throwLikeSearchOptionNotFoundException(capPropName, value); + return;// Unreachable! + } + if (value == null || !option.isSplit()) { + // As Normal Condition. + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName, option); + return; + } + // - - - - - - - - - + // Use splitByXxx(). + // - - - - - - - - - + final String[] strArray = option.generateSplitValueArray(value); + if (!option.isAsOrSplit()) { + // As 'and' Condition + for (int i = 0; i < strArray.length; i++) { + final String currentValue = strArray[i]; + setupConditionValueAndRegisterWhereClause(key, currentValue, + cvalue, colName, capPropName, uncapPropName, option); + + // Callback for LikeAsOr! + final List<LikeSearchOption.LikeAsOrCallback> callbackList = option + .getLikeAsOrCallbackList(); + if (!callbackList.isEmpty()) { + getSqlClause().makeAdditionalConditionAsOrEffective(); + for (Iterator<LikeSearchOption.LikeAsOrCallback> ite = callbackList + .iterator(); ite.hasNext();) { + final LikeSearchOption.LikeAsOrCallback likeAsOrCallback = (LikeSearchOption.LikeAsOrCallback) ite + .next(); + final String additionalTargetPropertyName = likeAsOrCallback + .getAdditionalTargetPropertyName(); + final String filteredValue = likeAsOrCallback + .filterValue(currentValue); + final LikeSearchOption optionDeepCopy = (LikeSearchOption) option + .createDeepCopy(); + optionDeepCopy.clearLikeAsOrCallback(); + final LikeSearchOption filteredOption = likeAsOrCallback + .filterOption(optionDeepCopy); + invokeSetterLikeSearch(additionalTargetPropertyName, + filteredValue, filteredOption); + } + getSqlClause().ignoreAdditionalConditionAsOr(); + } + } + } else { + // As 'or' Condition + for (int i = 0; i < strArray.length; i++) { + final String currentValue = strArray[i]; + if (i == 0) { + setupConditionValueAndRegisterWhereClause(key, + currentValue, cvalue, colName, capPropName, + uncapPropName, option); + } else { + getSqlClause().makeAdditionalConditionAsOrEffective(); + invokeSetterLikeSearch(uncapPropName, currentValue, option); + } + } + + // @jflute -- Callback for LikeAsOr! + // final List<LikeSearchOption.LikeAsOrCallback> callbackList = + // option.getLikeAsOrCallbackList(); + // ... + + getSqlClause().ignoreAdditionalConditionAsOr(); + } + } + + protected void throwLikeSearchOptionNotFoundException(String capPropName, + String value) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The likeSearchOption was Not Found! (Should not be null!)" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your method call:" + getLineSeparator(); + final String beanName = getClass().getSimpleName(); + final String methodName = "set" + capPropName + "_LikeSearch('" + value + + "', likeSearchOption);"; + msg = msg + " " + beanName + "." + methodName + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new RequiredOptionNotFoundException(msg); + } + + protected void invokeSetterLikeSearch(String columnFlexibleName, + Object value, LikeSearchOption option) { + if (value == null) { + return; + } + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(columnFlexibleName)); + final String methodName = "set" + columnCapPropName + "_LikeSearch"; + Method method = null; + try { + method = this.getClass().getMethod(methodName, + new Class[] { value.getClass(), LikeSearchOption.class }); + } catch (NoSuchMethodException e) { + String msg = "The columnFlexibleName is not existing in this table: columnFlexibleName=" + + columnFlexibleName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + method.invoke(this, new Object[] { value, option }); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + // ----------------------------------------------------- + // InScope Query + // ------------- + protected void registerInScopeQuery(ConditionKey key, String value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, InScopeOption option) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + if (value != null && option.isSplit()) { + final String[] strArray = option.generateSplitValueArray(value); + final List<String> realValueList = new ArrayList<String>(); + for (int i = 0; i < strArray.length; i++) { + final String currentValue = strArray[i]; + realValueList.add(currentValue); + } + setupConditionValueAndRegisterWhereClause(key, realValueList, + cvalue, colName, capPropName, uncapPropName, option); + } else { + setupConditionValueAndRegisterWhereClause(key, value, cvalue, + colName, capPropName, uncapPropName, option); + } + } + } + + // ----------------------------------------------------- + // Inline Query + // ------------ + protected void registerInlineQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, + key));// If Java, it is necessary to use uncapPropName! + if (isBaseQuery(this)) { + getSqlClause().registerBaseTableInlineWhereClause(colName, key, + cvalue); + } else { + getSqlClause().registerOuterJoinInlineWhereClause( + getRealAliasName(), colName, key, cvalue, + _onClauseInline); + } + } + } + + protected void registerInlineQuery(ConditionKey key, Object value, + ConditionValue cvalue, String colName, String capPropName, + String uncapPropName, ConditionOption option) { + if (key.isValidRegistration(cvalue, value, key.getConditionKey() + + " of " + getRealAliasName() + "." + colName)) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, + key), option);// If Java, it is necessary to use + // uncapPropName! + if (isBaseQuery(this)) { + getSqlClause().registerBaseTableInlineWhereClause(colName, key, + cvalue, option); + } else { + getSqlClause().registerOuterJoinInlineWhereClause( + getRealAliasName(), colName, key, cvalue, option, + _onClauseInline); + } + } + } + + // ----------------------------------------------------- + // InScopeSubQuery + // --------------- + // {Modif****@DBFlu*****} + protected void registerInScopeSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + registerInScopeSubQuery(subQuery, columnName, relatedColumnName, + propertyName, null); + } + + protected void registerNotInScopeSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + registerInScopeSubQuery(subQuery, columnName, relatedColumnName, + propertyName, "not"); + } + + protected void registerInScopeSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName, + String inScopeOption) { + assertObjectNotNull("InScopeSubQyery(" + columnName + ")", subQuery); + inScopeOption = inScopeOption != null ? inScopeOption + " " : ""; + String realColumnName = getInScopeSubQueryRealColumnName(columnName); + 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 + ")"; + } + registerWhereClause(clause); + } + + protected String getInScopeSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getInScopeSubQuerySql(ConditionQuery subQuery, + String relatedColumnName, String propertyName) { + String selectClause = "select " + + getSqlClause().getLocalTableAliasName() + "." + + 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(), ""); + + return selectClause + " " + fromWhereClause; + } + + // ----------------------------------------------------- + // ExistsSubQuery + // -------------- + // {Modif****@DBFlu*****} + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + registerExistsSubQuery(subQuery, columnName, relatedColumnName, + propertyName, null); + } + + protected void registerNotExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + registerExistsSubQuery(subQuery, columnName, relatedColumnName, + propertyName, "not"); + } + + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName, + String existsOption) { + assertObjectNotNull("ExistsSubQyery(" + columnName + ")", subQuery); + existsOption = existsOption != null ? existsOption + " " : ""; + String realColumnName = getExistsSubQueryRealColumnName(columnName); + 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 + ")"; + } + registerWhereClause(clause); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // *Unsupport ExistsSubQuery as inline because it's so dangerous. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + protected String getExistsSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + 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); + + return selectClause + " " + fromWhereClause; + } + + // [DBFlute-0.7.4] + // ----------------------------------------------------- + // DeriveSubQuery + // -------------- + protected void registerDeriveSubQuery(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; + } + getSqlClause().specifyDeriveSubQuery(aliasName, clause); + } + + protected String getDeriveSubQueryRealColumnName(String columnName) { + return getRealColumnName(columnName); + } + + protected String getDeriveSubQuerySql(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() + .getSpecifiedColumnNameAsOne(); + if (deriveColumnName == null || deriveColumnName.trim().length() == 0) { + throwDeriveReferrerInvalidColumnSpecificationException(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 "; + } + + // 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( + String function, String aliasName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The specified the column for derive-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.specify().derivePurchaseList()." + function + + "(new SubQuery<PurchaseCB>() {" + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + " // *No! It's empty!" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Wrong]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.specify().derivePurchaseList()." + function + + "(new SubQuery<PurchaseCB>() {" + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + " subCB.specify().columnPurchaseDatetime();" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseCount(); // *No! It's duplicated!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + " cb.specify().derivePurchaseList()." + function + + "(new SubQuery<PurchaseCB>() {" + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime(); // *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Alias Name]" + getLineSeparator() + aliasName + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new DeriveReferrerInvalidColumnSpecificationException(msg); + } + + public static class DeriveReferrerInvalidColumnSpecificationException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public DeriveReferrerInvalidColumnSpecificationException(String msg) { + super(msg); + } + } + + protected void assertDeriveReferrerColumnType(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)) { + throwDeriveReferrerUnmatchedColumnTypeException(function, + deriveColumnName, deriveColumnType); + } + } + } + + protected void throwDeriveReferrerUnmatchedColumnTypeException( + 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 + " count() : String, Number, Date" + 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 DeriveReferrerUnmatchedColumnTypeException(msg); + } + + public static class DeriveReferrerUnmatchedColumnTypeException extends + RuntimeException { + private static final long serialVersionUID = 1L; + + public DeriveReferrerUnmatchedColumnTypeException(String msg) { + super(msg); + } + } + + // ----------------------------------------------------- + // Where Clause + // ------------ + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, key));// If + // Java + // , + // it + // is + // necessary + // to + // use + // uncapPropName + // ! + getSqlClause().registerWhereClause(getRealColumnName(colName), key, + cvalue); + } + + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + key.setupConditionValue(cvalue, value, getLocation(uncapPropName, key), + option);// If Java, it is necessary to use uncapPropName! + getSqlClause().registerWhereClause(getRealColumnName(colName), key, + cvalue, option); + } + + protected void registerWhereClause(String whereClause) { + getSqlClause().registerWhereClause(whereClause); + } + + protected void registerInlineWhereClause(String whereClause) { + if (isBaseQuery(this)) { + getSqlClause().registerBaseTableInlineWhereClause(whereClause); + } else { + getSqlClause().registerOuterJoinInlineWhereClause( + getRealAliasName(), whereClause, _onClauseInline); + } + } + + // ----------------------------------------------------- + // Union Query + // ----------- + public void registerUnionQuery(ConditionQuery unionQuery, boolean unionAll, + String unionQueryPropertyName) { + final String unionQueryClause = getUnionQuerySql(unionQuery, + unionQueryPropertyName); + + // At the future, building SQL will be moved to sqlClause. + getSqlClause().registerUnionQuery(unionQueryClause, unionAll); + } + + protected String getUnionQuerySql(ConditionQuery unionQuery, + String unionQueryPropertyName) { + final String fromClause = unionQuery.getSqlClause().getFromClause(); + final String whereClause = unionQuery.getSqlClause().getWhereClause(); + final String unionQueryClause; + if (whereClause.trim().length() <= 0) { + unionQueryClause = fromClause + " " + + getSqlClause().getUnionWhereClauseMark(); + } else { + final int whereIndex = whereClause.indexOf("where "); + if (whereIndex < 0) { + String msg = "The whereClause should have 'where' string: " + + whereClause; + throw new IllegalStateException(msg); + } + final int clauseIndex = whereIndex + "where ".length(); + final String mark = getSqlClause() + .getUnionWhereFirstConditionMark(); + unionQueryClause = fromClause + " " + + whereClause.substring(0, clauseIndex) + mark + + whereClause.substring(clauseIndex); + } + final String oldStr = ".conditionQuery."; + final String newStr = ".conditionQuery." + unionQueryPropertyName + "."; + return replaceString(unionQueryClause, oldStr, newStr);// Very + // Important! + } + + // ----------------------------------------------------- + // OrderBy + // ------- + public void withNullsFirst() {// is User Public! + getSqlClause().addNullsFirstToPreviousOrderBy(); + } + + public void withNullsLast() {// is User Public! + getSqlClause().addNullsLastToPreviousOrderBy(); + } + + protected void registerSpecifiedDerivedOrderBy_Asc(String aliasName) { + if (!getSqlClause().hasSpecifiedDeriveSubQuery(aliasName)) { + throwSpecifiedDerivedOrderByAliasNameNotFoundException(aliasName); + } + getSqlClause().registerOrderBy(aliasName, null, true); + } + + protected void registerSpecifiedDerivedOrderBy_Desc(String aliasName) { + if (!getSqlClause().hasSpecifiedDeriveSubQuery(aliasName)) { + throwSpecifiedDerivedOrderByAliasNameNotFoundException(aliasName); + } + getSqlClause().registerOrderBy(aliasName, null, false); + } + + protected void throwSpecifiedDerivedOrderByAliasNameNotFoundException( + String aliasName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The aliasName was Not Found in specified alias names." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "You should specified an alias name that is the same as one in specify-derived-referrer." + + 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.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().specifyProduct().columnProductName(); // *No!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + + " cb.query().addSpecifiedDerivedOrderBy_Desc(\"WRONG_NAME_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [Good!]" + getLineSeparator(); + msg = msg + " /- - - - - - - - - - - - - - - - - - - - " + + getLineSeparator(); + msg = msg + " MemberCB cb = new MemberCB();" + getLineSeparator(); + msg = msg + + " cb.specify().derivePurchaseList().max(new SubQuery<PurchaseCB>() {" + + getLineSeparator(); + msg = msg + " public void query(PurchaseCB subCB) {" + + getLineSeparator(); + msg = msg + + " subCB.specify().columnPurchaseDatetime();// *Point!" + + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + " }, \"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + + " cb.query().addSpecifiedDerivedOrderBy_Desc(\"LATEST_PURCHASE_DATETIME\");" + + getLineSeparator(); + msg = msg + " - - - - - - - - - -/" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Not Found Alias Name]" + getLineSeparator() + aliasName + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new SpecifiedDerivedOrderByAliasNameNotFoundException(msg); + } + + public static class SpecifiedDerivedOrderByAliasNameNotFoundException + extends RuntimeException { + private static final long serialVersionUID = 1L; + + public SpecifiedDerivedOrderByAliasNameNotFoundException(String msg) { + super(msg); + } + } + + protected void registerOrderBy(String columnName, boolean ascOrDesc) { + getSqlClause().registerOrderBy(getRealColumnName(columnName), null, + ascOrDesc); + } + + protected void regOBA(String columnName) { + registerOrderBy(columnName, true); + } + + protected void regOBD(String columnName) { + registerOrderBy(columnName, false); + } + + //========================================================================== + // ========= + // Name Resolver + // ============= + /** + * Resolve join alias name. + * + * @param relationPath Relation path. (NotNull) + * @param nestLevel Nest level. + * @return Resolved join alias name. (NotNull) + */ + protected String resolveJoinAliasName(String relationPath, int nestLevel) { + return getSqlClause().resolveJoinAliasName(relationPath, nestLevel); + } + + protected String resolveNestLevelExpression(String name) { + return getSqlClause().resolveNestLevelExpression(name, getNestLevel()); + } + + protected String resolveNextRelationPath(String tableName, + String relationPropertyName) { + final int relationNo = getSqlClause().resolveRelationNo(tableName, + relationPropertyName); + String nextRelationPath = "_" + relationNo; + if (_relationPath != null) { + nextRelationPath = _relationPath + nextRelationPath; + } + return nextRelationPath; + } + + //========================================================================== + // ========= + // Fixed Condition + // =============== + protected String prepareFixedCondition(String fixedCondition, + String localAliasName, String foreignAliasName) { + fixedCondition = replaceString(fixedCondition, "$$alias$$", + foreignAliasName); + fixedCondition = replaceString(fixedCondition, "$$foreignAlias$$", + foreignAliasName); + fixedCondition = replaceString(fixedCondition, "$$localAlias$$", + localAliasName); + return fixedCondition; + } + + //========================================================================== + // ========= + // Reflection Invoking + // =================== + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column. (NotNull and + * NotEmpty) + * @return The conditionValue. (NotNull) + */ + public ConditionValue invokeValue(String columnFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + final DBMeta dbmeta = DBMetaInstanceHandler + .findDBMeta(getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(columnFlexibleName)); + final String methodName = "get" + columnCapPropName; + final Method method = helpGettingCQMethod(this, methodName, + new Class<?>[] {}, columnFlexibleName); + return (ConditionValue) helpInvokingCQMethod(this, method, + new Object[] {}); + } + + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column allowed to + * contain relations. (NotNull and NotEmpty) + * @param conditionKeyName The name of the conditionKey. (NotNull) + * @param value The value of the condition. (NotNull) + */ + public void invokeQuery(String columnFlexibleName, String conditionKeyName, + Object value) { + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + assertStringNotNullAndNotTrimmedEmpty("conditionKeyName", + conditionKeyName); + if (value == null) { + return; + } + final PropertyNameCQContainer container = helpExtractingPropertyNameCQContainer(columnFlexibleName); + final String propertyName = container.getPropertyName(); + final ConditionQuery cq = container.getConditionQuery(); + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(cq + .getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(propertyName)); + final String methodName = "set" + columnCapPropName + "_" + + initCap(conditionKeyName); + final Method method = helpGettingCQMethod(cq, methodName, + new Class<?>[] { value.getClass() }, propertyName); + helpInvokingCQMethod(cq, method, new Object[] { value }); + } + + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of a column allowed to + * contain relations. (NotNull and NotEmpty) + * @param isAsc Is it ascend? + */ + public void invokeOrderBy(String columnFlexibleName, boolean isAsc) { + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + final PropertyNameCQContainer container = helpExtractingPropertyNameCQContainer(columnFlexibleName); + final String propertyName = container.getPropertyName(); + final ConditionQuery cq = container.getConditionQuery(); + final String ascDesc = isAsc ? "Asc" : "Desc"; + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(cq + .getTableDbName()); + final String columnCapPropName = initCap(dbmeta + .findPropertyName(propertyName)); + final String methodName = "addOrderBy_" + columnCapPropName + "_" + + ascDesc; + final Method method = helpGettingCQMethod(cq, methodName, + new Class<?>[] {}, propertyName); + helpInvokingCQMethod(cq, method, new Object[] {}); + } + + /** + * The implementation. + * + * @param foreignPropertyName The property name of foreign. (NotNull and + * NotEmpty) + * @return The conditionQuery of foreign as interface. (NotNull) + */ + public ConditionQuery invokeForeignCQ(String foreignPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("foreignPropertyName", + foreignPropertyName); + final String methodName = "query" + initCap(foreignPropertyName); + final Method method = helpGettingCQMethod(this, methodName, + new Class<?>[] {}, foreignPropertyName); + return (ConditionQuery) helpInvokingCQMethod(this, method, + new Object[] {}); + } + + private PropertyNameCQContainer helpExtractingPropertyNameCQContainer( + String name) { + final String[] strings = name.split("\\."); + final int length = strings.length; + String propertyName = null; + ConditionQuery cq = this; + int index = 0; + for (String element : strings) { + if (length == (index + 1)) {// at last loop! + propertyName = element; + break; + } + cq = cq.invokeForeignCQ(element); + ++index; + } + return new PropertyNameCQContainer(propertyName, cq); + } + + private static class PropertyNameCQContainer { + protected String _propertyName; + + protected ConditionQuery _cq; + + public PropertyNameCQContainer(String propertyName, ConditionQuery cq) { + this._propertyName = propertyName; + this._cq = cq; + } + + public String getPropertyName() { + return _propertyName; + } + + public ConditionQuery getConditionQuery() { + return _cq; + } + } + + private Method helpGettingCQMethod(ConditionQuery cq, String methodName, + Class<?>[] argTypes, String property) { + try { + return cq.getClass().getMethod(methodName, argTypes); + } catch (NoSuchMethodException e) { + String msg = "The method is not existing:"; + msg = msg + " methodName=" + methodName; + msg = msg + " argTypes=" + convertObjectArrayToStringView(argTypes); + msg = msg + " tableName=" + cq.getTableDbName(); + msg = msg + " property=" + property; + throw new IllegalStateException(msg, e); + } + } + + private Object helpInvokingCQMethod(ConditionQuery cq, Method method, + Object[] args) { + try { + return method.invoke(cq, args); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause()); + } + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + /** + * @param value Query-value-string. (Nullable) + * @return Filtered value. (Nullable) + */ + protected String fRES(String value) { + return filterRemoveEmptyString(value); + } + + /** + * @param value Query-value-string. (Nullable) + * @return Filtered value. (Nullable) + */ + private String filterRemoveEmptyString(String value) { + return ((value != null && !"".equals(value)) ? value : null); + } + + /** + * @param col Target collection. (Nullable) + * @param <PROPERTY_TYPE> The type of property. + * @return List. (Nullable: If the argument is null, returns null.) + */ + protected <PROPERTY_TYPE> List<PROPERTY_TYPE> cTL( + Collection<PROPERTY_TYPE> col) { + return convertToList(col); + } + + /** + * @param col Target collection. (Nullable) + * @param <PROPERTY_TYPE> The type of property. + * @return List. (Nullable: If the argument is null, returns null.) + */ + private <PROPERTY_TYPE> List<PROPERTY_TYPE> convertToList( + Collection<PROPERTY_TYPE> col) { + if (col == null) { + return null; + } + if (col instanceof List) { + return filterRemoveNullOrEmptyValueFromList((List<PROPERTY_TYPE>) col); + } + return filterRemoveNullOrEmptyValueFromList(new ArrayList<PROPERTY_TYPE>( + col)); + } + + private <PROPERTY_TYPE> List<PROPERTY_TYPE> filterRemoveNullOrEmptyValueFromList( + List<PROPERTY_TYPE> ls) { + if (ls == null) { + return null; + } + List<PROPERTY_TYPE> newList = new ArrayList<PROPERTY_TYPE>(); + for (Iterator<PROPERTY_TYPE> ite = ls.iterator(); ite.hasNext();) { + final PROPERTY_TYPE element = ite.next(); + if (element == null) { + continue; + } + if (element instanceof String) { + if (((String) element).length() == 0) { + continue; + } + } + newList.add(element); + } + return newList; + } + + public void doNss(NssCall callback) {// Very Internal + String foreignPropertyName = callback.qf().getForeignPropertyName(); + String foreignTableAliasName = callback.qf().getRealAliasName(); + getSqlClause().registerSelectedSelectColumn(foreignTableAliasName, + getTableDbName(), foreignPropertyName, getRelationPath()); + getSqlClause().registerSelectedForeignInfo( + callback.qf().getRelationPath(), foreignPropertyName); + } + + public static interface NssCall {// Very Internal + public ConditionQuery qf(); + } + + protected void registerOuterJoin(ConditionQuery cq, + Map<String, String> joinOnMap) { + getSqlClause().registerOuterJoin(cq.getTableSqlName(), + cq.getRealAliasName(), joinOnMap); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String initCap(String str) { + return SimpleStringUtil.initCap(str); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + protected String convertObjectArrayToStringView(Object[] objArray) { + return TraceViewUtil.convertObjectArrayToStringView(objArray); + } + + // ----------------------------------------------------- + // Collection Generator + // -------------------- + protected <KEY, VALUE> LinkedHashMap<KEY, VALUE> newLinkedHashMap() { + return new LinkedHashMap<KEY, VALUE>(); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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 that the column-name is not null and is not empty and does not + * contain comma. + * + * @param columnName Column-name. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertColumnName(String columnName) { + if (columnName == null) { + String msg = "The columnName should not be null."; + throw new IllegalArgumentException(msg); + } + if (columnName.trim().length() == 0) { + String msg = "The columnName should not be empty-string."; + throw new IllegalArgumentException(msg); + } + if (columnName.indexOf(",") >= 0) { + String msg = "The columnName should not contain comma ',': " + + columnName; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert that the alias-name is not null and is not empty and does not + * contain comma. + * + * @param aliasName Alias-name. (NotNull) + * @exception IllegalArgumentException + */ + protected void assertAliasName(String aliasName) { + if (aliasName == null) { + String msg = "The aliasName should not be null."; + throw new IllegalArgumentException(msg); + } + if (aliasName.trim().length() == 0) { + String msg = "The aliasName should not be empty-string."; + throw new IllegalArgumentException(msg); + } + if (aliasName.indexOf(",") >= 0) { + String msg = "The aliasName should not contain comma ',': " + + aliasName; + 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); + } + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return getClass().getSimpleName() + ":{aliasName=" + _aliasName + + ", nestLevel=" + _nestLevel + ", subQueryLevel=" + + _subQueryLevel + ", foreignPropertyName=" + + _foreignPropertyName + ", relationPath=" + _relationPath + + ", onClauseInline=" + _onClauseInline + "}"; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/AbstractConditionQuery.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,226 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; + +/** + * The interface of condition-bean. + * + * @author DBFlute(AutoGenerator) + */ +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 + // ========== + /** + * Get table DB-name. + * + * @return Table DB-name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table SQL-name. + * + * @return Table SQL-name. (NotNull) + */ + public String getTableSqlName(); + + //========================================================================== + // ========= + // SqlClause + // ========= + /** + * Get SQL-clause instance. + * + * @return SQL-clause. (NotNull) + */ + public SqlClause getSqlClause(); + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + /** + * Accept primary-key map-string. + * + * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMap( + java.util.Map<String, ? extends Object> primaryKeyMap); + + /** + * Accept primary-key map-string. Delimiter is at-mark and semicolon. + * + * @param primaryKeyMapString Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMapString(String primaryKeyMapString); + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + /** + * Add order-by PrimaryKey asc. {order by primaryKey1 asc, primaryKey2 + * asc...} + * + * @return this. (NotNull) + */ + public ConditionBean addOrderBy_PK_Asc(); + + /** + * Add order-by PrimaryKey desc. {order by primaryKey1 desc, primaryKey2 + * desc...} + * + * @return this. (NotNull) + */ + public ConditionBean addOrderBy_PK_Desc(); + + //========================================================================== + // ========= + // 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) + */ + public ConditionQuery localCQ(); + + //========================================================================== + // ========= + // Union Query + // =========== + /** + * Has union query or union all query? + * + * @return Determination. + */ + 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 + // ============ + /** + * Lock for update. + * <p> + * If you invoke this, your SQL lock target records for update. It depends + * whether this method supports this on the database type. + * </p> + * + * @return this. (NotNull) + */ + public ConditionBean lockForUpdate(); + + //========================================================================== + // =========== + // Select Count + // ============ + /** + * Set up various things for select-count-ignore-fetch-scope. {Internal} + * This method is for INTERNAL. Don't invoke this! + * + * @return this. (NotNull) + */ + public ConditionBean xsetupSelectCountIgnoreFetchScope(); + + /** + * Do after-care for select-count-ignore-fetch-scope. {Internal} This method + * is for INTERNAL. Don't invoke this! + * + * @return this. (NotNull) + */ + public ConditionBean xafterCareSelectCountIgnoreFetchScope(); + + /** + * Is set up various things for select-count-ignore-fetch-scope? {Internal} + * This method is for INTERNAL. Don't invoke this! + * + * @return Determination. + */ + public boolean isSelectCountIgnoreFetchScope(); + + //========================================================================== + // =========== + // Statement Config + // ================ + /** + * @param statementConfig The config of statement. (Nullable) + */ + public void configure(StatementConfig statementConfig); + + /** + * @return The config of statement. (Nullable) + */ + public StatementConfig getStatementConfig(); + + //========================================================================== + // ========= + // Display SQL + // =========== + /** + * Convert this conditionBean to SQL for display. + * + * @return SQL for display. (NotNull and NotEmpty) + */ + public String toDisplaySql(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBeanContext.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBeanContext.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBeanContext.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,428 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseDb2; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseDerby; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseFirebird; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseH2; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseMySql; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseOracle; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClausePostgreSql; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClauseSqlServer; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The context of condition-bean. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionBeanContext { + + /** Log instance. */ + private static final Log _log = LogFactory + .getLog(ConditionBeanContext.class); + + //========================================================================== + // ========= + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal<ConditionBean> _threadLocal = new ThreadLocal<ConditionBean>(); + + /** + * Get condition-bean on thread. + * + * @return Condition-bean context. (Nullable) + */ + public static ConditionBean getConditionBeanOnThread() { + return (ConditionBean) _threadLocal.get(); + } + + /** + * Set condition-bean on thread. + * + * @param cb Condition-bean. (NotNull) + */ + public static void setConditionBeanOnThread(ConditionBean cb) { + if (cb == null) { + String msg = "The argument[cb] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(cb); + } + + /** + * Is existing condition-bean on thread? + * + * @return Determination. + */ + public static boolean isExistConditionBeanOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear condition-bean on thread. + */ + public static void clearConditionBeanOnThread() { + _threadLocal.set(null); + } + + //========================================================================== + // ========= + // Initialize against the ClassLoader Headache + // =========================================== + @SuppressWarnings("unused") + public static void initialize() { + boolean debugEnabled = _log.isDebugEnabled(); + // Against the ClassLoader Headache! + final StringBuilder sb = new StringBuilder(); + { + final Class<?> clazz = jp.sf.pal.scheduler.db.allcommon.cbean.SimplePagingBean.class; + if (debugEnabled) { + sb.append( + " ...Loading class of " + clazz.getName() + " by " + + clazz.getClassLoader().getClass()).append( + getLineSeparator()); + } + } + { + Class<?> clazz = jp.sf.pal.scheduler.db.allcommon.AccessContext.class; + clazz = jp.sf.pal.scheduler.db.allcommon.CallbackContext.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingOption.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingRowEndDeterminer.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingRowResource.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingRowSetupper.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.PageNumberLink.class; + clazz = jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.PageNumberLinkSetupper.class; + clazz = jp.sf.pal.scheduler.db.allcommon.jdbc.CursorHandler.class; + if (debugEnabled) { + sb.append(" ...Loading class of ...and so on"); + } + } + if (debugEnabled) { + _log.debug("{Initialize against the ClassLoader Headache}" + + getLineSeparator() + sb); + } + } + + //========================================================================== + // ========= + // 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 + // ================= + /** + * Create SQL-clause. {for condition-bean} + * + * @param cb Condition-bean. (NotNull) + * @return SQL-clause. (NotNull) + */ + public static SqlClause createSqlClause(ConditionBean cb) { + final String tableSqlName = cb.getTableSqlName(); + final SqlClause sqlClause = createSqlClause(tableSqlName); + if (DBFluteConfig.getInstance().isConditionBeanFormatSql()) { + sqlClause.makeFormatClauseEffective(); + } + return sqlClause; + } + + /** + * Create SQL-clause. {for SimplePagingBean} + * + * @param tableDbName The DB name of table. (NotNull) + * @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)) { + return new SqlClauseMySql(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_POSTGRESQL)) { + return new SqlClausePostgreSql(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_MSSQL)) { + return new SqlClauseSqlServer(tableDbName); + } else if (name.equalsIgnoreCase(DB_NAME_DB2)) { + return new SqlClauseDb2(tableDbName); + } else { + return new SqlClauseH2(tableDbName); + } + } + + //========================================================================== + // ========= + // Exception Handling + // ================== + public static void throwEntityAlreadyDeletedException(Object searchKey4Log) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The entity was Not Found! it has already been deleted!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your target record on your database." + + getLineSeparator(); + msg = msg + + "Does the target record really created before this operation?" + + getLineSeparator(); + msg = msg + "Has the target record been deleted by other thread?" + + getLineSeparator(); + msg = msg + + "It is precondition that the record exists on your database." + + getLineSeparator(); + msg = msg + getLineSeparator(); + if (searchKey4Log != null && searchKey4Log instanceof ConditionBean) { + final ConditionBean cb = (ConditionBean) searchKey4Log; + msg = msg + "[Display SQL]" + getLineSeparator() + + cb.toDisplaySql() + getLineSeparator(); + } else { + msg = msg + "[Search Condition]" + getLineSeparator() + + searchKey4Log + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */"; + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException( + msg); + } + + public static void throwEntityDuplicatedException(String resultCountString, + Object searchKey4Log, Throwable cause) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The entity was Too Many! it has been duplicated. It should be the only one! But the resultCount=" + + resultCountString + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm your search condition. Does it really select the only one?" + + getLineSeparator(); + msg = msg + + "Please confirm your database. Does it really exist the only one?" + + getLineSeparator(); + msg = msg + getLineSeparator(); + if (searchKey4Log != null && searchKey4Log instanceof ConditionBean) { + final ConditionBean cb = (ConditionBean) searchKey4Log; + msg = msg + "[Display SQL]" + getLineSeparator() + + cb.toDisplaySql() + getLineSeparator(); + } else { + msg = msg + "[Search Condition]" + getLineSeparator() + + searchKey4Log + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */"; + if (cause != null) { + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException( + msg, cause); + } else { + throw new jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException( + msg); + } + } + + //========================================================================== + // ========= + // Display SQL + // =========== + public static String convertConditionBean2DisplaySql(ConditionBean cb) { + final String twoWaySql; + if (cb.isLimitSelect_PKOnly()) { + twoWaySql = cb.getSqlClause().getClausePKOnly(); + } else { + twoWaySql = cb.getSqlClause().getClause(); + } + return InternalSqlParser.convertTwoWaySql2DisplaySql(twoWaySql, cb); + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint + // ================= + /** + * Is the SQLException from unique constraint? {Use both SQLState and + * ErrorCode} + * + * @param sqlState SQLState of the SQLException. (Nullable) + * @param errorCode ErrorCode of the SQLException. (Nullable) + * @return Is the SQLException from unique constraint? + */ + public static boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return createSqlClause("dummy").isUniqueConstraintException(sqlState, + 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 + // ====== + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected static String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionBeanContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionQuery.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionQuery.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionQuery.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,153 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * The condition-query as interface. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface ConditionQuery { + + //========================================================================== + // ========= + // Important Accessor + // ================== + /** + * Get table DB-name. + * + * @return Table DB-name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table SQL-name. + * + * @return Table SQL-name. (NotNull) + */ + public String getTableSqlName(); + + /** + * Get real alias name(that has nest level mark). + * + * @return Real alias name. (NotNull) + */ + public String getRealAliasName(); + + /** + * Get real column name(with real alias name). + * + * @param columnName Column name without alias name. (NotNull) + * @return Real column name. (NotNull) + */ + public String getRealColumnName(String columnName); + + /** + * Get child query. + * + * @return Child query. (Nullable) + */ + public ConditionQuery getChildQuery(); + + /** + * Get sql clause. + * + * @return Sql clause. (NotNull) + */ + public SqlClause getSqlClause(); + + /** + * Get alias name. + * + * @return Alias name. (NotNull) + */ + public String getAliasName(); + + /** + * Get nest level. + * + * @return Nest level. + */ + public int getNestLevel(); + + /** + * Get next nest level. + * + * @return Next nest level. + */ + public int getNextNestLevel(); + + /** + * Is base query? + * + * @param query Condition query. (NotNull) + * @return Determination. + */ + public boolean isBaseQuery(ConditionQuery query); + + /** + * Get the level of subQuery. + * + * @return The level of subQuery. + */ + public int getSubQueryLevel(); + + /** + * Get the property name of foreign relation. + * + * @return The property name of foreign relation. (NotNull) + */ + public String getForeignPropertyName(); + + /** + * Get the path of foreign relation. + * + * @return The path of foreign relation. (NotNull) + */ + public String getRelationPath(); + + //========================================================================== + // ========= + // Reflection Invoking + // =================== + /** + * Invoke getting value. + * + * @param columnFlexibleName The flexible name of the column. (NotNull and + * NotEmpty) + * @return The conditionValue. (NotNull) + */ + public ConditionValue invokeValue(String columnFlexibleName); + + /** + * Invoke setting query. {ResolveRelation} + * + * @param columnFlexibleName The flexible name of the column allowed to + * contain relations. (NotNull and NotEmpty) + * @param conditionKeyName The name of the conditionKey. (NotNull) + * @param value The value of the condition. (NotNull) + */ + public void invokeQuery(String columnFlexibleName, String conditionKeyName, + Object value); + + /** + * Invoke adding orderBy. {ResolveRelation} + * + * @param columnFlexibleName The flexible name of the column allowed to + * contain relations. (NotNull and NotEmpty) + * @param isAsc Is it ascend? + */ + public void invokeOrderBy(String columnFlexibleName, boolean isAsc); + + /** + * Invoke getting foreign conditionQuery. + * + * @param foreignPropertyName The property name of the foreign relation. + * (NotNull and NotEmpty) + * @return The conditionQuery of the foreign relation as interface. + * (NotNull) + */ + public ConditionQuery invokeForeignCQ(String foreignPropertyName); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ConditionQuery.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,62 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +/** + * The bean of fetch narrowing. + * + * @author DBFlute(AutoGenerator) + */ +public interface FetchNarrowingBean { + + /** + * Get fetch start index. + * + * @return Fetch start index. + */ + public int getFetchNarrowingSkipStartIndex(); + + /** + * Get fetch size. + * + * @return Fetch size. + */ + public int getFetchNarrowingLoopCount(); + + /** + * Is fetch start index supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingSkipStartIndexEffective(); + + /** + * Is fetch size supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingLoopCountEffective(); + + /** + * Is fetch-narrowing effective? + * + * @return Determination. + */ + public boolean isFetchNarrowingEffective(); + + /** + * Ignore fetch narrowing. Only checking safety result size is valid. + * {INTERNAL METHOD} + */ + public void ignoreFetchNarrowing(); + + /** + * Restore ignored fetch narrowing. {INTERNAL METHOD} + */ + public void restoreIgnoredFetchNarrowing(); + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBeanContext.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBeanContext.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBeanContext.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,79 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +/** + * Fetch-Narrowing-Bean context. (referring to s2pager) + * + * @author DBFlute(AutoGenerator) + */ +public class FetchNarrowingBeanContext { + + /** The thread-local for this. */ + private static ThreadLocal<FetchNarrowingBean> _threadLocal = new ThreadLocal<FetchNarrowingBean>(); + + /** + * Get fetch-narrowing-bean on thread. + * + * @return Condition-bean context. (Nullable) + */ + public static FetchNarrowingBean getFetchNarrowingBeanOnThread() { + return (FetchNarrowingBean) _threadLocal.get(); + } + + /** + * Set fetch-narrowing-bean on thread. + * + * @param cb Condition-bean. (NotNull) + */ + public static void setFetchNarrowingBeanOnThread(FetchNarrowingBean cb) { + if (cb == null) { + String msg = "The argument[cb] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(cb); + } + + /** + * Is existing fetch-narrowing-bean on thread? + * + * @return Determination. + */ + public static boolean isExistFetchNarrowingBeanOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear fetch-narrowing-bean on thread. + */ + public static void clearFetchNarrowingBeanOnThread() { + _threadLocal.set(null); + } + + /** + * Is the argument fetch-narrowing-bean? + * + * @param dtoInstance Dto instance. + * @return Determination. + */ + public static boolean isTheArgumentFetchNarrowingBean( + final Object dtoInstance) { + if (dtoInstance instanceof FetchNarrowingBean) { + return true; + } else { + return false; + } + } + + /** + * Is the type fetch-narrowing-bean? + * + * @param dtoClass DtoClass. + * @return Determination. + */ + public static boolean isTheTypeFetchNarrowingBean(final Class<?> dtoClass) { + if (FetchNarrowingBean.class.isAssignableFrom(dtoClass)) { + return true; + } else { + return false; + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/FetchNarrowingBeanContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ListResultBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ListResultBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ListResultBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,392 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +import jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingRowEndDeterminer; +import jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingRowResource; +import jp.sf.pal.scheduler.db.allcommon.cbean.grouping.GroupingRowSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.mapping.EntityDtoMapper; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.OrderByClause; + +/** + * The result bean for list. + * + * @param <ENTITY> The type of entity for the element of selected list. + * @author DBFlute(AutoGenerator) + */ +public class ListResultBean<ENTITY> implements List<ENTITY>, Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + /** + * The value of table db-name. (Nullable: If it's null, it means 'Not + * Selected Yet'.) + */ + protected String _tableDbName; + + /** The value of all record count. */ + protected int _allRecordCount; + + /** The list of selected entity. (NotNull) */ + protected List<ENTITY> _selectedList = new ArrayList<ENTITY>(); + + /** The clause of order-by. (NotNull) */ + protected OrderByClause _orderByClause = new OrderByClause(); + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + */ + public ListResultBean() { + } + + //========================================================================== + // ========= + // Grouping + // ======== + /** + * Group the list. This method needs the property 'selectedList' only. + * + * @param <ROW> The type of row. + * @param groupingRowSetupper The setupper of grouping row. (NotNull) + * @param groupingOption The option of grouping. (NotNull and it requires + * the breakCount or the determiner) + * @return The grouped list. (NotNull) + */ + public <ROW> List<ROW> groupingList( + GroupingRowSetupper<ROW, ENTITY> groupingRowSetupper, + GroupingOption<ENTITY> groupingOption) { + final List<ROW> groupingList = new ArrayList<ROW>(); + GroupingRowEndDeterminer<ENTITY> rowEndDeterminer = groupingOption + .getGroupingRowEndDeterminer(); + if (rowEndDeterminer == null) { + rowEndDeterminer = new GroupingRowEndDeterminer<ENTITY>() { + public boolean determine( + GroupingRowResource<ENTITY> rowResource, + ENTITY nextEntity) { + return rowResource.isSizeUpBreakCount(); + } + }; // as Default + } + GroupingRowResource<ENTITY> rowResource = new GroupingRowResource<ENTITY>(); + int breakCount = groupingOption.getElementCount(); + int rowElementIndex = 0; + int allElementIndex = 0; + for (ENTITY entity : _selectedList) { + // Set up row resource. + rowResource.addGroupingRowList(entity); + rowResource.setElementCurrentIndex(rowElementIndex); + rowResource.setBreakCount(breakCount); + + if (_selectedList.size() == (allElementIndex + 1)) { // Last Loop! + // Set up the object of grouping row! + final ROW groupingRowObject = groupingRowSetupper + .setup(rowResource); + + // Register! + groupingList.add(groupingRowObject); + break; + } + + // Not last loop so the nextElement must exist. + final ENTITY nextElement = _selectedList.get(allElementIndex + 1); + + // Do at row end. + if (rowEndDeterminer.determine(rowResource, nextElement)) { // Determine + // the + // row + // end! + // Set up the object of grouping row! + final ROW groupingRowObject = groupingRowSetupper + .setup(rowResource); + + // Register! + groupingList.add(groupingRowObject); + + // Initialize! + rowResource = new GroupingRowResource<ENTITY>(); + rowElementIndex = 0; + ++allElementIndex; + continue; + } + ++rowElementIndex; + ++allElementIndex; + } + return groupingList; + } + + //========================================================================== + // ========= + // Mapping + // ======= + public <DTO> ListResultBean<DTO> mappingList( + EntityDtoMapper<ENTITY, DTO> entityDtoMapper) { + final ListResultBean<DTO> mappingList = new ListResultBean<DTO>(); + for (ENTITY entity : _selectedList) { + mappingList.add(entityDtoMapper.map(entity)); + } + mappingList.setTableDbName(getTableDbName()); + mappingList.setAllRecordCount(getAllRecordCount()); + mappingList.setOrderByClause(getOrderByClause()); + return mappingList; + } + + //========================================================================== + // ========= + // Determination + // ============= + /** + * Has this result selected? + * + * @return Determination. {Whether table DB name is not null} + */ + public boolean isSelectedResult() { + return _tableDbName != null; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return Hash-code from primary-keys. + */ + public int hashCode() { + if (_selectedList == null) { + return super.hashCode(); + } + return _selectedList.hashCode(); + } + + /** + * @param other Other entity. (Nullable) + * @return Comparing result. If other is null, returns false. + */ + public boolean equals(Object other) { + if (_selectedList == null) { + return false; + } + if (other == null) { + return false; + } + if (!(other instanceof List)) { + return false; + } + return _selectedList.equals(other); + } + + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("{").append(_tableDbName); + sb.append(",").append(_allRecordCount); + sb.append(",").append( + _orderByClause != null ? _orderByClause.getOrderByClause() + : null); + sb.append(",").append(_selectedList); + sb.append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // List Elements + // ============= + public boolean add(ENTITY o) { + return _selectedList.add(o); + } + + public boolean addAll(Collection<? extends ENTITY> c) { + return _selectedList.addAll(c); + } + + public void clear() { + _selectedList.clear(); + } + + public boolean contains(Object o) { + return _selectedList.contains(o); + } + + public boolean containsAll(Collection<?> c) { + return _selectedList.containsAll(c); + } + + public boolean isEmpty() { + return _selectedList.isEmpty(); + } + + public Iterator<ENTITY> iterator() { + return _selectedList.iterator(); + } + + public boolean remove(Object o) { + return _selectedList.remove(o); + } + + public boolean removeAll(Collection<?> c) { + return _selectedList.removeAll(c); + } + + public boolean retainAll(Collection<?> c) { + return _selectedList.retainAll(c); + } + + public int size() { + return _selectedList.size(); + } + + public Object[] toArray() { + return _selectedList.toArray(); + } + + public <TYPE> TYPE[] toArray(TYPE[] a) { + return _selectedList.toArray(a); + } + + public void add(int index, ENTITY element) { + _selectedList.add(index, element); + } + + public boolean addAll(int index, Collection<? extends ENTITY> c) { + return _selectedList.addAll(index, c); + } + + public ENTITY get(int index) { + return _selectedList.get(index); + } + + public int indexOf(Object o) { + return _selectedList.indexOf(o); + } + + public int lastIndexOf(Object o) { + return _selectedList.lastIndexOf(o); + } + + public ListIterator<ENTITY> listIterator() { + return _selectedList.listIterator(); + } + + public ListIterator<ENTITY> listIterator(int index) { + return _selectedList.listIterator(index); + } + + public ENTITY remove(int index) { + return _selectedList.remove(index); + } + + public ENTITY set(int index, ENTITY element) { + return _selectedList.set(index, element); + } + + public List<ENTITY> subList(int fromIndex, int toIndex) { + return _selectedList.subList(fromIndex, toIndex); + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the value of tableDbName. + * + * @return The value of tableDbName. (Nullable: If it's null, it means 'Not + * Selected Yet'.) + */ + public String getTableDbName() { + return _tableDbName; + } + + /** + * Set the value of tableDbName. + * + * @param tableDbName The value of tableDbName. (NotNull) + */ + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } + + /** + * Get the value of allRecordCount. + * + * @return The value of allRecordCount. + */ + public int getAllRecordCount() { + return _allRecordCount; + } + + /** + * Set the value of allRecordCount. + * + * @param allRecordCount The value of allRecordCount. + */ + public void setAllRecordCount(int allRecordCount) { + _allRecordCount = allRecordCount; + } + + /** + * Get the value of selectedList. + * + * @return Selected list. (NotNull) + */ + public List<ENTITY> getSelectedList() { + return _selectedList; + } + + /** + * Set the value of selectedList. + * + * @param selectedList Selected list. (NotNull: If you set null, it ignores + * it.) + */ + public void setSelectedList(List<ENTITY> selectedList) { + if (selectedList == null) { + return; + } // Not allowed to set null value to the selected list + _selectedList = selectedList; + } + + /** + * Get the value of orderByClause. + * + * @return The value of orderByClause. (NotNull) + */ + public OrderByClause getOrderByClause() { + return _orderByClause; + } + + /** + * Set the value of orderByClause. + * + * @param orderByClause The value of orderByClause. (NotNull: If you set + * null, it ignores it.) + */ + public void setOrderByClause(OrderByClause orderByClause) { + if (orderByClause == null) { + return; + } // Not allowed to set null value to the selected list + _orderByClause = orderByClause; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ListResultBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/MapParameterBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/MapParameterBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/MapParameterBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.util.Map; + +/** + * The bean of map parameter. + * + * @author DBFlute(AutoGenerator) + */ +public interface MapParameterBean { + + /** + * Get the map of parameter. + * + * @return The map of parameter. (Nullable) + */ + public Map<String, Object> getParameterMap(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/MapParameterBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/OrderByBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/OrderByBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/OrderByBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,46 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.OrderByClause; + +/** + * The order-by-bean as interface. + * + * @author DBFlute(AutoGenerator) + */ +public interface OrderByBean extends SelectResource { + + /** + * Get sql component of order-by clause. + * + * @return Sql component of order-by clause. (NotNull) + */ + public OrderByClause getSqlComponentOfOrderByClause(); + + /** + * Get order-by clause. + * + * @return Order-by clause. (NotNull) + */ + public String getOrderByClause(); + + /** + * Clear order-by. + * + * @return this. (NotNull) + */ + public OrderByBean clearOrderBy(); + + /** + * Ignore order-by. + * + * @return this. (NotNull) + */ + public OrderByBean ignoreOrderBy(); + + /** + * Make order-by effective. + * + * @return this. (NotNull) + */ + public OrderByBean makeOrderByEffective(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/OrderByBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,163 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +/** + * The bean of paging. + * + * @author DBFlute(AutoGenerator) + */ +public interface PagingBean extends FetchNarrowingBean, OrderByBean { + + //========================================================================== + // ========= + // Paging Determination + // ==================== + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * Is the execution for paging(NOT count)? + * + * @return Determination. + */ + public boolean isPaging(); + + // * * * * * * * * + // For Framework + // * * * * * * * * + /** + * Is the count executed later? + * + * @return Determination. + */ + public boolean isCountLater(); + + //========================================================================== + // ========= + // Paging Setting + // ============== + /** + * Set up paging resources. + * + * @param pageSize The page size per one page. (NotMinus & NotZero) + * @param pageNumber The number of page. It's ONE origin. (NotMinus & + * NotZero: If it's minus or zero, it treats as one.) + */ + public void paging(int pageSize, int pageNumber); + + /** + * Set whether the execution for paging(NOT count). {INTERNAL METHOD} + * + * @param paging Determination. + */ + public void xsetPaging(boolean paging); + + //========================================================================== + // ========= + // Fetch Setting + // ============= + /** + * Fetch first. <br /> If you invoke this, your SQL returns [fetch-size] + * records from first. + * + * @param fetchSize The size of fetch. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchFirst(int fetchSize); + + /** + * Fetch scope. <br /> If you invoke this, your SQL returns [fetch-size] + * records from [fetch-start-index]. + * + * @param fetchStartIndex The start index of fetch. 0 origin. (NotMinus) + * @param fetchSize The size of fetch. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchScope(int fetchStartIndex, int fetchSize); + + /** + * Fetch page. <br /> When you invoke this, it is normally necessary to + * invoke 'fetchFirst()' or 'fetchScope()' ahead of that. <br /> But you + * also can use default-fetch-size without invoking 'fetchFirst()' or + * 'fetchScope()'. <br /> If you invoke this, your SQL returns [fetch-size] + * records from [fetch-start-index] calculated by [fetch-page-number]. + * + * @param fetchPageNumber The page number of fetch. 1 origin. (NotMinus & + * NotZero: If minus or zero, set one.) + * @return this. (NotNull) + */ + public PagingBean fetchPage(int fetchPageNumber); + + //========================================================================== + // ========= + // Fetch Property + // ============== + /** + * Get fetch-start-index. + * + * @return Fetch-start-index. + */ + public int getFetchStartIndex(); + + /** + * Get fetch-size. + * + * @return Fetch-size. + */ + public int getFetchSize(); + + /** + * Get fetch-page-number. + * + * @return Fetch-page-number. + */ + public int getFetchPageNumber(); + + /** + * Get page start index. + * + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex(); + + /** + * Get page end index. + * + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex(); + + /** + * Is fetch scope effective? + * + * @return Determination. + */ + public boolean isFetchScopeEffective(); + + //========================================================================== + // ========= + // Hint Property + // ============= + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * Get select-hint. {select [select-hint] * from table...} + * + * @return Select-hint. (NotNull) + */ + public String getSelectHint(); + + /** + * Get from-hint. {select * from table [from-hint] where ...} + * + * @return From-hint. (NotNull) + */ + public String getFromHint(); + + /** + * Get sql-suffix. {select * from table where ... order by ... [sql-suffix]} + * + * @return Sql-suffix. (NotNull) + */ + public String getSqlSuffix(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,33 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.util.List; + +/** + * The handler of paging. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface PagingHandler<ENTITY> { + + /** + * Get the bean of paging. + * + * @return The bean of paging. (NotNull) + */ + public PagingBean getPagingBean(); + + /** + * Execute SQL for count. + * + * @return The count of execution. + */ + public int count(); + + /** + * Execute SQL for paging. + * + * @return The list of entity. (NotNull) + */ + public List<ENTITY> paging(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingInvoker.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingInvoker.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingInvoker.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,116 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.util.List; + +/** + * The invoker of paging. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class PagingInvoker<ENTITY> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected String _tableDbName; + + protected boolean _countLater; + + //========================================================================== + // ========= + // Constructor + // =========== + public PagingInvoker(String tableDbName) { + _tableDbName = tableDbName; + } + + //========================================================================== + // ========= + // Invoke + // ====== + /** + * Invoke select-page by handler. + * + * @param handler The handler of paging. (NotNull) + * @return The result bean of paging. (NotNull) + */ + public PagingResultBean<ENTITY> invokePaging(PagingHandler<ENTITY> handler) { + assertObjectNotNull("handler", handler); + final PagingBean pagingBean = handler.getPagingBean(); + assertObjectNotNull("handler.getPagingBean()", pagingBean); + if (!pagingBean.isFetchScopeEffective()) { + String msg = "The paging bean is not effective about fetch-scope!"; + msg = msg + + " When you select page, you should set up fetch-scope of paging bean(Should invoke fetchFirst() and fetchPage()!)."; + msg = msg + " The paging bean is: " + pagingBean; + throw new IllegalStateException(msg); + } + final int allRecordCount; + final List<ENTITY> selectedList; + if (_countLater) { + selectedList = handler.paging(); + allRecordCount = handler.count(); + } else { + allRecordCount = handler.count(); + selectedList = handler.paging(); + } + final PagingResultBean<ENTITY> rb = new ResultBeanBuilder<ENTITY>( + _tableDbName).buildPagingResultBean(pagingBean, allRecordCount, + selectedList); + if (isNecessaryToReadPageAgain(rb)) { + pagingBean.fetchPage(rb.getAllPageCount()); + final int reAllRecordCount = handler.count(); + final java.util.List<ENTITY> reSelectedList = handler.paging(); + return new ResultBeanBuilder<ENTITY>(_tableDbName) + .buildPagingResultBean(pagingBean, reAllRecordCount, + reSelectedList); + } else { + return rb; + } + } + + /** + * Is it necessary to read page again? + * + * @param rb The result bean of paging. (NotNull) + * @return Determination. + */ + protected boolean isNecessaryToReadPageAgain(PagingResultBean<ENTITY> rb) { + return rb.getAllRecordCount() > 0 && rb.getSelectedList().isEmpty(); + } + + //========================================================================== + // ========= + // Option + // ====== + public PagingInvoker<ENTITY> countLater() { + _countLater = true; + return this; + } + + //========================================================================== + // ========= + // Helper + // ====== + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingInvoker.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingResultBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingResultBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingResultBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,375 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import jp.sf.pal.scheduler.db.allcommon.cbean.mapping.EntityDtoMapper; +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.group.PageGroupBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.group.PageGroupOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.range.PageRangeBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.range.PageRangeOption; + +/** + * The result bean of paging. + * + * @param <ENTITY> The type of entity for the element of selected list. + * @author DBFlute(AutoGenerator) + */ +public class PagingResultBean<ENTITY> extends ListResultBean<ENTITY> { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Page Basic Info + // --------------- + /** The value of current page number. */ + protected int _pageSize; + + /** The value of current page number. */ + protected int _currentPageNumber; + + // ----------------------------------------------------- + // Page Group + // ---------- + /** The value of page-group bean. */ + protected PageGroupBean _pageGroupBean; + + /** The value of page-group option. */ + protected PageGroupOption _pageGroupOption; + + // ----------------------------------------------------- + // Page Range + // ---------- + /** The value of page-range bean. */ + protected PageRangeBean _pageRangeBean; + + /** The value of page-range option. */ + protected PageRangeOption _pageRangeOption; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + */ + public PagingResultBean() { + } + + //========================================================================== + // ========= + // Calculated Property + // =================== + /** + * Get the value of allPageCount that is calculated. + * + * @return The value of allPageCount. + */ + public int getAllPageCount() { + return calculateAllPageCount(_allRecordCount, _pageSize); + } + + /** + * Get the value of currentStartRecordNumber that is calculated. + * + * @return The value of currentStartRecordNumber. + */ + public int getCurrentStartRecordNumber() { + return calculateCurrentStartRecordNumber(_currentPageNumber, _pageSize); + } + + /** + * Get the value of currentEndRecordNumber that is calculated. + * + * @return The value of currentEndRecordNumber. + */ + public int getCurrentEndRecordNumber() { + return calculateCurrentEndRecordNumber(_currentPageNumber, _pageSize); + } + + //========================================================================== + // ========= + // Page Group/Range + // ================ + // ----------------------------------------------------- + // Page Group + // ---------- + /** + * Get the value of pageGroupSize. + * + * @return The value of pageGroupSize. + */ + public int getPageGroupSize() { + return _pageGroupOption != null ? _pageGroupOption.getPageGroupSize() + : 0; + } + + /** + * Set the value of pageGroupSize. + * + * @param pageGroupSize The value of pageGroupSize. + */ + public void setPageGroupSize(int pageGroupSize) { + final PageGroupOption option = new PageGroupOption(); + option.setPageGroupSize(pageGroupSize); + setPageGroupOption(option); + } + + /** + * Set the value of pageGroupOption. + * + * @param pageGroupOption The value of pageGroupOption. (Nullable) + */ + public void setPageGroupOption(PageGroupOption pageGroupOption) { + _pageGroupOption = pageGroupOption; + } + + /** + * Get the value of pageGroupBean. + * + * @return The value of pageGroupBean. (NotNull) + */ + public PageGroupBean pageGroup() { + assertPageGroupValid(); + if (_pageGroupBean == null) { + _pageGroupBean = new PageGroupBean(); + } + _pageGroupBean.setPageGroupOption(_pageGroupOption); + _pageGroupBean.setCurrentPageNumber(getCurrentPageNumber()); + _pageGroupBean.setAllPageCount(getAllPageCount()); + return _pageGroupBean; + } + + protected void assertPageGroupValid() { + if (_pageGroupOption == null) { + String msg = "The pageGroupOption should not be null. Please invoke setPageGroupOption()."; + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 0) { + String msg = "The pageGroupSize should be greater than 1. But the value is zero."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 1) { + String msg = "The pageGroupSize should be greater than 1. But the value is one."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + } + + // ----------------------------------------------------- + // Page Range + // ---------- + /** + * Get the value of pageRangeSize. + * + * @return The value of pageRangeSize. + */ + public int getPageRangeSize() { + return _pageRangeOption != null ? _pageRangeOption.getPageRangeSize() + : 0; + } + + /** + * Set the value of pageRangeSize. + * + * @param pageRangeSize The value of pageRangeSize. + */ + public void setPageRangeSize(int pageRangeSize) { + final PageRangeOption option = new PageRangeOption(); + option.setPageRangeSize(pageRangeSize); + setPageRangeOption(option); + } + + /** + * Set the value of pageRangeOption. + * + * @param pageRangeOption The value of pageRangeOption. (Nullable) + */ + public void setPageRangeOption(PageRangeOption pageRangeOption) { + this._pageRangeOption = pageRangeOption; + } + + /** + * Get the value of pageRangeBean. + * + * @return The value of pageRangeBean. (NotNull) + */ + public PageRangeBean pageRange() { + assertPageRangeValid(); + if (_pageRangeBean == null) { + _pageRangeBean = new PageRangeBean(); + } + _pageRangeBean.setPageRangeOption(_pageRangeOption); + _pageRangeBean.setCurrentPageNumber(getCurrentPageNumber()); + _pageRangeBean.setAllPageCount(getAllPageCount()); + return _pageRangeBean; + } + + protected void assertPageRangeValid() { + if (_pageRangeOption == null) { + String msg = "The pageRangeOption should not be null. Please invoke setPageRangeOption()."; + throw new IllegalStateException(msg); + } + final int pageRangeSize = _pageRangeOption.getPageRangeSize(); + if (pageRangeSize == 0) { + String msg = "The pageRangeSize should be greater than 1. But the value is zero."; + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // Determination + // ============= + /** + * Is existing previous page? Using values are currentPageNumber. + * + * @return Determination. + */ + public boolean isExistPrePage() { + return (_allRecordCount > 0 && _currentPageNumber > 1); + } + + /** + * Is existing next page? Using values are currentPageNumber and + * allPageCount. + * + * @return Determination. + */ + public boolean isExistNextPage() { + return (_allRecordCount > 0 && _currentPageNumber < getAllPageCount()); + } + + //========================================================================== + // ========= + // Mapping + // ======= + public <DTO> PagingResultBean<DTO> mappingList( + EntityDtoMapper<ENTITY, DTO> entityDtoMapper) { + final ListResultBean<DTO> ls = super.mappingList(entityDtoMapper); + final PagingResultBean<DTO> mappingList = new PagingResultBean<DTO>(); + mappingList.setSelectedList(ls.getSelectedList()); + mappingList.setTableDbName(getTableDbName()); + mappingList.setAllRecordCount(getAllRecordCount()); + mappingList.setOrderByClause(getOrderByClause()); + mappingList.setPageSize(getPageSize()); + mappingList.setCurrentPageNumber(getCurrentPageNumber()); + mappingList.setPageRangeOption(_pageRangeOption); + mappingList.setPageGroupOption(_pageGroupOption); + return mappingList; + } + + //========================================================================== + // ========= + // Calculate(Internal) + // =================== + /** + * Calculate all page count. + * + * @param allRecordCount All record count. + * @param pageSize Fetch-size. + * @return All page count. + */ + protected int calculateAllPageCount(int allRecordCount, int pageSize) { + if (allRecordCount == 0) { + return 1; + } + int pageCountBase = (allRecordCount / pageSize); + if (allRecordCount % pageSize > 0) { + pageCountBase++; + } + return pageCountBase; + } + + protected int calculateCurrentStartRecordNumber(int currentPageNumber, + int pageSize) { + return ((currentPageNumber - 1) * pageSize) + 1; + } + + protected int calculateCurrentEndRecordNumber(int currentPageNumber, + int pageSize) { + return calculateCurrentStartRecordNumber(currentPageNumber, pageSize) + + _selectedList.size() - 1; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("{").append(getCurrentPageNumber()).append("/").append( + getAllPageCount()); + sb.append(" of ").append(getAllRecordCount()); + sb.append(" ").append(isExistPrePage()).append("/").append( + isExistNextPage()); + if (_pageGroupOption != null) { + sb.append(" group:{").append(getPageGroupSize()).append(",") + .append(pageGroup().createPageNumberList()).append("}"); + } + if (_pageRangeOption != null) { + sb.append(" range:{").append(getPageRangeSize()).append(",") + .append(_pageRangeOption.isFillLimit()); + sb.append(",").append(pageRange().createPageNumberList()).append( + "}"); + } + sb.append(" list=").append( + getSelectedList() != null ? Integer.valueOf(getSelectedList() + .size()) : null); + sb.append(" page=").append(getPageSize()); + sb.append("}"); + sb.append(":selectedList=").append(getSelectedList()); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + /** + * Get the value of pageSize. + * + * @return The value of pageSize. + */ + public int getPageSize() { + return _pageSize; + } + + /** + * Set the value of pageSize. + * + * @param pageSize The value of pageSize. + */ + public void setPageSize(int pageSize) { + _pageSize = pageSize; + } + + /** + * Get the value of currentPageNumber. + * + * @return The value of currentPageNumber. + */ + public int getCurrentPageNumber() { + return _currentPageNumber; + } + + /** + * Set the value of currentPageNumber. + * + * @param currentPageNumber The value of currentPageNumber. + */ + public void setCurrentPageNumber(int currentPageNumber) { + _currentPageNumber = currentPageNumber; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/PagingResultBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ResultBeanBuilder.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ResultBeanBuilder.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ResultBeanBuilder.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,81 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.util.List; + +/** + * The builder of result bean. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class ResultBeanBuilder<ENTITY> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected String _tableDbName; + + //========================================================================== + // ========= + // Constructor + // =========== + public ResultBeanBuilder(String tableDbName) { + _tableDbName = tableDbName; + } + + //========================================================================== + // ========= + // Builder + // ======= + /** + * Build the result bean of list without order-by clause. {for Various} + * + * @param selectedList Selected list. (NotNull) + * @return The result bean of list. (NotNull) + */ + public ListResultBean<ENTITY> buildListResultBean(List<ENTITY> selectedList) { + ListResultBean<ENTITY> rb = new ListResultBean<ENTITY>(); + rb.setTableDbName(_tableDbName); + rb.setAllRecordCount(selectedList.size()); + rb.setSelectedList(selectedList); + return rb; + } + + /** + * Build the result bean of list. {for CB} + * + * @param cb The condition-bean. (NotNull) + * @param selectedList Selected list. (NotNull) + * @return The result bean of list. (NotNull) + */ + public ListResultBean<ENTITY> buildListResultBean(ConditionBean cb, + List<ENTITY> selectedList) { + ListResultBean<ENTITY> rb = new ListResultBean<ENTITY>(); + rb.setTableDbName(_tableDbName); + rb.setAllRecordCount(selectedList.size()); + rb.setSelectedList(selectedList); + rb.setOrderByClause(cb.getSqlComponentOfOrderByClause()); + return rb; + } + + /** + * Build the result bean of paging. {for Paging} + * + * @param pb The bean of paging. (NotNull) + * @param allRecordCount All record count. + * @param selectedList The list of selected entity. (NotNull) + * @return The result bean of paging. (NotNull) + */ + public PagingResultBean<ENTITY> buildPagingResultBean(PagingBean pb, + int allRecordCount, List<ENTITY> selectedList) { + PagingResultBean<ENTITY> rb = new PagingResultBean<ENTITY>(); + rb.setTableDbName(_tableDbName); + rb.setAllRecordCount(allRecordCount); + rb.setSelectedList(selectedList); + rb.setOrderByClause(pb.getSqlComponentOfOrderByClause()); + rb.setPageSize(pb.getFetchSize()); + rb.setCurrentPageNumber(pb.getFetchPageNumber()); + return rb; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ResultBeanBuilder.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SelectResource.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SelectResource.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SelectResource.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +/** + * The select-resource as marker-interface. + * + * @author DBFlute(AutoGenerator) + */ +public interface SelectResource { + + /** + * Check safety result. + * + * @param safetyMaxResultSize Safety max result size. (If zero or minus, + * ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SelectResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimpleOrderByBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimpleOrderByBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimpleOrderByBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,165 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.OrderByClause; +import jp.sf.pal.scheduler.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; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimpleOrderByBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimplePagingBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimplePagingBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimplePagingBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,419 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +import java.util.LinkedHashMap; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.OrderByClause; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; + +/** + * The simple pagingBean. + * + * @author DBFlute(AutoGenerator) + */ +public class SimplePagingBean implements PagingBean, MapParameterBean { + + //========================================================================== + // ========= + // Attribute + // ========= + /** SQL clause instance. */ + protected final SqlClause _sqlClause; + { + _sqlClause = ConditionBeanContext.createSqlClause("Dummy"); + } + + /** The map of parameter. (Nullable) */ + protected Map<String, Object> _parameterMap; + + /** Safety max result size. */ + protected int _safetyMaxResultSize; + + /** Is the execution for paging(NOT count)? */ + protected boolean _paging = true; + + /** Is the count executed later? */ + protected boolean _countLater; + + /** Is fetch narrowing valid? */ + protected boolean _fetchNarrowing = true; + + /** The map for parameter. */ + protected Map<String, Object> _map; + + //========================================================================== + // ========= + // Implementation of PagingBean + // ============================ + // ----------------------------------------------------- + // Paging Determination + // -------------------- + // * * * * * * * * + // For SQL Comment + // * * * * * * * * + /** + * The implementation. + * + * @return Determination. + */ + public boolean isPaging() { + return _paging; + } + + // * * * * * * * * + // For Framework + // * * * * * * * * + /** + * The implementation. + * + * @return Determination. + */ + public boolean isCountLater() { + return _countLater; + } + + // ----------------------------------------------------- + // Paging Setting + // -------------- + /** + * The implementation. + * + * @param pageSize The page size per one page. (NotMinus & NotZero) + * @param pageNumber The number of page. It's ONE origin. (NotMinus & + * NotZero: If it's minus or zero, it treats as one.) + */ + public void paging(int pageSize, int pageNumber) { + fetchFirst(pageSize); + fetchPage(pageNumber); + } + + /** + * The implementation. {INTERNAL METHOD: Don't Invoke This!} + * + * @param paging Determination. + */ + public void xsetPaging(boolean paging) { + if (paging) { + getSqlClause().makeFetchScopeEffective(); + } else { + getSqlClause().ignoreFetchScope(); + } + this._paging = paging; + } + + // ----------------------------------------------------- + // Fetch Setting + // ------------- + /** + * The implementation. + * + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchFirst(int fetchSize) { + getSqlClause().fetchFirst(fetchSize); + return this; + } + + /** + * The implementation. + * + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public PagingBean fetchScope(int fetchStartIndex, int fetchSize) { + getSqlClause().fetchScope(fetchStartIndex, fetchSize); + return this; + } + + /** + * The implementation. + * + * @param fetchPageNumber Fetch-page-number. 1 origin. (NotMinus & NotZero: + * If minus or zero, set one.) + * @return this. (NotNull) + */ + public PagingBean fetchPage(int fetchPageNumber) { + getSqlClause().fetchPage(fetchPageNumber); + return this; + } + + // ----------------------------------------------------- + // Fetch Property + // -------------- + /** + * The implementation. + * + * @return Fetch-start-index. + */ + public int getFetchStartIndex() { + return getSqlClause().getFetchStartIndex(); + } + + /** + * The implementation. + * + * @return Fetch-size. + */ + public int getFetchSize() { + return getSqlClause().getFetchSize(); + } + + /** + * The implementation. + * + * @return Fetch-page-number. + */ + public int getFetchPageNumber() { + return getSqlClause().getFetchPageNumber(); + } + + /** + * The implementation. + * + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex() { + return getSqlClause().getPageStartIndex(); + } + + /** + * The implementation. + * + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex() { + return getSqlClause().getPageEndIndex(); + } + + /** + * Is fetch scope effective? + * + * @return Determination. + */ + public boolean isFetchScopeEffective() { + return getSqlClause().isFetchScopeEffective(); + } + + // ----------------------------------------------------- + // Hint Property + // ------------- + /** + * Get select-hint. {select [select-hint] * from table...} + * + * @return Select-hint. (NotNull) + */ + public String getSelectHint() { + return getSqlClause().getSelectHint(); + } + + /** + * Get from-base-table-hint. {select * from table [from-base-table-hint] + * where ...} + * + * @return from-base-table-hint. (NotNull) + */ + public String getFromBaseTableHint() { + return getSqlClause().getFromBaseTableHint(); + } + + /** + * Get from-hint. {select * from table [from-hint] where ...} + * + * @return From-hint. (NotNull) + */ + public String getFromHint() { + return getSqlClause().getFromHint(); + } + + /** + * Get sql-suffix. {select * from table where ... order by ... [sql-suffix]} + * + * @return Sql-suffix. (NotNull) + */ + public String getSqlSuffix() { + return getSqlClause().getSqlSuffix(); + } + + //========================================================================== + // ========= + // Implementation of FetchNarrowingBean + // ==================================== + /** + * Get fetch-narrowing start-index. + * + * @return Fetch-narrowing start-index. + */ + public int getFetchNarrowingSkipStartIndex() { + return getSqlClause().getFetchNarrowingSkipStartIndex(); + } + + /** + * Get fetch-narrowing size. + * + * @return Fetch-narrowing size. + */ + public int getFetchNarrowingLoopCount() { + return getSqlClause().getFetchNarrowingLoopCount(); + } + + /** + * Is fetch start index supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingSkipStartIndexEffective() { + return !getSqlClause().isFetchStartIndexSupported(); + } + + /** + * Is fetch size supported? + * + * @return Determination. + */ + public boolean isFetchNarrowingLoopCountEffective() { + return !getSqlClause().isFetchSizeSupported(); + } + + /** + * Is fetch-narrowing effective? + * + * @return Determination. + */ + public boolean isFetchNarrowingEffective() { + return _fetchNarrowing && getSqlClause().isFetchNarrowingEffective(); + } + + /** + * Ignore fetch narrowing. Only checking safety result size is valid. + * {INTERNAL METHOD} + */ + public void ignoreFetchNarrowing() { + _fetchNarrowing = false; + } + + /** + * Restore ignored fetch narrowing. {INTERNAL METHOD} + */ + public void restoreIgnoredFetchNarrowing() { + _fetchNarrowing = true; + } + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _safetyMaxResultSize; + } + + //========================================================================== + // ========= + // Implementation of OrderByBean + // ============================= + /** + * 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; + } + + //========================================================================== + // ========= + // Implementation of SelectResource + // ================================ + /** + * Check safety result. + * + * @param safetyMaxResultSize Safety max result size. (If zero or minus, + * ignore checking) + */ + public void checkSafetyResult(int safetyMaxResultSize) { + this._safetyMaxResultSize = safetyMaxResultSize; + } + + //========================================================================== + // ========= + // Implementation of MapParameterBean + // ================================== + /** + * Get the map of parameter. + * + * @return The map of parameter. (Nullable) + */ + public Map<String, Object> getParameterMap() { + return _parameterMap; + } + + /** + * Add the parameter to the map. + * + * @param key The key of parameter. (NotNull) + * @param value The value of parameter. (Nullable) + */ + public void addParameter(String key, Object value) { + if (_parameterMap == null) { + _parameterMap = new LinkedHashMap<String, Object>(); + } + _parameterMap.put(key, value); + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // SqlClause + // --------- + /** + * Get sqlClause. + * + * @return SqlClause. (NotNull) + */ + protected SqlClause getSqlClause() { + return _sqlClause; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SimplePagingBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SubQuery.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SubQuery.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SubQuery.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +public interface SubQuery<SUB_CB extends ConditionBean> { + public void query(SUB_CB subCB); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/SubQuery.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/UnionQuery.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/UnionQuery.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/UnionQuery.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean; + +public interface UnionQuery<UNION_CB extends ConditionBean> { + public void query(UNION_CB unionCB); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/UnionQuery.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKey.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKey.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKey.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,307 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The abstract class of condition-key. + * + * @author DBFlute(AutoGenerator) + */ +public abstract class ConditionKey { + + /** Mark of replaced value. */ + public static final String MARK_OF_REPLACED_VALUE = "ReplacedValue"; + + /** The condition key of equal. */ + public static final ConditionKey CK_EQUAL = new ConditionKeyEqual(); + + /** The condition key of notEqual. */ + public static final ConditionKey CK_NOT_EQUAL = new ConditionKeyNotEqual(); + + /** The condition key of greaterThan. */ + public static final ConditionKey CK_GREATER_THAN = new ConditionKeyGreaterThan(); + + /** The condition key of lessrThan. */ + public static final ConditionKey CK_LESS_THAN = new ConditionKeyLessThan(); + + /** The condition key of greaterEqual. */ + public static final ConditionKey CK_GREATER_EQUAL = new ConditionKeyGreaterEqual(); + + /** The condition key of lessEqual. */ + public static final ConditionKey CK_LESS_EQUAL = new ConditionKeyLessEqual(); + + /** 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 isNull. */ + public static final ConditionKey CK_IS_NULL = new ConditionKeyIsNull(); + + /** The condition key of isNotNull. */ + public static final ConditionKey CK_IS_NOT_NULL = new ConditionKeyIsNotNull(); + + /** Dummy-object for IsNull and IsNotNull and so on... */ + protected static final Object DUMMY_OBJECT = new Object(); + + /** Condition-key. */ + protected String _conditionKey; + + /** Operand. */ + protected String _operand; + + /** + * 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) + * @param value Value. (NotNull) + * @param callerName Caller name. (NotNull) + * @return Determination. + */ + abstract public boolean isValidRegistration(ConditionValue conditionValue, + Object value, String callerName); + + /** + * Add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @return this. + */ + public ConditionKey addWhereClause(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value == null) { + String msg = "Argument[value] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doAddWhereClause(conditionList, columnName, value); + return this; + } + + /** + * Add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + * @return this. + */ + public ConditionKey addWhereClause(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + if (value == null) { + String msg = "Argument[value] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doAddWhereClause(conditionList, columnName, value, option); + return this; + } + + /** + * Do add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + */ + abstract protected void doAddWhereClause(List<String> conditionList, + String columnName, ConditionValue value); + + /** + * Do add where clause. + * + * @param conditionList Condition list. (NotNull) + * @param columnName Column name. (NotNull) + * @param value Condition value. (NotNull) + * @param option Condition option. (NotNull) + */ + abstract protected void doAddWhereClause(List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option); + + /** + * Setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (Nullable) + * @param location Location. (Nullable) + * @return Condition value. (The same as argument[conditionValue]) (NotNull) + */ + public ConditionValue setupConditionValue(ConditionValue conditionValue, + Object value, String location) { + if (conditionValue == null) { + String msg = "Argument[conditionValue] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doSetupConditionValue(conditionValue, value, location); + return conditionValue; + } + + /** + * Setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (Nullable) + * @param location Location. (Nullable) + * @param option Condition option. (NotNull) + * @return Condition value. (The same as argument[conditionValue]) (NotNull) + */ + public ConditionValue setupConditionValue(ConditionValue conditionValue, + Object value, String location, ConditionOption option) { + if (conditionValue == null) { + String msg = "Argument[conditionValue] must not be null:"; + throw new IllegalArgumentException(msg + " value=" + value + + " this.toString()=" + toString()); + } + doSetupConditionValue(conditionValue, value, location, option); + return conditionValue; + } + + /** + * Do setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + */ + abstract protected void doSetupConditionValue( + ConditionValue conditionValue, Object value, String location); + + /** + * Do setup condition value. + * + * @param conditionValue Condition value. (NotNull) + * @param value Value. (NotNull) + * @param location Location. (NotNull) + * @param option Condition option. (NotNull) + */ + abstract protected void doSetupConditionValue( + ConditionValue conditionValue, Object value, String location, + ConditionOption option); + + /** + * Build bind clause. (for s2dao) + * + * @param columnName Column name. (NotNull) + * @param location Location. (NotNull) + * @return Bind clause. (NotNull) + */ + protected String buildBindClause(String columnName, String location) { + return columnName + " " + getOperand() + " " + "/*dto." + location + + "*/null"; + } + + /** + * Build bind clause. (for s2dao) + * + * @param columnName Column name. (NotNull) + * @param location Location. (NotNull) + * @param rearOption Rear option. (NotNull) + * @return Bind clause. (NotNull) + */ + protected String buildBindClauseWithRearOption(String columnName, + String location, String rearOption) { + return columnName + " " + getOperand() + " " + "/*dto." + location + + "*/null" + rearOption; + } + + /** + * Build bind clause. (for s2dao) + * + * @param columnName Column name. (NotNull) + * @param location Location. (NotNull) + * @param dummyValue Dummy value. (NotNull) + * @return Bind clause. (NotNull) + */ + protected String buildBindClause(String columnName, String location, + String dummyValue) { + return columnName + " " + getOperand() + " " + "/*dto." + location + + "*/" + dummyValue; + } + + /** + * Build clause without value. + * + * @param columnName Column name. (NotNull) + * @return Clause without value. (NotNull) + */ + protected String buildClauseWithoutValue(String columnName) { + return columnName + " " + getOperand(); + } + + /** + * Get wild-card. + * + * @return Wild-card. + */ + protected String getWildCard() { + return "%"; + } + + /** + * The override. Returns hash-code of this condition-key string. + * + * @return HashCode. + */ + public int hashCode() { + return getConditionKey().hashCode(); + } + + /** + * The override. If the condition-key of the other is same as this one, + * returns true. + * + * @param other Other entity. (Nullable) + * @return Comparing result. If other is null, returns false. + */ + public boolean equals(Object other) { + if (other instanceof ConditionKey) { + if (this.getConditionKey().equals( + ((ConditionKey) other).getConditionKey())) { + return true; + } + } + return false; + } + + /** + * The override. + * + * @return View-string of condition key information. + */ + public String toString() { + return "ConditionKey: " + getConditionKey() + " " + getOperand() + + " wild-card=[" + getWildCard() + "]"; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKey.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyEqual.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyEqual.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyEqual.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,108 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of equal. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory.getLog(ConditionKeyEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyEqual() { + _conditionKey = "equal"; + _operand = "="; + } + + /** + * 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; + } + if (conditionValue.hasEqual()) { + if (conditionValue.equalEqual(value)) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideEqual(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getEqual() == null) { + return; + } + conditionList + .add(buildBindClause(columnName, value.getEqualLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause with condition-option is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setEqual(value).setEqualLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,109 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of greaterEqual. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyGreaterEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyGreaterEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyGreaterEqual() { + _conditionKey = "greaterEqual"; + _operand = ">="; + } + + /** + * 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; + } + if (conditionValue.hasGreaterEqual()) { + if (conditionValue.equalGreaterEqual(value)) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideGreaterEqual(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getGreaterEqual() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getGreaterEqualLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setGreaterEqual(value).setGreaterEqualLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,109 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of greaterThan. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyGreaterThan extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyGreaterThan.class); + + /** + * Constructor. + */ + protected ConditionKeyGreaterThan() { + _conditionKey = "greaterThan"; + _operand = ">"; + } + + /** + * 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; + } + if (conditionValue.hasGreaterThan()) { + if (conditionValue.equalGreaterThan(value)) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideGreaterThan(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getGreaterThan() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getGreaterThanLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setGreaterThan(value).setGreaterThanLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyGreaterThan.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyInScope.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyInScope.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyInScope.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,127 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of inScope. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyInScope extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyInScope.class); + + /** + * Constructor. + */ + protected ConditionKeyInScope() { + _conditionKey = "inScope"; + _operand = "in"; + } + + /** + * 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; + } + if (value instanceof java.util.List + && ((java.util.List<?>) value).isEmpty()) { + return false; + } + if (value instanceof java.util.List) { + if (conditionValue.hasInScope()) { + if (conditionValue.equalInScope(((java.util.List<?>) value))) { + _log.debug("The value has already registered at " + + callerName + ": value=" + value); + return false; + } else { + conditionValue.overrideInScope(((java.util.List<?>) value)); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getInScope() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getInScopeLocation(), "('a1', 'a2')")); + } + + /** + * 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(java.util.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 InScopeOption)) { + String msg = "The argument[option] should be InScopeOption: columnName=" + + columnName + " value=" + value; + throw new IllegalArgumentException(msg); + } + conditionList.add(buildBindClause(columnName, value + .getInScopeLocation(), "('a1', 'a2')")); + } + + /** + * 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) { + conditionValue.setInScope((java.util.List<?>) value) + .setInScopeLocation(location); + } + + /** + * 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.setInScope((java.util.List<?>) value, + (InScopeOption) option).setInScopeLocation(location); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyInScope.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,100 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of isNotNull. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyIsNotNull extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyIsNotNull.class); + + /** + * Constructor. + */ + protected ConditionKeyIsNotNull() { + _conditionKey = "isNotNull"; + _operand = "is not null"; + } + + /** + * 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 (conditionValue.hasIsNotNull()) { + _log.debug("The value has already registered at " + callerName); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getIsNotNull() == null) { + return; + } + conditionList.add(buildClauseWithoutValue(columnName)); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setIsNotNull(DUMMY_OBJECT) + .setIsNotNullLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNotNull.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNull.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNull.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNull.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,98 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of isNull. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyIsNull extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory.getLog(ConditionKeyIsNull.class); + + /** + * Constructor. + */ + protected ConditionKeyIsNull() { + _conditionKey = "isNull"; + _operand = "is null"; + } + + /** + * 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 (conditionValue.hasIsNull()) { + _log.debug("The value has already registered at " + callerName); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getIsNull() == null) { + return; + } + conditionList.add(buildClauseWithoutValue(columnName)); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setIsNull(DUMMY_OBJECT).setIsNullLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyIsNull.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,109 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of lessEqual. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyLessEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyLessEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyLessEqual() { + _conditionKey = "lessEqual"; + _operand = "<="; + } + + /** + * 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; + } + if (conditionValue.hasLessEqual()) { + if (conditionValue.equalLessEqual(value)) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideLessEqual(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getLessEqual() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getLessEqualLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setLessEqual(value).setLessEqualLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessThan.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessThan.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessThan.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,109 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of lessThan. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyLessThan extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyLessThan.class); + + /** + * Constructor. + */ + protected ConditionKeyLessThan() { + _conditionKey = "lessThan"; + _operand = "<"; + } + + /** + * 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; + } + if (conditionValue.hasLessThan()) { + if (conditionValue.equalLessThan(value)) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideLessThan(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getLessThan() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getLessThanLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setLessThan(value).setLessThanLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLessThan.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,104 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The condition-key of likeSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyLikeSearch extends ConditionKey { + + /** + * Constructor. + */ + protected ConditionKeyLikeSearch() { + _conditionKey = "likeSearch"; + _operand = "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 + .getLikeSearchLocation(), 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.setLikeSearch((String) value, (LikeSearchOption) option) + .setLikeSearchLocation(location); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyLikeSearch.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,109 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of notEqual. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotEqual extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyNotEqual.class); + + /** + * Constructor. + */ + protected ConditionKeyNotEqual() { + _conditionKey = "notEqual"; + _operand = "!="; + } + + /** + * 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; + } + if (conditionValue.hasNotEqual()) { + if (conditionValue.equalNotEqual(value)) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overrideNotEqual(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getNotEqual() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getNotEqualLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause with condition-option is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setNotEqual(value).setNotEqualLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotEqual.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,117 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of notInScope. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyNotInScope extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyNotInScope.class); + + /** + * Constructor. + */ + protected ConditionKeyNotInScope() { + _conditionKey = "notInScope"; + _operand = "not in"; + } + + /** + * 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; + } + if (value instanceof java.util.List + && ((java.util.List<?>) value).isEmpty()) { + return false; + } + if (value instanceof java.util.List) { + if (conditionValue.hasNotInScope()) { + if (conditionValue.equalNotInScope(((java.util.List<?>) value))) { + _log.debug("The value has already registered at " + + callerName + ": value=" + value); + return false; + } else { + conditionValue + .overrideNotInScope(((java.util.List<?>) value)); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getNotInScope() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getNotInScopeLocation(), "('a1', 'a2')")); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setNotInScope((java.util.List<?>) value) + .setNotInScopeLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyNotInScope.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,111 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.ckey; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * The condition-key of prefixSearch. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionKeyPrefixSearch extends ConditionKey { + + /** Log-instance. */ + private static final Log _log = LogFactory + .getLog(ConditionKeyPrefixSearch.class); + + /** + * Constructor. + */ + protected ConditionKeyPrefixSearch() { + _conditionKey = "prefixSearch"; + _operand = "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; + } + if (conditionValue.hasPrefixSearch()) { + if (conditionValue.equalPrefixSearch(value + getWildCard())) { + _log.debug("The value has already registered at " + callerName + + ": value=" + value); + return false; + } else { + conditionValue.overridePrefixSearch(value); + 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(java.util.List<String> conditionList, + String columnName, ConditionValue value) { + if (value.getPrefixSearch() == null) { + return; + } + conditionList.add(buildBindClause(columnName, value + .getPrefixSearchLocation())); + } + + /** + * 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(java.util.List<String> conditionList, + String columnName, ConditionValue value, ConditionOption option) { + throw new UnsupportedOperationException( + "doAddWhereClause that has ConditionOption is unsupported!!!"); + } + + /** + * 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) { + conditionValue.setPrefixSearch( + (value != null ? value + getWildCard() : null)) + .setPrefixSearchLocation(location); + } + + /** + * 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) { + throw new UnsupportedOperationException( + "doSetupConditionValue with condition-option is unsupported!!!"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/ckey/ConditionKeyPrefixSearch.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/ConditionOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/ConditionOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/ConditionOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,10 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption; + +/** + * The interface of condition-option. + * + * @author DBFlute(AutoGenerator) + */ +public interface ConditionOption { + public String getRearOption(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/ConditionOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/DateFromToOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/DateFromToOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/DateFromToOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,27 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption; + +/** + * The option of date-from-to. + * + * <pre> + * ex) fromDate:{2007/04/10 08:24:53} toDate:{2007/04/16 14:36:29} + * + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * new DateFromToOption(); + * --> column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00' + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public class DateFromToOption extends FromToOption { + + //========================================================================== + // ========= + // Constructor + // =========== + public DateFromToOption() { + compareAsDate(); + } +} Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/FromToOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/FromToOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/FromToOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,160 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption; + +/** + * The option of from-to. + * + * <pre> + * ex) fromDate:{2007/04/10 08:24:53} toDate:{2007/04/16 14:36:29} + * + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * new FromToOption().compareAsDate(); + * --> column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00' + * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * + * new FromToOption(); + * --> column >= '2007/04/10 08:24:53' and column <= '2007/04/16 14:36:29' + * + * new FromToOption().greaterThan(); + * --> column > '2007/04/10 08:24:53' and column <= '2007/04/16 14:36:29' + * + * new FromToOption().lessThan(); + * --> column >= '2007/04/10 08:24:53' and column < '2007/04/16 14:36:29' + * + * new FromToOption().greaterThan().lessThan(); + * --> column > '2007/04/10 08:24:53' and column < '2007/04/16 14:36:29' + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public class FromToOption implements ConditionOption { + + //========================================================================== + // ========= + // Attribute + // ========= + protected boolean _fromDateGreaterThan; + + protected boolean _toDateLessThan; + + protected boolean _compareAsDate; + + //========================================================================== + // ========= + // Interface Implementation + // ======================== + public String getRearOption() { + String msg = "Thie option does not use getRearOption()!"; + throw new UnsupportedOperationException(msg); + } + + //========================================================================== + // ========= + // Main + // ==== + public FromToOption greaterThan() { + _fromDateGreaterThan = true; + return this; + } + + public FromToOption lessThan() { + _toDateLessThan = true; + return this; + } + + /** + * Compare as date. + * + * <pre> + * ex) fromDate:{2007/04/10 08:24:53} toDate:{2007/04/16 14:36:29} + * + * new FromToOption().compareAsDate(); + * --> column >= '2007/04/10 00:00:00' and column < '2007/04/17 00:00:00' + * + * This method ignore greaterThan() and lessThan(). + * </pre> + * + * @return this. (NotNull) + */ + public FromToOption compareAsDate() { + _compareAsDate = true; + return this; + } + + //========================================================================== + // ========= + // Internal Main + // ============= + public java.util.Date filterFromDate(java.util.Date fromDate) { + if (fromDate == null) { + return null; + } + if (_compareAsDate) { + final java.util.Calendar cal = java.util.Calendar.getInstance(); + cal.setTimeInMillis(fromDate.getTime()); + clearCalendarHourMinuteSecondMilli(cal); + final java.util.Date cloneDate = (java.util.Date) fromDate.clone(); + cloneDate.setTime(cal.getTimeInMillis()); + return cloneDate; + } + return fromDate; + } + + public java.util.Date filterToDate(java.util.Date toDate) { + if (toDate == null) { + return null; + } + if (_compareAsDate) { + final java.util.Calendar cal = java.util.Calendar.getInstance(); + cal.setTimeInMillis(toDate.getTime()); + clearCalendarHourMinuteSecondMilli(cal); + addCalendarNextDay(cal);// Key Point! + final java.util.Date cloneDate = (java.util.Date) toDate.clone(); + cloneDate.setTime(cal.getTimeInMillis()); + return cloneDate; + } + return toDate; + } + + public jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey getFromDateConditionKey() { + if (_compareAsDate) { + return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL; + } + if (_fromDateGreaterThan) { + return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_THAN;// Default + // ! + } else { + return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_GREATER_EQUAL;// Default + // ! + } + } + + public jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey getToDateConditionKey() { + if (_compareAsDate) { + return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN; + } + if (_toDateLessThan) { + return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_THAN;// Default + // ! + } else { + return jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey.CK_LESS_EQUAL;// Default + // ! + } + } + + //========================================================================== + // ========= + // Calendar Helper + // =============== + protected void addCalendarNextDay(java.util.Calendar cal) { + cal.add(java.util.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)); + } +} Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/InScopeOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/InScopeOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/InScopeOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,95 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; + +/** + * The class of in-scope-option. + * + * @author DBFlute(AutoGenerator) + */ +public class InScopeOption extends SimpleStringOption { + + //========================================================================== + // =========== + // Split + // ===== + public InScopeOption splitBySpace() { + return (InScopeOption) doSplitBySpace(); + } + + public InScopeOption splitBySpace(int splitLimitCount) { + return (InScopeOption) doSplitBySpace(splitLimitCount); + } + + public InScopeOption splitBySpaceContainsDoubleByte() { + return (InScopeOption) doSplitBySpaceContainsDoubleByte(); + } + + public InScopeOption splitBySpaceContainsDoubleByte(int splitLimitCount) { + return (InScopeOption) doSplitBySpaceContainsDoubleByte(splitLimitCount); + } + + public InScopeOption splitByPipeLine() { + return (InScopeOption) doSplitByPipeLine(); + } + + public InScopeOption splitByPipeLine(int splitLimitCount) { + return (InScopeOption) doSplitByPipeLine(splitLimitCount); + } + + //========================================================================== + // =========== + // To Upper/Lower Case + // =================== + public InScopeOption toUpperCase() { + return (InScopeOption) doToUpperCase(); + } + + public InScopeOption toLowerCase() { + return (InScopeOption) doToLowerCase(); + } + + //========================================================================== + // =========== + // To Single Byte + // ============== + public InScopeOption toSingleByteSpace() { + return (InScopeOption) doToSingleByteSpace(); + } + + public InScopeOption toSingleByteAlphabetNumber() { + return (InScopeOption) doToSingleByteAlphabetNumber(); + } + + public InScopeOption toSingleByteAlphabetNumberMark() { + return (InScopeOption) doToSingleByteAlphabetNumberMark(); + } + + //========================================================================== + // =========== + // To Double Byte + // ============== + + //========================================================================== + // =========== + // Japanese + // ======== + public JapaneseOptionPartsAgent localJapanese() { + return doLocalJapanese(); + } + + //========================================================================== + // =========== + // Real Value + // ========== + public java.util.List<String> generateRealValueList( + java.util.List<String> valueList) { + final java.util.List<String> resultList = new java.util.ArrayList<String>(); + for (final java.util.Iterator<String> ite = valueList.iterator(); ite + .hasNext();) { + final String value = ite.next(); + resultList.add(generateRealValue(value)); + } + return resultList; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/InScopeOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/LikeSearchOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/LikeSearchOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/LikeSearchOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,281 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; + +/** + * The class of like-search-option. + * + * @author DBFlute(AutoGenerator) + */ +public class LikeSearchOption extends SimpleStringOption { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final String LIKE_PREFIX = "prefix"; + + protected static final String LIKE_SUFFIX = "suffix"; + + protected static final String LIKE_CONTAIN = "contain"; + + //========================================================================== + // ========= + // Attribute + // ========= + protected String _like; + + protected String _escape; + + protected boolean _asOrSplit; + + protected List<LikeAsOrCallback> _likeAsOrCallbackList; + + //========================================================================== + // ========= + // Rear Option + // =========== + public String getRearOption() { + if (_escape == null || _escape.trim().length() == 0) { + return ""; + } + return " escape '" + _escape + "'"; + } + + //========================================================================== + // ========= + // AsOr + // ==== + /** @deprecated */ + public static interface LikeAsOrCallback { + public String getAdditionalTargetPropertyName(); + + public String filterValue(String currentValue); + + public LikeSearchOption filterOption( + LikeSearchOption optionDeepCopyWithoutCallback); + } + + /** @deprecated */ + public static abstract class DefaultLikeAsOrCallback implements + LikeAsOrCallback { + public String filterValue(String currentValue) { + return currentValue; + } + + public LikeSearchOption filterOption( + LikeSearchOption optionDeepCopyWithoutCallback) { + return optionDeepCopyWithoutCallback; + } + } + + public boolean hasLikeAsOrCallback() { + return _likeAsOrCallbackList != null + && !_likeAsOrCallbackList.isEmpty(); + } + + public List<LikeAsOrCallback> getLikeAsOrCallbackList() { + if (_likeAsOrCallbackList == null) { + _likeAsOrCallbackList = new ArrayList<LikeAsOrCallback>(); + } + return _likeAsOrCallbackList; + } + + /** + * @param likeAsOrCallback Callback. + * @deprecated + */ + public void addLikeAsOrCallback(LikeAsOrCallback likeAsOrCallback) { + getLikeAsOrCallbackList().add(likeAsOrCallback); + } + + public void clearLikeAsOrCallback() { + getLikeAsOrCallbackList().clear(); + } + + //========================================================================== + // ========= + // Like + // ==== + public LikeSearchOption likePrefix() { + _like = LIKE_PREFIX; + return this; + } + + public LikeSearchOption likeSuffix() { + _like = LIKE_SUFFIX; + return this; + } + + public LikeSearchOption likeContain() { + _like = LIKE_CONTAIN; + return this; + } + + //========================================================================== + // ========= + // Escape + // ====== + public LikeSearchOption escapeByPipeLine() { + _escape = "|"; + return this; + } + + public LikeSearchOption escapeByAtMark() { + _escape = "@"; + return this; + } + + public LikeSearchOption escapeBySlash() { + _escape = "/"; + return this; + } + + public LikeSearchOption escapeByBackSlash() { + _escape = "\\"; + return this; + } + + //========================================================================== + // ========= + // Split + // ===== + public LikeSearchOption splitBySpace() { + return (LikeSearchOption) doSplitBySpace(); + } + + public LikeSearchOption splitBySpace(int splitLimitCount) { + return (LikeSearchOption) doSplitBySpace(splitLimitCount); + } + + public LikeSearchOption splitBySpaceContainsDoubleByte() { + return (LikeSearchOption) doSplitBySpaceContainsDoubleByte(); + } + + public LikeSearchOption splitBySpaceContainsDoubleByte(int splitLimitCount) { + return (LikeSearchOption) doSplitBySpaceContainsDoubleByte(splitLimitCount); + } + + public LikeSearchOption splitByPipeLine() { + return (LikeSearchOption) doSplitByPipeLine(); + } + + public LikeSearchOption splitByPipeLine(int splitLimitCount) { + return (LikeSearchOption) doSplitByPipeLine(splitLimitCount); + } + + public LikeSearchOption asOrSplit() { + _asOrSplit = true; + return this; + } + + public boolean isAsOrSplit() { + return _asOrSplit; + } + + //========================================================================== + // ========= + // To Upper/Lower Case + // =================== + public LikeSearchOption toUpperCase() { + return (LikeSearchOption) doToUpperCase(); + } + + public LikeSearchOption toLowerCase() { + return (LikeSearchOption) doToLowerCase(); + } + + //========================================================================== + // ========= + // To Single Byte + // ============== + public LikeSearchOption toSingleByteSpace() { + return (LikeSearchOption) doToSingleByteSpace(); + } + + public LikeSearchOption toSingleByteAlphabetNumber() { + return (LikeSearchOption) doToSingleByteAlphabetNumber(); + } + + public LikeSearchOption toSingleByteAlphabetNumberMark() { + return (LikeSearchOption) doToSingleByteAlphabetNumberMark(); + } + + //========================================================================== + // ========= + // To Double Byte + // ============== + + //========================================================================== + // ========= + // Japanese + // ======== + public JapaneseOptionPartsAgent localJapanese() { + return doLocalJapanese(); + } + + //========================================================================== + // ========= + // Real Value + // ========== + public String generateRealValue(String value) { + value = super.generateRealValue(value); + + // Escape + if (_escape != null && _escape.trim().length() != 0) { + String tmp = replace(value, _escape, _escape + _escape); + tmp = replace(tmp, "%", _escape + "%"); + tmp = replace(tmp, "_", _escape + "_"); + value = tmp; + } + final String wildCard = "%"; + if (_like == null || _like.trim().length() == 0) { + return value; + } else if (_like.equals(LIKE_PREFIX)) { + return value + wildCard; + } else if (_like.equals(LIKE_SUFFIX)) { + return wildCard + value; + } else if (_like.equals(LIKE_CONTAIN)) { + return wildCard + value + wildCard; + } else { + String msg = "The like was wrong string: " + _like; + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // DeepCopy + // ======== + public Object createDeepCopy() { + final LikeSearchOption deepCopy = (LikeSearchOption) super + .createDeepCopy(); + deepCopy._like = _like; + deepCopy._escape = _escape; + if (hasLikeAsOrCallback()) { + for (Iterator<LikeAsOrCallback> ite = _likeAsOrCallbackList + .iterator(); ite.hasNext();) { + deepCopy.addLikeAsOrCallback((LikeAsOrCallback) ite.next()); + } + } + return deepCopy; + } + + protected SimpleStringOption newDeepCopyInstance() { + return new LikeSearchOption(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return "like=" + _like + ", escape=" + _escape + ", split=" + isSplit() + + ", asOrSplit = " + _asOrSplit; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/LikeSearchOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/SimpleStringOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/SimpleStringOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/SimpleStringOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,192 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.SplitOptionParts; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.ToSingleByteOptionParts; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.ToUpperLowerCaseOptionParts; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.local.JapaneseOptionPartsAgent; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; + +/** + * The class of simple-string-option. + * + * @author DBFlute(AutoGenerator) + */ +public class SimpleStringOption implements ConditionOption { + + protected SplitOptionParts _splitOptionParts; + + protected ToUpperLowerCaseOptionParts _toUpperLowerCaseOptionParts; + + protected ToSingleByteOptionParts _toSingleByteCaseOptionParts; + + protected JapaneseOptionPartsAgent _japaneseOptionPartsAgent; + + //========================================================================== + // =========== + // Rear Option + // =========== + public String getRearOption() { + return ""; + } + + //========================================================================== + // =========== + // Split + // ===== + protected SimpleStringOption doSplitBySpace() { + getSplitOptionParts().splitBySpace(); + return this; + } + + protected SimpleStringOption doSplitBySpace(int splitLimitCount) { + getSplitOptionParts().splitBySpace(splitLimitCount); + return this; + } + + protected SimpleStringOption doSplitBySpaceContainsDoubleByte() { + getSplitOptionParts().splitBySpaceContainsDoubleByte(); + return this; + } + + protected SimpleStringOption doSplitBySpaceContainsDoubleByte( + int splitLimitCount) { + getSplitOptionParts().splitBySpaceContainsDoubleByte(splitLimitCount); + return this; + } + + protected SimpleStringOption doSplitByPipeLine() { + getSplitOptionParts().splitByPipeLine(); + return this; + } + + protected SimpleStringOption doSplitByPipeLine(int splitLimitCount) { + getSplitOptionParts().splitByPipeLine(splitLimitCount); + return this; + } + + protected SplitOptionParts getSplitOptionParts() { + if (_splitOptionParts == null) { + _splitOptionParts = new SplitOptionParts(); + } + return _splitOptionParts; + } + + public boolean isSplit() { + return getSplitOptionParts().isSplit(); + } + + public String[] generateSplitValueArray(String value) { + return getSplitOptionParts().generateSplitValueArray(value); + } + + //========================================================================== + // =========== + // To Upper/Lower Case + // =================== + protected SimpleStringOption doToUpperCase() { + getToUpperLowerCaseOptionParts().toUpperCase(); + return this; + } + + protected SimpleStringOption doToLowerCase() { + getToUpperLowerCaseOptionParts().toLowerCase(); + return this; + } + + protected ToUpperLowerCaseOptionParts getToUpperLowerCaseOptionParts() { + if (_toUpperLowerCaseOptionParts == null) { + _toUpperLowerCaseOptionParts = new ToUpperLowerCaseOptionParts(); + } + return _toUpperLowerCaseOptionParts; + } + + //========================================================================== + // =========== + // To Single Byte + // ============== + protected SimpleStringOption doToSingleByteSpace() { + getToSingleByteOptionParts().toSingleByteSpace(); + return this; + } + + protected SimpleStringOption doToSingleByteAlphabetNumber() { + getToSingleByteOptionParts().toSingleByteAlphabetNumber(); + return this; + } + + protected SimpleStringOption doToSingleByteAlphabetNumberMark() { + getToSingleByteOptionParts().toSingleByteAlphabetNumberMark(); + return this; + } + + protected ToSingleByteOptionParts getToSingleByteOptionParts() { + if (_toSingleByteCaseOptionParts == null) { + _toSingleByteCaseOptionParts = new ToSingleByteOptionParts(); + } + return _toSingleByteCaseOptionParts; + } + + //========================================================================== + // =========== + // To Double Byte + // ============== + + //========================================================================== + // =========== + // Japanese + // ======== + protected JapaneseOptionPartsAgent doLocalJapanese() { + return getJapaneseOptionPartsAgent(); + } + + protected JapaneseOptionPartsAgent getJapaneseOptionPartsAgent() { + if (_japaneseOptionPartsAgent == null) { + _japaneseOptionPartsAgent = new JapaneseOptionPartsAgent(); + } + return _japaneseOptionPartsAgent; + } + + //========================================================================== + // =========== + // Real Value + // ========== + public String generateRealValue(String value) { + value = getToUpperLowerCaseOptionParts().generateRealValue(value); + value = getToSingleByteOptionParts().generateRealValue(value); + value = getJapaneseOptionPartsAgent().generateRealValue(value); + return value; + } + + //========================================================================== + // =========== + // General Helper + // ============== + protected String replace(String text, String fromText, String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + //========================================================================== + // =========== + // DeepCopy + // ======== + public Object createDeepCopy() { + final SimpleStringOption deepCopy = newDeepCopyInstance(); + deepCopy._splitOptionParts = _splitOptionParts != null ? (SplitOptionParts) _splitOptionParts + .createDeepCopy() + : null; + deepCopy._toUpperLowerCaseOptionParts = _toUpperLowerCaseOptionParts != null ? (ToUpperLowerCaseOptionParts) _toUpperLowerCaseOptionParts + .createDeepCopy() + : null; + deepCopy._toSingleByteCaseOptionParts = _toSingleByteCaseOptionParts != null ? (ToSingleByteOptionParts) _toSingleByteCaseOptionParts + .createDeepCopy() + : null; + deepCopy._japaneseOptionPartsAgent = _japaneseOptionPartsAgent != null ? (JapaneseOptionPartsAgent) _japaneseOptionPartsAgent + .createDeepCopy() + : null; + return deepCopy; + } + + protected SimpleStringOption newDeepCopyInstance() { + return new SimpleStringOption(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/SimpleStringOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/SplitOptionParts.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/SplitOptionParts.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/SplitOptionParts.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,161 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts; + +/** + * The interface of condition-option. + * + * @author DBFlute(AutoGenerator) + */ +public class SplitOptionParts { + + //========================================================================== + // =========== + // Attribute + // ========= + protected String _split; + + protected String _splitContainedDelimiter; + + protected int _splitLimitCount; + + //========================================================================== + // =========== + // Main + // ==== + public boolean isSplit() { + return _split != null; + } + + public void splitBySpace() { + _split = " "; + } + + public void splitBySpace(int splitLimitCount) { + _split = " "; + _splitLimitCount = splitLimitCount; + } + + public void splitBySpaceContainsDoubleByte() { + _split = " "; + _splitContainedDelimiter = "\u3000"; + } + + public void splitBySpaceContainsDoubleByte(int splitLimitCount) { + _split = " "; + _splitContainedDelimiter = "\u3000"; + _splitLimitCount = splitLimitCount; + } + + public void splitByPipeLine() { + _split = "|"; + } + + public void splitByPipeLine(int splitLimitCount) { + _split = "|"; + _splitLimitCount = splitLimitCount; + } + + //========================================================================== + // =========== + // Real Value + // ========== + public String[] generateSplitValueArray(String value) { + if (value == null) { + String msg = "The argument[value] should not be null of empty: " + + value; + throw new IllegalArgumentException(msg); + } + value = repalceContainedDelimiterToRealDelimiter(value); + final java.util.StringTokenizer st = new java.util.StringTokenizer( + value, _split); + final String[] tokenizedValues = new String[st.countTokens()]; + int count = 0; + while (st.hasMoreTokens()) { + tokenizedValues[count] = st.nextToken(); + count++; + } + final String[] values = removeInvalidValue(tokenizedValues); + if (_splitLimitCount > 0 && values.length > _splitLimitCount) { + final String[] realValues = new String[_splitLimitCount]; + for (int i = 0; i < values.length; i++) { + if (i == _splitLimitCount) { + break; + } + realValues[i] = values[i]; + } + return realValues; + } else { + return values; + } + + } + + protected String repalceContainedDelimiterToRealDelimiter(String value) { + if (value == null) { + return value; + } + if (_splitContainedDelimiter == null) { + return value; + } + if (_split == null) { + return value; + } + return replace(value, _splitContainedDelimiter, _split); + } + + protected String[] removeInvalidValue(String[] values) { + final java.util.List<String> ls = new java.util.ArrayList<String>(); + for (int i = 0; i < values.length; i++) { + final String value = values[i]; + if (value == null || value.equals("")) {// Don't trim!!! + continue; + } + ls.add(value); + } + final String[] resultArray = new String[ls.size()]; + for (int i = 0; i < ls.size(); i++) { + resultArray[i] = (String) ls.get(i); + } + return resultArray; + } + + //========================================================================== + // =========== + // Helper + // ====== + protected 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(); + } + + //========================================================================== + // =========== + // DeepCopy + // ======== + public Object createDeepCopy() { + final SplitOptionParts deepCopy = new SplitOptionParts(); + deepCopy._split = _split; + deepCopy._splitContainedDelimiter = _splitContainedDelimiter; + deepCopy._splitLimitCount = _splitLimitCount; + return deepCopy; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/SplitOptionParts.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,88 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts; + +import jp.sf.pal.scheduler.db.allcommon.helper.character.GeneralCharacter; +import jp.sf.pal.scheduler.db.allcommon.helper.character.impl.GeneralCharacterImpl; + +/** + * The interface of condition-option. + * + * @author DBFlute(AutoGenerator) + */ +public class ToSingleByteOptionParts { + + //========================================================================== + // =========== + // Attribute + // ========= + protected boolean _toSingleByteSpace; + + protected boolean _toSingleByteAlphabetNumber; + + protected boolean _toSingleByteAlphabetNumberMark; + + private GeneralCharacter _generalCharacter; + + //========================================================================== + // =========== + // Main + // ==== + public boolean isToSingleByteSpace() { + return _toSingleByteSpace; + } + + public void toSingleByteSpace() { + _toSingleByteSpace = true; + } + + public void toSingleByteAlphabetNumber() { + _toSingleByteAlphabetNumber = true; + } + + public void toSingleByteAlphabetNumberMark() { + _toSingleByteAlphabetNumberMark = true; + } + + //========================================================================== + // =========== + // Real Value + // ========== + public String generateRealValue(String value) { + if (value == null) { + return value; + } + + // To Single Byte + if (_toSingleByteSpace) { + value = (value != null ? value.replaceAll("\u3000", " ") : value); + } + if (_toSingleByteAlphabetNumberMark) { + value = getGeneralCharacter().toSingleByteAlphabetNumberMark(value); + } else if (_toSingleByteAlphabetNumber) { + value = getGeneralCharacter().toSingleByteAlphabetNumber(value); + } + return value; + } + + //========================================================================== + // =========== + // Helper + // ====== + protected GeneralCharacter getGeneralCharacter() { + if (_generalCharacter == null) { + _generalCharacter = new GeneralCharacterImpl(); + } + return _generalCharacter; + } + + //========================================================================== + // =========== + // DeepCopy + // ======== + public Object createDeepCopy() { + final ToSingleByteOptionParts deepCopy = new ToSingleByteOptionParts(); + deepCopy._toSingleByteSpace = _toSingleByteSpace; + deepCopy._toSingleByteAlphabetNumber = _toSingleByteAlphabetNumber; + deepCopy._toSingleByteAlphabetNumberMark = _toSingleByteAlphabetNumberMark; + return deepCopy; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToSingleByteOptionParts.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,61 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts; + +/** + * The class of condition-option-parts about toUpperCase/toLowerCase. + * + * @author DBFlute(AutoGenerator) + */ +public class ToUpperLowerCaseOptionParts { + + //========================================================================== + // =========== + // Attribute + // ========= + protected boolean _toUpperCase; + + protected boolean _toLowerCase; + + //========================================================================== + // =========== + // Main + // ==== + public void toUpperCase() { + _toUpperCase = true; + _toLowerCase = false; + } + + public void toLowerCase() { + _toUpperCase = false; + _toLowerCase = true; + } + + //========================================================================== + // =========== + // Real Value + // ========== + public String generateRealValue(String value) { + if (value == null) { + return value; + } + + // To Upper/Lower Case + if (_toUpperCase) { + value = (value != null ? value.toUpperCase() : value); + } + if (_toLowerCase) { + value = (value != null ? value.toLowerCase() : value); + } + return value; + } + + //========================================================================== + // =========== + // DeepCopy + // ======== + public Object createDeepCopy() { + final ToUpperLowerCaseOptionParts deepCopy = new ToUpperLowerCaseOptionParts(); + deepCopy._toUpperCase = _toUpperCase; + deepCopy._toLowerCase = _toLowerCase; + return deepCopy; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/ToUpperLowerCaseOptionParts.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,87 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.coption.parts.local; + +import jp.sf.pal.scheduler.db.allcommon.helper.character.JapaneseCharacter; +import jp.sf.pal.scheduler.db.allcommon.helper.character.impl.JapaneseCharacterImpl; + +/** + * The class of condition-option-parts-agent. + * + * @author DBFlute(AutoGenerator) + */ +public class JapaneseOptionPartsAgent { + + //========================================================================== + // =========== + // Attribute + // ========= + protected boolean _toDoubleByteKatakana; + + protected boolean _removeLastLongVowel; + + private JapaneseCharacter _japaneseCharacter; + + //========================================================================== + // =========== + // Main + // ==== + public boolean isToDoubleByteKatakana() { + return _toDoubleByteKatakana; + } + + public void toDoubleByteKatakana() { + _toDoubleByteKatakana = true; + } + + public boolean isRemoveLastLongVowel() { + return _removeLastLongVowel; + } + + public void removeLastLongVowel() { + _removeLastLongVowel = true; + } + + //========================================================================== + // =========== + // Real Value + // ========== + public String generateRealValue(String value) { + if (value == null) { + return value; + } + + // To Double Byte + if (_toDoubleByteKatakana) { + value = getJapaneseCharacter().toDoubleByteKatakana(value); + } + + // Remove + if (_removeLastLongVowel) { + if (value != null && value.endsWith("\u30fc")) { + value = value.substring(0, value.length() - "\u30fc".length()); + } + } + return value; + } + + //========================================================================== + // =========== + // Helper + // ====== + protected JapaneseCharacter getJapaneseCharacter() { + if (_japaneseCharacter == null) { + _japaneseCharacter = new JapaneseCharacterImpl(); + } + return _japaneseCharacter; + } + + //========================================================================== + // =========== + // DeepCopy + // ======== + public Object createDeepCopy() { + final JapaneseOptionPartsAgent deepCopy = new JapaneseOptionPartsAgent(); + deepCopy._toDoubleByteKatakana = _toDoubleByteKatakana; + deepCopy._removeLastLongVowel = _removeLastLongVowel; + return deepCopy; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/coption/parts/local/JapaneseOptionPartsAgent.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ConditionValue.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ConditionValue.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ConditionValue.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1218 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.cvalue; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption; + +/** + * Condition value. + * + * @author DBFlute(AutoGenerator) + */ +public class ConditionValue { + + //========================================================================== + // ========= + // Equal + // ===== + /** Value of equal. */ + protected Object _equalValue; + + /** + * Get the value of equal. + * + * @return The value of equal. (Nullable) + */ + public Object getEqual() { + return filterValue(_equalValue); + } + + /** + * Set the value of equal. + * + * @param value The value of equal. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setEqual(Object value) { + _equalValue = value; + return this; + } + + /** + * Does it has the value of equal? + * + * @return Determination. (NotNull) + */ + public boolean hasEqual() { + return _equalValue != null; + } + + /** + * Does the value equal the value of equal? + * + * @param value The value of equal. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalEqual(Object value) { + return hasEqual() ? _equalValue.equals(value) : value == null; + } + + /** + * Override the value of equal. + * + * @param value The value of equal. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideEqual(Object value) { + _equalValue = value; + return this; + } + + /** Location of equal. */ + protected String _equalLocation; + + /** + * Get the location of equal. + * + * @return The location of equal. (Nullable) + */ + public String getEqualLocation() { + return _equalLocation; + } + + /** + * Set the location of equal. + * + * @param location The location of equal. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setEqualLocation(String location) { + _equalLocation = location; + return this; + } + + //========================================================================== + // ========= + // Not Equal + // ========= + /** Value of notEqual. */ + protected Object _notEqualValue; + + /** + * Get the value of notEqual. + * + * @return The value of notEqual. (Nullable) + */ + public Object getNotEqual() { + return filterValue(_notEqualValue); + } + + /** + * Set the value of notEqual. + * + * @param value The value of notEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotEqual(Object value) { + _notEqualValue = value; + return this; + } + + /** + * Does it has the value of notEqual? + * + * @return Determination. (NotNull) + */ + public boolean hasNotEqual() { + return _notEqualValue != null; + } + + /** + * Does the value equal the value of notEqual? + * + * @param value The value of notEqual. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalNotEqual(Object value) { + return hasNotEqual() ? _notEqualValue.equals(value) : value == null; + } + + /** + * Override the value of notEqual. + * + * @param value The value of notEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideNotEqual(Object value) { + _notEqualValue = value; + return this; + } + + /** Location of notEqual. */ + protected String _notEqualLocation; + + /** + * Get the location of notEqual. + * + * @return The location of notEqual. (Nullable) + */ + public String getNotEqualLocation() { + return _notEqualLocation; + } + + /** + * Set the location of notEqual. + * + * @param location The location of notEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotEqualLocation(String location) { + _notEqualLocation = location; + return this; + } + + //========================================================================== + // ========= + // Greater Than + // ============ + /** Value of greaterThan. */ + protected Object _greaterThanValue; + + /** + * Get the value of greaterThan. + * + * @return The value of greaterThan. (Nullable) + */ + public Object getGreaterThan() { + return filterValue(_greaterThanValue); + } + + /** + * Set the value of greaterThan. + * + * @param value The value of greaterThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterThan(Object value) { + _greaterThanValue = value; + return this; + } + + /** + * Does it has the value of greaterThan? + * + * @return Determination. (NotNull) + */ + public boolean hasGreaterThan() { + return _greaterThanValue != null; + } + + /** + * Does the value equal the value of greaterThan? + * + * @param value The value of greaterThan. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalGreaterThan(Object value) { + return hasGreaterThan() ? _greaterThanValue.equals(value) + : value == null; + } + + /** + * Override the value of greaterThan. + * + * @param value The value of greaterThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideGreaterThan(Object value) { + _greaterThanValue = value; + return this; + } + + /** Location of GreaterThan. */ + protected String _greaterThanLocation; + + /** + * Get the location of greaterThan. + * + * @return The location of greaterThan. (Nullable) + */ + public String getGreaterThanLocation() { + return _greaterThanLocation; + } + + /** + * Set the location of greaterThan. + * + * @param location The location of greaterThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterThanLocation(String location) { + _greaterThanLocation = location; + return this; + } + + //========================================================================== + // ========= + // Less Than + // ========= + /** Value of lessThan. */ + protected Object _lessThanValue; + + /** + * Get the value of lessThan. + * + * @return The value of lessThan. (Nullable) + */ + public Object getLessThan() { + return filterValue(_lessThanValue); + } + + /** + * Set the value of lessThan. + * + * @param value The value of lessThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessThan(Object value) { + _lessThanValue = value; + return this; + } + + /** + * Does it has the value of lessThan? + * + * @return Determination. (NotNull) + */ + public boolean hasLessThan() { + return _lessThanValue != null; + } + + /** + * Does the value equal the value of lessThan? + * + * @param value The value of lessThan. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalLessThan(Object value) { + return hasLessThan() ? _lessThanValue.equals(value) : value == null; + } + + /** + * Override the value of lessThan. + * + * @param value The value of lessThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideLessThan(Object value) { + _lessThanValue = value; + return this; + } + + /** Location of lessThan. */ + protected String _lessThanLocation; + + /** + * Get the location of lessThan. + * + * @return The location of lessThan. (Nullable) + */ + public String getLessThanLocation() { + return _lessThanLocation; + } + + /** + * Set the location of lessThan. + * + * @param location The location of lessThan. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessThanLocation(String location) { + _lessThanLocation = location; + return this; + } + + //========================================================================== + // ========= + // Greater Equal + // ============= + /** Value of greaterEqual. */ + protected Object _greaterEqualValue; + + /** + * Get the value of greaterEqual. + * + * @return The value of greaterEqual. (Nullable) + */ + public Object getGreaterEqual() { + return filterValue(_greaterEqualValue); + } + + /** + * Set the value of greaterEqual. + * + * @param value The value of greaterEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterEqual(Object value) { + _greaterEqualValue = value; + return this; + } + + /** + * Does it has the value of greaterEqual? + * + * @return Determination. (NotNull) + */ + public boolean hasGreaterEqual() { + return _greaterEqualValue != null; + } + + /** + * Does the value equal the value of greaterEqual? + * + * @param value The value of greaterEqual. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalGreaterEqual(Object value) { + return hasGreaterEqual() ? _greaterEqualValue.equals(value) + : value == null; + } + + /** + * Override the value of greaterEqual. + * + * @param value The value of greaterEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideGreaterEqual(Object value) { + _greaterEqualValue = value; + return this; + } + + /** Location of greaterEqual. */ + protected String _greaterEqualLocation; + + /** + * Get the location of greaterEqual. + * + * @return The location of greaterEqual. (Nullable) + */ + public String getGreaterEqualLocation() { + return _greaterEqualLocation; + } + + /** + * Set the location of greaterEqual. + * + * @param location The location of greaterEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setGreaterEqualLocation(String location) { + _greaterEqualLocation = location; + return this; + } + + //========================================================================== + // ========= + // Less Equal + // ========== + /** Value of lessEqual. */ + protected Object _lessEqualValue; + + /** + * Get the value of lessEqual. + * + * @return The value of lessEqual. (Nullable) + */ + public Object getLessEqual() { + return filterValue(_lessEqualValue); + } + + /** + * Set the value of lessEqual. + * + * @param value The value of lessEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessEqual(Object value) { + _lessEqualValue = value; + return this; + } + + /** + * Does it has the value of lessEqual? + * + * @return Determination. (NotNull) + */ + public boolean hasLessEqual() { + return _lessEqualValue != null; + } + + /** + * Does the value equal the value of lessEqual? + * + * @param value The value of lessEqual. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalLessEqual(Object value) { + return hasLessEqual() ? _lessEqualValue.equals(value) : value == null; + } + + /** + * Override the value of lessEqual. + * + * @param value The value of lessEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideLessEqual(Object value) { + _lessEqualValue = value; + return this; + } + + /** Location of lessEqual. */ + protected String _lessEqualLocation; + + /** + * Get the location of lessEqual. + * + * @return The location of lessEqual. (Nullable) + */ + public String getLessEqualLocation() { + return _lessEqualLocation; + } + + /** + * Set the location of lessEqual. + * + * @param location The location of lessEqual. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setLessEqualLocation(String location) { + _lessEqualLocation = location; + return this; + } + + //========================================================================== + // ========= + // Prefix Search + // ============= + /** Value of prefixSearch. */ + protected Object _prefixSearch; + + /** + * Get the value of prefixSearch. + * + * @return The value of prefixSearch. (Nullable) + */ + public Object getPrefixSearch() { + return filterValue(_prefixSearch); + } + + /** + * Set the value of prefixSearch. + * + * @param value The value of prefixSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setPrefixSearch(Object value) { + _prefixSearch = value; + return this; + } + + /** + * Does it has the value of prefixSearch? + * + * @return Determination. (NotNull) + */ + public boolean hasPrefixSearch() { + return _prefixSearch != null; + } + + /** + * Does the value equal the value of prefixSearch? + * + * @param value The value of prefixSearch. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalPrefixSearch(Object value) { + return hasPrefixSearch() ? _prefixSearch.equals(value) : value == null; + } + + /** + * Override the value of prefixSearch. + * + * @param value The value of prefixSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overridePrefixSearch(Object value) { + _prefixSearch = value; + return this; + } + + /** Location of prefixSearch. */ + protected String _prefixSearchLocation; + + /** + * Get the location of prefixSearch. + * + * @return The location of prefixSearch. (Nullable) + */ + public String getPrefixSearchLocation() { + return _prefixSearchLocation; + } + + /** + * Set the location of prefixSearch. + * + * @param location The location of prefixSearch. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setPrefixSearchLocation(String location) { + _prefixSearchLocation = location; + return this; + } + + //========================================================================== + // ========= + // 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. */ + protected List<?> _inScope; + + protected InScopeOption _inScopeOption; + + /** + * Get the value of inScope. + * + * @return The value of inScope. (Nullable) + */ + @SuppressWarnings("unchecked") + public List<?> getInScope() { + if (_inScopeOption != null) { + return filterValue(_inScopeOption + .generateRealValueList((List<String>) _inScope)); + } + return filterValue(_inScope); + } + + /** + * Set the value of inScope. + * + * @param value The value of inScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setInScope(List<?> value) { + _inScope = value; + return this; + } + + public ConditionValue setInScope(List<?> value, InScopeOption option) { + _inScope = value; + _inScopeOption = option; + return this; + } + + /** + * Does it has the value of inScope? + * + * @return Determination. (NotNull) + */ + public boolean hasInScope() { + return _inScope != null; + } + + /** + * Does the value equal the value of inScope? + * + * @param value The value of inScope. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalInScope(List<?> value) { + return hasInScope() ? _inScope.equals(value) : value == null; + } + + /** + * Override the value of inScope. + * + * @param value The value of inScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideInScope(List<?> value) { + _inScope = value; + return this; + } + + /** Location of InScope. */ + protected String _inScopeLocation; + + /** + * Get the location of inScope. + * + * @return The location of inScope. (Nullable) + */ + public String getInScopeLocation() { + return _inScopeLocation; + } + + /** + * Set the location of inScope. + * + * @param location The location of inScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setInScopeLocation(String location) { + _inScopeLocation = location; + return this; + } + + //========================================================================== + // ========= + // Not In Scope + // ============ + /** Value of notInScope. */ + protected List<?> _notInScope; + + /** + * Get the value of notInScope. + * + * @return The value of notInScope. (Nullable) + */ + public List<?> getNotInScope() { + return filterValue(_notInScope); + } + + /** + * Set the value of notInScope. + * + * @param value The value of notInScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotInScope(List<?> value) { + _notInScope = value; + return this; + } + + /** + * Does it has the value of inNotScope? + * + * @return Determination. (NotNull) + */ + public boolean hasNotInScope() { + return _notInScope != null; + } + + /** + * Does the value equal the value of inNotScope? + * + * @param value The value of inNotScope. (Nullable) + * @return Determination. (NotNull) + */ + public boolean equalNotInScope(List<?> value) { + return hasNotInScope() ? _notInScope.equals(value) : value == null; + } + + /** + * Override the value of inNotScope. + * + * @param value The value of inNotScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue overrideNotInScope(List<?> value) { + _notInScope = value; + return this; + } + + /** Location of notInScope. */ + protected String _notInScopeLocation; + + /** + * Get the location of notInScope. + * + * @return The location of notInScope. (Nullable) + */ + public String getNotInScopeLocation() { + return _notInScopeLocation; + } + + /** + * Set the location of notInScope. + * + * @param location The location of notInScope. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setNotInScopeLocation(String location) { + _notInScopeLocation = location; + return this; + } + + //========================================================================== + // ========= + // Is Null + // ======= + /** Value of isNull. */ + protected Object _isNullValue; + + /** + * Get the value of isNull. + * + * @return The value of isNull. (Nullable) + */ + public Object getIsNull() { + return _isNullValue; + } + + /** + * Set the value of isNull. + * + * @param value The value of isNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNull(Object value) { + _isNullValue = value; + return this; + } + + /** + * Does it has the value of isNull? + * + * @return Determination. (NotNull) + */ + public boolean hasIsNull() { + return _isNullValue != null; + } + + /** Location of isNull. */ + protected String _isNullLocation; + + /** + * Get the location of isNull. + * + * @return The location of isNull. (Nullable) + */ + public String getIsNullLocation() { + return _isNullLocation; + } + + /** + * Set the location of isNull. + * + * @param location The location of isNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNullLocation(String location) { + _isNullLocation = location; + return this; + } + + //========================================================================== + // ========= + // Is Not Null + // =========== + /** Value of isNotNull. */ + protected Object _isNotNullValue; + + /** + * Get the value of isNotNull. + * + * @return The value of isNotNull. (Nullable) + */ + public Object getIsNotNull() { + return _isNotNullValue; + } + + /** + * Set the value of isNotNull. + * + * @param value The value of isNotNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNotNull(Object value) { + _isNotNullValue = value; + return this; + } + + /** + * Does it has the value of isNotNull? + * + * @return Determination. (NotNull) + */ + public boolean hasIsNotNull() { + return _isNotNullValue != null; + } + + /** Location of isNotNull. */ + protected String _isNotNullLocation; + + /** + * Get the location of isNotNull. + * + * @return The location of isNotNull. (Nullable) + */ + public String getIsNotNullLocation() { + return _isNotNullLocation; + } + + /** + * Set the location of isNotNull. + * + * @param location The location of isNotNull. (Nullable) + * @return this. (NotNull) + */ + public ConditionValue setIsNotNullLocation(String location) { + _isNotNullLocation = location; + return this; + } + + //========================================================================== + // =========== + // Filter + // ====== + /** + * 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) + */ + protected Object filterValue(Object value) { + if (value == null) { + return value; + } + if (value instanceof java.sql.Time) { + return value; + } + if (value instanceof java.sql.Timestamp) { + return value; + } + if (value instanceof java.util.Date + || value instanceof java.util.Calendar) { + return SqlDateConversionUtil.toDate(value); + } else { + return value; + } + } + + /** + * Filter 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) + */ + protected List<?> filterValue(List<?> valueList) { + if (valueList == null || valueList.isEmpty()) { + return valueList; + } + final List<Object> resultList = new ArrayList<Object>(); + for (Iterator<?> ite = valueList.iterator(); ite.hasNext();) { + Object value = ite.next(); + resultList.add(filterValue(value)); + } + 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()]); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/cvalue/ConditionValue.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,55 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.grouping; + +/** + * The class of option for grouping. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class GroupingOption<ENTITY> { + + //========================================================================== + // =========== + // Attribute + // ========= + protected int _elementCount; + + protected GroupingRowEndDeterminer<ENTITY> _groupingRowEndDeterminer; + + //========================================================================== + // =========== + // Constructor + // =========== + /** + * Constructor. You should set the determiner of grouping row end after you + * create the instance. + */ + public GroupingOption() { + } + + /** + * Constructor. + * + * @param elementCount The count of row element in a group. + */ + public GroupingOption(int elementCount) { + _elementCount = elementCount; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public int getElementCount() { + return this._elementCount; + } + + public GroupingRowEndDeterminer<ENTITY> getGroupingRowEndDeterminer() { + return this._groupingRowEndDeterminer; + } + + public void setGroupingRowEndDeterminer( + GroupingRowEndDeterminer<ENTITY> groupingRowEndDeterminer) { + this._groupingRowEndDeterminer = groupingRowEndDeterminer; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,24 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.grouping; + +/** + * The interface of grouping end(switch point) determiner. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface GroupingRowEndDeterminer<ENTITY> { + + /** + * Determine whether the grouping row is end. + * + * @param rowResource The resource of grouping row. (NotNull and the + * property 'groupingRowList' is not empty and the property + * 'currentEntity' is not null) + * @param nextEntity The entity of next element. (NotNull and the + * rowResource does not contain yet) + * @return Whether the grouping row is end. (If the value is true, break + * grouping row and the nextEntity is registered to next row) + */ + public boolean determine(GroupingRowResource<ENTITY> rowResource, + ENTITY nextEntity); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowEndDeterminer.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowResource.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowResource.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowResource.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,93 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.grouping; + +import java.util.ArrayList; +import java.util.List; + +/** + * The class of row resource for grouping making. + * + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public class GroupingRowResource<ENTITY> { + + //========================================================================== + // =========== + // Attribute + // ========= + protected List<ENTITY> _groupingRowList = new ArrayList<ENTITY>(); + + protected int _elementCurrentIndex; + + protected int _breakCount; + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + /** + * @return Does the list of grouping row size up the break count? + */ + public boolean isSizeUpBreakCount() { + return _elementCurrentIndex == (_breakCount - 1); + } + + //========================================================================== + // =========== + // Accessor + // ======== + /** + * @return The list of grouping row. (NotNull and NotEmpty) + */ + public List<ENTITY> getGroupingRowList() { + return this._groupingRowList; + } + + /** + * Add the element entity to the list of grouping row. {INTERNAL METHOD} + * + * @param groupingRow The element entity to the list of grouping row. + */ + public void addGroupingRowList(ENTITY groupingRow) { + this._groupingRowList.add(groupingRow); + } + + /** + * @return The entity of element current index. (NotNull) + */ + public ENTITY getCurrentEntity() { + return _groupingRowList.get(_elementCurrentIndex); + } + + /** + * @return The index of current element. + */ + public int getElementCurrentIndex() { + return this._elementCurrentIndex; + } + + /** + * Set the index of current element. {INTERNAL METHOD} + * + * @param elementCurrentIndex The index of current element. + */ + public void setElementCurrentIndex(int elementCurrentIndex) { + this._elementCurrentIndex = elementCurrentIndex; + } + + /** + * @return The count of break loop. + */ + public int getBreakCount() { + return this._breakCount; + } + + /** + * Set the count of break loop. {INTERNAL METHOD} + * + * @param breakCount The count of break loop. + */ + public void setBreakCount(int breakCount) { + this._breakCount = breakCount; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowSetupper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.grouping; + +/** + * The setupper of grouping row. + * + * @param <ROW> The type of row. + * @param <ENTITY> The type of entity. + * @author DBFlute(AutoGenerator) + */ +public interface GroupingRowSetupper<ROW, ENTITY> { + + /** + * Set up the instance of grouping row. + * + * @param groupingRowResource Grouping row resource. (NotNull) + * @return The instance of grouping row. (NotNull) + */ + public ROW setup(GroupingRowResource<ENTITY> groupingRowResource); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/grouping/GroupingRowSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/mapping/EntityDtoMapper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/mapping/EntityDtoMapper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/mapping/EntityDtoMapper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.mapping; + +/** + * The mapper of entity-to-dto. + * + * @param <ENTITY> The type of entity. + * @param <DTO> The type of dto. + * @author DBFlute(AutoGenerator) + */ +public interface EntityDtoMapper<ENTITY, DTO> { + + /** + * Map entity to data transfer object. + * + * @param entity Entity. (NotNull) + * @return Data transfer object. (NotNull) + */ + public DTO map(ENTITY entity); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/mapping/EntityDtoMapper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlContext.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlContext.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlContext.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,427 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql; + +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.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. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlContext { + + /** Log instance. */ + private static final Log _log = LogFactory.getLog(OutsideSqlContext.class); + + //========================================================================== + // ========= + // Thread Local + // ============ + /** The thread-local for this. */ + private static final ThreadLocal<OutsideSqlContext> _threadLocal = new ThreadLocal<OutsideSqlContext>(); + + /** + * Get outside-SQL context on thread. + * + * @return Outside-SQL context. (Nullable) + */ + public static OutsideSqlContext getOutsideSqlContextOnThread() { + return (OutsideSqlContext) _threadLocal.get(); + } + + /** + * Set outside-SQL context on thread. + * + * @param outsideSqlContext Outside-SQL context. (NotNull) + */ + public static void setOutsideSqlContextOnThread( + OutsideSqlContext outsideSqlContext) { + if (outsideSqlContext == null) { + String msg = "The argument[outsideSqlContext] must not be null."; + throw new IllegalArgumentException(msg); + } + _threadLocal.set(outsideSqlContext); + } + + /** + * Is existing outside-SQL context on thread? + * + * @return Determination. + */ + public static boolean isExistOutsideSqlContextOnThread() { + return (_threadLocal.get() != null); + } + + /** + * Clear outside-SQL context on thread. + */ + public static void clearOutsideSqlContextOnThread() { + _threadLocal.set(null); + } + + //========================================================================== + // ========= + // Unique Key + // ========== + public static String generateSpecifiedOutsideSqlUniqueKey( + 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 tableDbName = option.getTableDbName(); + final String generatedUniqueKey = option.generateUniqueKey(); + return methodName + "():" + tableDbName + ":" + path + ":" + pmbKey + + ":" + generatedUniqueKey + resultKey; + } + + //========================================================================== + // ========= + // Exception Handling + // ================== + public static void throwOutsideSqlNotFoundException(String path) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The outsideSql was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your target file of outsideSql on your classpath." + + getLineSeparator(); + msg = msg + + "And please confirm the file name and the file path STRICTLY!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified OutsideSql Path]" + getLineSeparator() + path + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException( + msg); + } + + //========================================================================== + // ========= + // 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) */ + protected String _outsideSqlPath; + + protected Object _parameterBean; + + protected Object _resultTypeSpecification; + + protected String _methodName; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + /** The DB name of table for using behavior-SQL-path. (Nullable) */ + protected String _tableDbName; + + //========================================================================== + // ========= + // Read SQL + // ======== + /** + * @param sqlFileEncoding The encoding of SQL file. (NotNull) + * @param dbmsSuffix The suffix of DBMS. (NotNull) + * @return The filtered outside-SQL. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * When the SQL is not found. + */ + public String readFilteredOutsideSql(String sqlFileEncoding, + String dbmsSuffix) { + final String sql = readOutsideSql(sqlFileEncoding, dbmsSuffix); + return replaceOutsideSqlBindCharacterOnLineComment(sql); + } + + protected String replaceOutsideSqlBindCharacterOnLineComment(String sql) { + final String bindCharacter = "?"; + if (sql.indexOf(bindCharacter) < 0) { + return sql; + } + final String lineSeparator = "\n"; + if (sql.indexOf(lineSeparator) < 0) { + return sql; + } + final String lineCommentMark = "--"; + if (sql.indexOf(lineCommentMark) < 0) { + return sql; + } + final StringBuilder sb = new StringBuilder(); + final String[] lines = sql.split(lineSeparator); + for (String line : lines) { + final int lineCommentIndex = line.indexOf("--"); + if (lineCommentIndex < 0) { + sb.append(line).append(lineSeparator); + continue; + } + final String lineComment = line.substring(lineCommentIndex); + if (lineComment.contains("ELSE") + || !lineComment.contains(bindCharacter)) { + sb.append(line).append(lineSeparator); + continue; + } + + if (_log.isDebugEnabled()) { + _log.debug("...Replacing bind character on line comment: " + + lineComment); + } + final String filteredLineComment = replaceString(lineComment, + bindCharacter, "Q"); + sb.append(line.substring(0, lineCommentIndex)).append( + filteredLineComment).append(lineSeparator); + } + return sb.toString(); + } + + /** + * Read outside-sql path. Required attribute is 'outsideSqlPath'. + * + * @param sqlFileEncoding The encoding of SQL file. (NotNull) + * @param dbmsSuffix The suffix of DBMS. (NotNull) + * @return The text of SQL. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * When the SQL is not found. + */ + public String readOutsideSql(String sqlFileEncoding, String dbmsSuffix) { + final String standardPath = _outsideSqlPath; + final String dbmsPath = buildDbmsPath(standardPath, dbmsSuffix); + String sql; + if (isExistResource(dbmsPath)) { + sql = readText(dbmsPath, sqlFileEncoding); + } else if (isExistResource(standardPath)) { + sql = readText(standardPath, sqlFileEncoding); + } else { + throwOutsideSqlNotFoundException(standardPath); + return null; // Non Reachable. + } + return removeInitialUnicodeBomIfNeeds(sqlFileEncoding, sql); + } + + protected String buildDbmsPath(String standardPath, String dbmsSuffix) { + final String dbmsPath; + final int lastIndexOfDot = standardPath.lastIndexOf("."); + if (lastIndexOfDot >= 0 + && !standardPath.substring(lastIndexOfDot).contains("/")) { + final String base = standardPath.substring(0, lastIndexOfDot); + dbmsPath = base + dbmsSuffix + + standardPath.substring(lastIndexOfDot); + } else { + dbmsPath = standardPath + dbmsSuffix; + } + return dbmsPath; + } + + protected String removeInitialUnicodeBomIfNeeds(String sqlFileEncoding, + String sql) { + if ("UTF-8".equalsIgnoreCase(sqlFileEncoding) && sql.length() > 0 + && sql.charAt(0) == '\uFEFF') { + sql = sql.substring(1); + } + return sql; + } + + //========================================================================== + // ========= + // Behavior Query Path + // =================== + public void setupBehaviorQueryPathIfNeeds() { + if (!isBehaviorQueryPathEnabled()) { + return; + } + if (_outsideSqlPath.contains(":")) { + final String subDirectoryValue = _outsideSqlPath.substring(0, + _outsideSqlPath.lastIndexOf(":")); + final String subDirectoryPath = replaceString(subDirectoryValue, + ":", "/"); + final String behaviorQueryPath = _outsideSqlPath + .substring(_outsideSqlPath.lastIndexOf(":") + ":".length()); + final String behaviorClassPath = replaceString( + buildBehaviorSqlPackageName(), ".", "/"); + final String behaviorPackagePath = behaviorClassPath.substring(0, + behaviorClassPath.lastIndexOf("/")); + final String behaviorClassName = behaviorClassPath + .substring(behaviorClassPath.lastIndexOf("/") + + "/".length()); + _outsideSqlPath = behaviorPackagePath + "/" + subDirectoryPath + + "/" + behaviorClassName + "_" + behaviorQueryPath + + ".sql"; + } else { + _outsideSqlPath = replaceString(buildBehaviorSqlPackageName(), ".", + "/") + + "_" + _outsideSqlPath + ".sql"; + } + } + + protected String buildBehaviorSqlPackageName() { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableDbName); + final String behaviorTypeName = dbmeta.getBehaviorTypeName(); + final String outsideSqlPackage = DBFluteConfig.getInstance() + .getOutsideSqlPackage(); + if (outsideSqlPackage != null && outsideSqlPackage.trim().length() > 0) { + final String behaviorClassName = behaviorTypeName + .substring(behaviorTypeName.lastIndexOf(".") + ".".length()); + String tmp = behaviorTypeName.substring(0, behaviorTypeName + .lastIndexOf(".")); + final String exbhvName = tmp.contains(".") ? tmp.substring(tmp + .lastIndexOf(".") + + ".".length()) : tmp; + return outsideSqlPackage + "." + exbhvName + "." + + behaviorClassName; + } else { + return behaviorTypeName; + } + } + + protected boolean isBehaviorQueryPathEnabled() { + if (isProcedure()) {// [DBFlute-0.7.5] + return false; + } + return _outsideSqlPath != null && !_outsideSqlPath.contains("/") + && !_outsideSqlPath.contains(".") && _tableDbName != null; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean isSpecifiedOutsideSql() { + return _outsideSqlPath != null; + } + + // [DBFlute-0.7.5] + public boolean isProcedure() { + return _methodName != null && _methodName.startsWith("call"); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected boolean isExistResource(String path) { + return ResourceUtil.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); + } + + protected static String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected static String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // 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 + // -------------------- + public String getOutsideSqlPath() { + return _outsideSqlPath; + } + + public void setOutsideSqlPath(String outsideSqlPath) { + this._outsideSqlPath = outsideSqlPath; + } + + public Object getParameterBean() { + return _parameterBean; + } + + public void setParameterBean(Object parameterBean) { + this._parameterBean = parameterBean; + } + + public Object getResultTypeSpecification() { + return _resultTypeSpecification; + } + + public void setResultTypeSpecification(Object resultTypeSpecification) { + this._resultTypeSpecification = resultTypeSpecification; + } + + public String getMethodName() { + return _methodName; + } + + public void setMethodName(String methodName) { + this._methodName = methodName; + } + + public StatementConfig getStatementConfig() { + return _statementConfig; + } + + public void setStatementConfig(StatementConfig statementConfig) { + this._statementConfig = statementConfig; + } + + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + this._tableDbName = tableDbName; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlContext.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.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); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,116 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql; + +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; + +/** + * The option of outside-SQL. It contains various information about execution. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlOption { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Option + // ------ + protected String _pagingRequestType = "non"; + + protected boolean _dynamicBinding; + + /** The configuration of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + // ----------------------------------------------------- + // Information + // ----------- + /** The DB name of table. It is not related with the options of outside-SQL. */ + protected String _tableDbName; + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + public void autoPaging() { + _pagingRequestType = "auto"; + } + + public void manualPaging() { + _pagingRequestType = "manual"; + } + + public void dynamicBinding() { + _dynamicBinding = true; + } + + //========================================================================== + // ========= + // Unique Key + // ========== + public String generateUniqueKey() { + return "{" + _pagingRequestType + "/" + _dynamicBinding + "}"; + } + + //========================================================================== + // ========= + // Copy + // ==== + public OutsideSqlOption copyOptionWithoutPaging() { + final OutsideSqlOption copyOption = new OutsideSqlOption(); + if (isDynamicBinding()) { + copyOption.dynamicBinding(); + } + copyOption.setTableDbName(_tableDbName); + return copyOption; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return "{paging=" + _pagingRequestType + ", dynamic=" + _dynamicBinding + + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // Option + // ------ + public boolean isAutoPaging() { + return "auto".equals(_pagingRequestType); + } + + public boolean isManualPaging() { + return "manual".equals(_pagingRequestType); + } + + public boolean isDynamicBinding() { + return _dynamicBinding; + } + + public StatementConfig getStatementConfig() { + return _statementConfig; + } + + public void setStatementConfig(StatementConfig statementConfig) { + _statementConfig = statementConfig; + } + + // ----------------------------------------------------- + // Information + // ----------- + public String getTableDbName() { + return _tableDbName; + } + + public void setTableDbName(String tableDbName) { + _tableDbName = tableDbName; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/OutsideSqlOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/ProcedurePmb.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/ProcedurePmb.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/ProcedurePmb.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,16 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql; + +/** + * The parameter-bean for procedure. + * + * @author DBFlute(AutoGenerator) + */ +public interface ProcedurePmb { + + /** + * Get the value of procedure name. + * + * @return The value of procedure name. (NotNull) + */ + public String getProcedureName(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/ProcedurePmb.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,251 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.executor; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.ProcedurePmb; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; + +/** + * The executor of outside-sql. <br /> + * + * <pre> + * {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> + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlBasicExecutor { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The DAO of outside-sql. (NotNull) */ + protected final OutsideSqlDao _outsideSqlDao; + + /** Table DB name. (NotNull) */ + protected final String _tableDbName; + + /** Is it dynamic binding? */ + protected boolean _dynamicBinding; + + /** The config of statement. (Nullable) */ + protected StatementConfig _statementConfig; + + //========================================================================== + // ========= + // Constructor + // =========== + public OutsideSqlBasicExecutor(OutsideSqlDao outsideSqlDao, + String tableDbName) { + this._outsideSqlDao = outsideSqlDao; + this._tableDbName = tableDbName; + } + + //========================================================================== + // ========= + // Select + // ====== + /** + * Select the list of the entity. + * + * @param <ENTITY> The type of entity for element. + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map + * object. (Nullable) + * @param entityType The element type of entity. (NotNull) + * @return The result bean of selected list. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * 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); + return new ResultBeanBuilder<ENTITY>(_tableDbName) + .buildListResultBean(resultList); + } + + //========================================================================== + // ========= + // Execute + // ======= + /** + * Execute. {Insert/Update/Delete/Etc...} + * + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map + * object. (Nullable) + * @return The count of execution. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * When the outside-sql is not found. + */ + public int execute(String path, Object pmb) { + return _outsideSqlDao.execute(path, pmb, createOutsideSqlOption()); + } + + // [DBFlute-0.7.5] + //========================================================================== + // ========= + // Procedure Call + // ============== + /** + * Call stored procedure. + * + * @param pmb The parameter-bean for procedure. (NotNull) + */ + public void call(ProcedurePmb pmb) { + if (pmb == null) { + throw new IllegalArgumentException( + "The argument of call() 'pmb' should not be null!"); + } + _outsideSqlDao.call(pmb.getProcedureName(), pmb, + createOutsideSqlOption()); + } + + //========================================================================== + // ========= + // Option + // ====== + // ----------------------------------------------------- + // Result Handling + // --------------- + /** + * Specify cursor handling. <br /> + * + * <pre> + * # ex) Your Program + * # + * # executor.cursorHandling().selectCursor(path, pmb, handler); + * # + * </pre> + * + * @return The cursor executor of outside-sql. (NotNull) + */ + public OutsideSqlCursorExecutor<Object> cursorHandling() { + return new OutsideSqlCursorExecutor<Object>(_outsideSqlDao, + createOutsideSqlOption()); + } + + /** + * Specify entity handling. <br /> + * + * <pre> + * # ex) Your Program + * # + * # executor.entityHandling().selectEntityWithDeletedCheck(path, pmb, Xxx.class); + * # + * </pre> + * + * @return The cursor executor of outside-sql. (NotNull) + */ + public OutsideSqlEntityExecutor<Object> entityHandling() { + return new OutsideSqlEntityExecutor<Object>(_outsideSqlDao, + createOutsideSqlOption()); + } + + // ----------------------------------------------------- + // Paging + // ------ + /** + * Option of autoPaging. <br /> If you invoke this, you don't need to write + * paging condition on your SQL. <br /> + * + * <pre> + * # ex) Your SQL {MySQL} + * # + * # select member.MEMBER_ID, member... + * # from Member member + * # where ... + * # order by ... + * # -- limit 40, 20 *Here is unnecessary! + * # + * </pre> + * + * @return The executor of paging that the paging mode is auto. (NotNull) + */ + public OutsideSqlPagingExecutor autoPaging() { + final OutsideSqlOption option = createOutsideSqlOption(); + option.autoPaging(); + return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + _tableDbName); + } + + /** + * Option of manualPaging. <br /> If you invoke this, you need to write + * paging condition on your SQL. <br /> + * + * <pre> + * # ex) Your SQL {MySQL} + * # + * # select member.MEMBER_ID, member... + * # from Member member + * # where ... + * # order by ... + * # limit 40, 20 *Here is necessary! + * # + * </pre> + * + * @return The executor of paging that the paging mode is manual. (NotNull) + */ + public OutsideSqlPagingExecutor manualPaging() { + final OutsideSqlOption option = createOutsideSqlOption(); + option.manualPaging(); + return new OutsideSqlPagingExecutor(_outsideSqlDao, option, + _tableDbName); + } + + // ----------------------------------------------------- + // Dynamic Binding + // --------------- + public OutsideSqlBasicExecutor dynamicBinding() { + _dynamicBinding = true; + return this; + } + + // ----------------------------------------------------- + // Statement Config + // ---------------- + public OutsideSqlBasicExecutor configure(StatementConfig statementConfig) { + _statementConfig = statementConfig; + return this; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected OutsideSqlOption createOutsideSqlOption() { + final OutsideSqlOption option = new OutsideSqlOption(); + option.setStatementConfig(_statementConfig); + if (_dynamicBinding) { + option.dynamicBinding(); + } + option.setTableDbName(_tableDbName);// as information + return option; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlBasicExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,69 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.executor; + +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.jdbc.CursorHandler; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; + +/** + * The cursor executor of outside-sql. + * + * @param <PARAMETER_BEAN> The type of parameter-bean. + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlCursorExecutor<PARAMETER_BEAN> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final OutsideSqlDao _outsideSqlDao; + + protected final OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Constructor + // =========== + public OutsideSqlCursorExecutor(OutsideSqlDao outsideSqlDao, + OutsideSqlOption outsideSqlOption) { + this._outsideSqlDao = outsideSqlDao; + this._outsideSqlOption = outsideSqlOption; + } + + //========================================================================== + // ========= + // Select + // ====== + /** + * Select the cursor of the entity. + * + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map + * object. (Nullable) + * @param handler The handler of cursor. (NotNull) + * @return The result object that the cursor handler returns. (Nullable) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * When the outside-sql is not found. + */ + public Object selectCursor(String path, PARAMETER_BEAN pmb, + CursorHandler handler) { + return _outsideSqlDao.selectCursor(path, pmb, _outsideSqlOption, + handler); + } + + //========================================================================== + // ========= + // Option + // ====== + public OutsideSqlCursorExecutor<PARAMETER_BEAN> dynamicBinding() { + _outsideSqlOption.dynamicBinding(); + return this; + } + + public OutsideSqlCursorExecutor<PARAMETER_BEAN> configure( + StatementConfig statementConfig) { + _outsideSqlOption.setStatementConfig(statementConfig); + return this; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlCursorExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,155 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.executor; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * The cursor executor of outside-sql. + * + * @param <PARAMETER_BEAN> The type of parameter-bean. + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlEntityExecutor<PARAMETER_BEAN> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected final OutsideSqlDao _outsideSqlDao; + + protected final OutsideSqlOption _outsideSqlOption; + + //========================================================================== + // ========= + // Constructor + // =========== + public OutsideSqlEntityExecutor(OutsideSqlDao outsideSqlDao, + OutsideSqlOption outsideSqlOption) { + this._outsideSqlDao = outsideSqlDao; + this._outsideSqlOption = outsideSqlOption; + } + + //========================================================================== + // ========= + // Select + // ====== + /** + * Select entity. + * + * @param <ENTITY> The type of entity. + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map + * object. (Nullable) + * @param entityType The type of entity. (NotNull) + * @return The selected entity. (Nullable) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * When the outside-sql is not found. + * @exception jp.sf.pal.scheduler.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); + if (ls.isEmpty()) { + return null; + } + if (ls.size() > 1) { + throwEntityDuplicatedException(ls.size() + "", + buildSearch4LogString(path, pmb, entityType), null); + } + return ls.get(0); + } + + /** + * Select entity with deleted check. + * + * @param <ENTITY> The type of entity. + * @param path The path of SQL file. (NotNull) + * @param pmb The parameter-bean. Allowed types are Bean object and Map + * object. (Nullable) + * @param entityType The type of entity. (NotNull) + * @return The selected entity. (Nullable) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * When the outside-sql is not found. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted(not found). + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity is duplicated. + */ + public <ENTITY> ENTITY selectEntityWithDeletedCheck(String path, + PARAMETER_BEAN pmb, Class<ENTITY> entityType) { + final List<ENTITY> ls = _outsideSqlDao.selectList(path, pmb, + _outsideSqlOption, entityType); + if (ls == null || ls.isEmpty()) { + throwEntityAlreadyDeletedException(buildSearch4LogString(path, pmb, + entityType)); + } + if (ls.size() > 1) { + throwEntityDuplicatedException(ls.size() + "", + buildSearch4LogString(path, pmb, entityType), null); + } + return ls.get(0); + } + + protected <ENTITY> String buildSearch4LogString(String path, + PARAMETER_BEAN pmb, Class<ENTITY> entityType) { + String tmp = "Table = " + _outsideSqlOption.getTableDbName() + + getLineSeparator(); + tmp = tmp + "Path = " + path + getLineSeparator(); + tmp = tmp + "Pmb = " + + (pmb != null ? pmb.getClass().getSimpleName() : "null") + ":" + + pmb + getLineSeparator(); + tmp = tmp + "Entity = " + + (entityType != null ? entityType.getSimpleName() : "null") + + getLineSeparator(); + tmp = tmp + "Option = " + _outsideSqlOption; + return tmp; + } + + // ----------------------------------------------------- + // Helper + // ------ + protected void throwEntityAlreadyDeletedException(Object searchKey4Log) { + ConditionBeanContext.throwEntityAlreadyDeletedException(searchKey4Log); + } + + protected void throwEntityDuplicatedException(String resultCountString, + Object searchKey4Log, Throwable cause) { + ConditionBeanContext.throwEntityDuplicatedException(resultCountString, + searchKey4Log, cause); + } + + //========================================================================== + // ========= + // Option + // ====== + public OutsideSqlEntityExecutor<PARAMETER_BEAN> configure( + StatementConfig statementConfig) { + _outsideSqlOption.setStatementConfig(statementConfig); + return this; + } + + public OutsideSqlEntityExecutor<PARAMETER_BEAN> dynamicBinding() { + _outsideSqlOption.dynamicBinding(); + return this; + } + + //========================================================================== + // ========= + // Helper + // ====== + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected static String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlEntityExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,221 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.executor; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; + +/** + * The paging executor of outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlPagingExecutor { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The DAO of outsideSql. (NotNull) */ + protected final OutsideSqlDao _outsideSqlDao; + + /** The option of outsideSql. (NotNull) */ + protected final OutsideSqlOption _outsideSqlOption; + + /** The DB name of table. (NotNull) */ + protected final String _tableDbName; + + //========================================================================== + // ========= + // Constructor + // =========== + public OutsideSqlPagingExecutor(OutsideSqlDao outsideSqlDao, + OutsideSqlOption outsideSqlOption, String tableDbName) { + this._outsideSqlDao = outsideSqlDao; + this._outsideSqlOption = outsideSqlOption; + this._tableDbName = tableDbName; + } + + //========================================================================== + // ========= + // Select + // ====== + /** + * Select list with paging. + * <p> + * The SQL should have Paging without Count. <br /> You do not need to use + * pagingBean's isPaging() method on your 'Parameter Comment'. <br /> + * + * <pre> + * - - - - - - - - - - - - - - - - - - - - - - - + * ex) Your Correct SQL {MySQL and manualPaging} + * - - - - - - - - - - - - - - - - - - - - - - - + * # select member.MEMBER_ID + * # , member.MEMBER_NAME + * # , memberStatus.MEMBER_STATUS_NAME + * # from MEMBER member + * # left outer join MEMBER_STATUS memberStatus + * # on member.MEMBER_STATUS_CODE = memberStatus.MEMBER_STATUS_CODE + * # /[*]BEGIN[*]/where + * # /[*]IF pmb.memberId != null[*]/member.MEMBER_ID = /[*]pmb.memberId[*]/'123'/[*]END[*]/ + * # /[*]IF pmb.memberName != null[*]/and member.MEMBER_NAME like /[*]pmb.memberName[*]/'Billy' || '%'/[*]END[*]/ + * # /[*]END[*]/ + * # order by member.UPDATE_DATETIME desc + * # limit /[*]$pmb.pageStartIndex[*]/80, /[*]$pmb.fetchSize[*]/20 + * # + * o [*] is easy escape to Java Doc Comment. + * o If it's autoPaging, the line of 'limit 80, 20' is unnecessary! + * </pre> + * + * @param <ENTITY> The type of entity. + * @param path The path of SQL that executes count and paging. (NotNull) + * @param pmb The bean of paging parameter. (NotNull) + * @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. + */ + public <ENTITY> ListResultBean<ENTITY> selectList(String path, + PagingBean pmb, Class<ENTITY> entityType) { + setupScrollableCursorIfNeeds(); + List<ENTITY> resultList = _outsideSqlDao.selectList(path, pmb, + _outsideSqlOption, entityType); + return new ResultBeanBuilder<ENTITY>(_tableDbName) + .buildListResultBean(resultList); + } + + /** + * Select page. + * <p> + * The SQL should have Count and Paging. <br /> You can realize by + * pagingBean's isPaging() method on your 'Parameter Comment'. For example, + * 'IF Comment'. <br /> It returns false when it executes Count. And it + * returns true when it executes Paging. <br /> + * + * <pre> + * - - - - - - - - - - - - - - - - - - - - - - - + * ex) Your Correct SQL {MySQL and manualPaging} + * - - - - - - - - - - - - - - - - - - - - - - - + * # /[*]IF pmb.isPaging()[*]/ + * # select member.MEMBER_ID + * # , member.MEMBER_NAME + * # , memberStatus.MEMBER_STATUS_NAME + * # -- ELSE select count(*) + * # /[*]END[*]/ + * # from MEMBER member + * # /[*]IF pmb.isPaging()[*]/ + * # left outer join MEMBER_STATUS memberStatus + * # on member.MEMBER_STATUS_CODE = memberStatus.MEMBER_STATUS_CODE + * # /[*]END[*]/ + * # /[*]BEGIN[*]/where + * # /[*]IF pmb.memberId != null[*]/member.MEMBER_ID = /[*]pmb.memberId[*]/'123'/[*]END[*]/ + * # /[*]IF pmb.memberName != null[*]/and member.MEMBER_NAME like /[*]pmb.memberName[*]/'Billy' || '%'/[*]END[*]/ + * # /[*]END[*]/ + * # /[*]IF pmb.isPaging()[*]/ + * # order by member.UPDATE_DATETIME desc + * # /[*]END[*]/ + * # /[*]IF pmb.isPaging()[*]/ + * # limit /[*]$pmb.pageStartIndex[*]/80, /[*]$pmb.fetchSize[*]/20 + * # /[*]END[*]/ + * # + * o [*] is easy escape to Java Doc Comment. + * o If it's autoPaging, the line of 'limit 80, 20' is unnecessary! + * + * - - - - - - - - - - - - - - - - - - - - - - - - - + * ex) Wrong SQL {part 1} + * -- Line comment before ELSE comment -- + * - - - - - - - - - - - - - - - - - - - - - - - - - + * # /[*]IF pmb.isPaging()[*]/ + * # select member.MEMBER_ID + * # , member.MEMBER_NAME -- The name of member... *NG + * # -- The status name of member... *NG + * # , memberStatus.MEMBER_STATUS_NAME + * # -- ELSE select count(*) + * # /[*]END[*]/ + * # ... + * o It's S2Dao's restriction...Sorry + * </pre> + * + * @param <ENTITY> The type of entity. + * @param path The path of SQL that executes count and paging. (NotNull) + * @param pmb The bean of paging parameter. (NotNull) + * @param entityType The type of result entity. (NotNull) + * @return The result bean of paging. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.OutsideSqlNotFoundException + * 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 PagingHandler<ENTITY> handler = new PagingHandler<ENTITY>() { + public PagingBean getPagingBean() { + return pmb; + } + + public int count() { + pmb.xsetPaging(false); + return countExecutor.selectEntityWithDeletedCheck(path, pmb, + Integer.class); + } + + public List<ENTITY> paging() { + pmb.xsetPaging(true); + return selectList(path, pmb, entityType); + } + }; + final PagingInvoker<ENTITY> invoker = new PagingInvoker<ENTITY>( + _tableDbName); + if (pmb.isCountLater()) { + invoker.countLater(); + } + return invoker.invokePaging(handler); + } + + protected void setupScrollableCursorIfNeeds() { + if (!_outsideSqlOption.isAutoPaging()) { + return; + } + StatementConfig statementConfig = _outsideSqlOption + .getStatementConfig(); + if (statementConfig != null + && statementConfig.getResultSetType() != null) { + return; + } + StatementConfig defaultStatementConfig = DBFluteConfig.getInstance() + .getDefaultStatementConfig(); + if (defaultStatementConfig != null + && defaultStatementConfig.hasResultSetType()) { + return; + } + if (statementConfig == null) { + statementConfig = new StatementConfig(); + configure(statementConfig); + } + statementConfig.typeScrollInsensitive(); + } + + //========================================================================== + // ========= + // Option + // ====== + public OutsideSqlPagingExecutor configure(StatementConfig statementConfig) { + _outsideSqlOption.setStatementConfig(statementConfig); + return this; + } + + public OutsideSqlPagingExecutor dynamicBinding() { + _outsideSqlOption.dynamicBinding(); + return this; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/outsidesql/executor/OutsideSqlPagingExecutor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLink.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLink.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLink.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,91 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi; + +/** + * The class of page number link. + * + * @author DBFlute(AutoGenerator) + */ +public class PageNumberLink implements java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + protected int _pageNumberElement; + + protected boolean _current; + + protected String _pageNumberLinkHref; + + //========================================================================== + // ========= + // Constructor + // =========== + public PageNumberLink() { + } + + //========================================================================== + // ========= + // Initializer + // =========== + public PageNumberLink initialize(int pageNumberElement, boolean current, + String pageNumberLinkHref) { + setPageNumberElement(pageNumberElement); + setCurrent(current); + setPageNumberLinkHref(pageNumberLinkHref); + return this; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuffer sb = new StringBuffer(); + + sb.append(" pageNumberElement=").append(_pageNumberElement); + sb.append(" pageNumberLinkHref=").append(_pageNumberLinkHref); + sb.append(" current=").append(_current); + + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public int getPageNumberElement() { + return _pageNumberElement; + } + + public void setPageNumberElement(int pageNumberElement) { + this._pageNumberElement = pageNumberElement; + } + + public boolean isCurrent() { + return _current; + } + + public void setCurrent(boolean current) { + this._current = current; + } + + public String getPageNumberLinkHref() { + return _pageNumberLinkHref; + } + + public void setPageNumberLinkHref(String pageNumberLinkHref) { + this._pageNumberLinkHref = pageNumberLinkHref; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLink.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi; + +/** + * The setupper of page number link. + * + * @param <LINK> The type of link. + * @author DBFlute(AutoGenerator) + */ +public interface PageNumberLinkSetupper<LINK extends PageNumberLink> { + + /** + * Set up page number link. + * + * @param pageNumberElement Page number element. + * @param current Is current page? + * @return Page number link. (NotNull) + */ + public LINK setup(int pageNumberElement, boolean current); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/PageNumberLinkSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,215 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.group; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.PageNumberLink; +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.PageNumberLinkSetupper; + +/** + * The bean of page group. + * + * @author DBFlute(AutoGenerator) + */ +public class PageGroupBean implements java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + protected int _currentPageNumber; + + protected int _allPageCount; + + protected PageGroupOption _pageGroupOption; + + //========================================================================== + // ========= + // Main + // ==== + /** + * Build the list of page number link. + * + * @param <LINK> The type of link. + * @param pageNumberLinkSetupper Page number link setupper. (NotNull and + * Required LINK) + * @return The list of Page number link. (NotNull) + */ + public <LINK extends PageNumberLink> List<LINK> buildPageNumberLinkList( + PageNumberLinkSetupper<LINK> pageNumberLinkSetupper) { + final List<Integer> pageNumberList = createPageNumberList(); + final List<LINK> pageNumberLinkList = new ArrayList<LINK>(); + for (Integer pageNumber : pageNumberList) { + pageNumberLinkList.add(pageNumberLinkSetupper.setup(pageNumber, + pageNumber.equals(_currentPageNumber))); + } + return pageNumberLinkList; + } + + /** + * Calculate start page number. + * + * @return Start page number. + */ + public int calculateStartPageNumber() { + assertPageGroupValid(); + final int pageGroupSize = _pageGroupOption.getPageGroupSize(); + final int currentPageNumber = _currentPageNumber; + + int currentPageGroupNumber = (currentPageNumber / pageGroupSize); + if ((currentPageNumber % pageGroupSize) == 0) { + currentPageGroupNumber--; + } + final int currentPageGroupStartPageNumber = (pageGroupSize * currentPageGroupNumber) + 1; + if (!(currentPageNumber >= currentPageGroupStartPageNumber)) { + String msg = "currentPageNumber should be greater equal currentPageGroupStartPageNumber. But:"; + msg = msg + " currentPageNumber=" + currentPageNumber; + msg = msg + " currentPageGroupStartPageNumber=" + + currentPageGroupStartPageNumber; + throw new IllegalStateException(msg); + } + return currentPageGroupStartPageNumber; + } + + /** + * Create the list of page number. + * + * @return The list of page number. (NotNull) + */ + public List<Integer> createPageNumberList() { + assertPageGroupValid(); + final int pageGroupSize = _pageGroupOption.getPageGroupSize(); + final int allPageCount = _allPageCount; + final int currentPageGroupStartPageNumber = calculateStartPageNumber(); + if (!(currentPageGroupStartPageNumber > 0)) { + String msg = "currentPageGroupStartPageNumber should be greater than 0. {> 0} But:"; + msg = msg + " currentPageGroupStartPageNumber=" + + currentPageGroupStartPageNumber; + throw new IllegalStateException(msg); + } + final int nextPageGroupStartPageNumber = currentPageGroupStartPageNumber + + pageGroupSize; + + final List<Integer> resultList = new ArrayList<Integer>(); + for (int i = currentPageGroupStartPageNumber; i < nextPageGroupStartPageNumber + && i <= allPageCount; i++) { + resultList.add(new Integer(i)); + } + return resultList; + } + + /** + * Create the array of page number. + * + * @return The array of page number. (NotNUll) + */ + public int[] createPageNumberArray() { + assertPageGroupValid(); + return convertListToIntArray(createPageNumberList()); + } + + /** + * Is existing previous page-group? Using values are currentPageNumber and + * pageGroupSize. + * + * @return Determination. + */ + public boolean isExistPrePageGroup() { + assertPageGroupValid(); + return (_currentPageNumber > _pageGroupOption.getPageGroupSize()); + } + + /** + * Is existing next page-group? Using values are currentPageNumber and + * pageGroupSize and allPageCount. + * + * @return Determination. + */ + public boolean isExistNextPageGroup() { + assertPageGroupValid(); + int currentPageGroupStartPageNumber = calculateStartPageNumber(); + if (!(currentPageGroupStartPageNumber > 0)) { + String msg = "currentPageGroupStartPageNumber should be greater than 0. {> 0} But:"; + msg = msg + " currentPageGroupStartPageNumber=" + + currentPageGroupStartPageNumber; + throw new IllegalStateException(msg); + } + int nextPageGroupStartPageNumber = currentPageGroupStartPageNumber + + _pageGroupOption.getPageGroupSize(); + return (nextPageGroupStartPageNumber <= _allPageCount); + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected int[] convertListToIntArray(List<Integer> ls) { + final int[] resultArray = new int[ls.size()]; + int arrayIndex = 0; + for (Iterator<Integer> ite = ls.iterator(); ite.hasNext();) { + final Integer tmpPageNumber = (Integer) ite.next(); + resultArray[arrayIndex] = tmpPageNumber.intValue(); + arrayIndex++; + } + return resultArray; + } + + protected void assertPageGroupValid() { + if (_pageGroupOption == null) { + String msg = "The pageGroupOption should not be null. Please invoke setPageGroupOption()."; + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 0) { + String msg = "The pageGroupSize should be greater than 1. But the value is zero."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + if (_pageGroupOption.getPageGroupSize() == 1) { + String msg = "The pageGroupSize should be greater than 1. But the value is one."; + msg = msg + " pageGroupSize=" + _pageGroupOption.getPageGroupSize(); + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" currentPageNumber=").append(_currentPageNumber); + sb.append(" allPageCount=").append(_allPageCount); + sb.append(" pageGroupOption=").append(_pageGroupOption); + + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCurrentPageNumber(int currentPageNumber) { + this._currentPageNumber = currentPageNumber; + } + + public void setAllPageCount(int allPageCount) { + this._allPageCount = allPageCount; + } + + public void setPageGroupOption(PageGroupOption pageGroupOption) { + this._pageGroupOption = pageGroupOption; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.group; + +/** + * The option of page group. + * + * @author DBFlute(AutoGenerator) + */ +public class PageGroupOption implements java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + protected int _pageGroupSize; + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" pageGroupSize=").append(_pageGroupSize); + + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public int getPageGroupSize() { + return _pageGroupSize; + } + + public void setPageGroupSize(int pageGroupSize) { + this._pageGroupSize = pageGroupSize; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/group/PageGroupOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeBean.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeBean.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeBean.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,202 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.range; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.PageNumberLink; +import jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.PageNumberLinkSetupper; + +/** + * The bean of page range. + * + * @author DBFlute(AutoGenerator) + */ +public class PageRangeBean implements java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + protected int _currentPageNumber; + + protected int _allPageCount; + + protected PageRangeOption _pageRangeOption; + + //========================================================================== + // ========= + // Main + // ==== + /** + * Build the list of page number link. + * + * @param <LINK> The type of link. + * @param pageNumberLinkSetupper Page number link setupper. (NotNull and + * Required LINK) + * @return The list of Page number link. (NotNull) + */ + public <LINK extends PageNumberLink> List<LINK> buildPageNumberLinkList( + PageNumberLinkSetupper<LINK> pageNumberLinkSetupper) { + final List<Integer> pageNumberList = createPageNumberList(); + final List<LINK> pageNumberLinkList = new ArrayList<LINK>(); + for (Integer pageNumber : pageNumberList) { + pageNumberLinkList.add(pageNumberLinkSetupper.setup(pageNumber, + pageNumber.equals(_currentPageNumber))); + } + return pageNumberLinkList; + } + + /** + * Create the list of page number. + * + * @return The list of page number. (NotNull) + */ + public List<Integer> createPageNumberList() { + assertPageRangeValid(); + final int pageRangeSize = _pageRangeOption.getPageRangeSize(); + final int allPageCount = _allPageCount; + final int currentPageNumber = _currentPageNumber; + + final List<Integer> resultList = new ArrayList<Integer>(); + for (int i = currentPageNumber - pageRangeSize; i < currentPageNumber; i++) { + if (i < 1) { + continue; + } + resultList.add(new Integer(i)); + } + + resultList.add(new Integer(currentPageNumber)); + + final int endPageNumber = (currentPageNumber + pageRangeSize); + for (int i = currentPageNumber + 1; i <= endPageNumber + && i <= allPageCount; i++) { + resultList.add(new Integer(i)); + } + + final boolean fillLimit = _pageRangeOption.isFillLimit(); + final int limitSize = (pageRangeSize * 2) + 1; + if (fillLimit && !resultList.isEmpty() && resultList.size() < limitSize) { + final Integer firstElements = (Integer) resultList.get(0); + final Integer lastElements = (Integer) resultList.get(resultList + .size() - 1); + if (firstElements.intValue() > 1) { + for (int i = firstElements.intValue() - 1; resultList.size() < limitSize + && i > 0; i--) { + resultList.add(0, new Integer(i)); + } + } + for (int i = lastElements.intValue() + 1; resultList.size() < limitSize + && i <= allPageCount; i++) { + resultList.add(new Integer(i)); + } + } + return resultList; + } + + /** + * Get the array of page number. + * + * @return The array of page number. (NotNull) + */ + public int[] createPageNumberArray() { + assertPageRangeValid(); + return convertListToIntArray(createPageNumberList()); + } + + /** + * Is existing previous page range? + * + * @return Determination. + */ + public boolean isExistPrePageRange() { + assertPageRangeValid(); + final int[] array = createPageNumberArray(); + if (array.length == 0) { + return false; + } + return array[0] > 1; + } + + /** + * Is existing next page range? + * + * @return Determination. + */ + public boolean isExistNextPageRange() { + assertPageRangeValid(); + final int[] array = createPageNumberArray(); + if (array.length == 0) { + return false; + } + return array[array.length - 1] < _allPageCount; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected int[] convertListToIntArray(List<Integer> ls) { + final int[] resultArray = new int[ls.size()]; + int arrayIndex = 0; + for (Iterator<Integer> ite = ls.iterator(); ite.hasNext();) { + final Integer tmpPageNumber = (Integer) ite.next(); + resultArray[arrayIndex] = tmpPageNumber.intValue(); + arrayIndex++; + } + return resultArray; + } + + protected void assertPageRangeValid() { + if (_pageRangeOption == null) { + String msg = "The pageRangeOption should not be null. Please invoke setPageRangeOption()."; + throw new IllegalStateException(msg); + } + final int pageRangeSize = _pageRangeOption.getPageRangeSize(); + if (pageRangeSize == 0) { + String msg = "The pageRangeSize should be greater than 1. But the value is zero."; + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setCurrentPageNumber(int currentPageNumber) { + this._currentPageNumber = currentPageNumber; + } + + public void setAllPageCount(int allPageCount) { + this._allPageCount = allPageCount; + } + + public void setPageRangeOption(PageRangeOption pageRangeOption) { + this._pageRangeOption = pageRangeOption; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" currentPageNumber=").append(_currentPageNumber); + sb.append(" allPageCount=").append(_allPageCount); + sb.append(" pageRangeOption=").append(_pageRangeOption); + + return sb.toString(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeBean.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,61 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.pagenavi.range; + +/** + * The option of page range. + * + * @author DBFlute(AutoGenerator) + */ +public class PageRangeOption implements java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + protected int _pageRangeSize; + + protected boolean _fillLimit; + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * @return The view string of all attribute values. (NotNull) + */ + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + + sb.append(" pageRangeSize=").append(_pageRangeSize); + sb.append(" fillLimit=").append(_fillLimit); + + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public int getPageRangeSize() { + return _pageRangeSize; + } + + public void setPageRangeSize(int pageRangeSize) { + this._pageRangeSize = pageRangeSize; + } + + public boolean isFillLimit() { + return _fillLimit; + } + + public void setFillLimit(boolean fillLimit) { + this._fillLimit = fillLimit; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/pagenavi/range/PageRangeOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/AbstractSqlClause.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/AbstractSqlClause.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/AbstractSqlClause.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1799 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleAssertUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * The abstract class of SqlClause. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractSqlClause implements SqlClause { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final String SELECT_HINT = "/*$dto.selectHint*/"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Basic + // ----- + /** Target table name. */ + protected final String _tableName; + + // ----------------------------------------------------- + // Clause Resource + // --------------- + /** + * Selected select column map. map:{tableAliasName : map:{columnName : + * selectColumnInfo}} + */ + protected Map<String, Map<String, SelectedSelectColumnInfo>> _selectedSelectColumnMap = new LinkedHashMap<String, Map<String, SelectedSelectColumnInfo>>(); + + /** + * Specified select column map. map:{ tableAliasName = map:{ columnName : + * null } } + */ + protected Map<String, Map<String, String>> _specifiedSelectColumnMap;// [ + + // DBFlute + // - + // 0.7.4 + // ] + + /** Specified derive sub-query map. */ + 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 + + // linked + // ! + + /** Outer join map. */ + protected Map<String, LeftOuterJoinInfo> _outerJoinMap = new LinkedHashMap<String, LeftOuterJoinInfo>(); + + /** Where list. */ + protected List<String> _whereList = new ArrayList<String>(); + + /** Inline where list for BaseTable. */ + protected List<String> _baseTableInlineWhereList = new ArrayList<String>(); + + /** Order-by clause. */ + protected final OrderByClause _orderByClause = new OrderByClause(); + + /** Union clause list. */ + protected List<UnionQueryInfo> _unionQueryInfoList = new ArrayList<UnionQueryInfo>(); + + /** 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; + + // ----------------------------------------------------- + // Fetch Property + // -------------- + /** Fetch start index. (for fetchXxx()) */ + protected int _fetchStartIndex = 0; + + /** Fetch size. (for fetchXxx()) */ + protected int _fetchSize = 0; + + /** Fetch page number. (for fetchXxx()) This value should be plus. */ + protected int _fetchPageNumber = 1; + + /** Is fetch-narrowing effective? Default value is false. */ + protected boolean _isFetchScopeEffective = false; + + // ----------------------------------------------------- + // AdditionalConditionAsOr + // ----------------------- + /** Is additional condition as or effective? */ + protected boolean _isAdditionalConditionAsOrEffective = false; + + // ----------------------------------------------------- + // WhereClauseSimpleFilter + // ----------------------- + /** The filter for where clause. */ + protected List<WhereClauseSimpleFilter> _whereClauseSimpleFilterList; + + // ----------------------------------------------------- + // Selected Foreign Info + // --------------------- + /** The information of selected foreign table. */ + protected Map<String, String> _selectedForeignInfo; + + // ----------------------------------------------------- + // Optional Info + // ------------- + protected boolean _formatClause; + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractSqlClause(String tableName) { + if (tableName == null) { + String msg = "Argument[tableName] must not be null."; + throw new IllegalArgumentException(msg); + } + _tableName = tableName; + } + + //========================================================================== + // ========= + // Clause + // ====== + // ----------------------------------------------------- + // Complete Clause + // --------------- + public String getClause() { + StringBuilder sb = new StringBuilder(512); + sb.append(getSelectClause()); + sb.append(" "); + sb.append(buildClauseWithoutMainSelect(false)); + String sql = sb.toString(); + return filterSubQueryIndent(sql); + } + + public String getClausePKOnly() { + 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()); + + // Delete template mark! (At the future this will be unnecessary.) + unionClause = replaceString(unionClause, getUnionWhereClauseMark(), "");// Required + // ! + unionClause = replaceString(unionClause, + getUnionWhereFirstConditionMark(), "");// Required! + + sb.append(unionClause); + if (_isOrderByEffective && !_orderByClause.isEmpty()) { + sb.append(" "); + sb.append(getOrderByClause()); + } + sb.append(" "); + sb.append(getSqlSuffix()); + return sb.toString(); + } + + // ----------------------------------------------------- + // Fragment Clause + // --------------- + public String getClauseFromWhereWithUnionTemplate() { + return buildClauseFromWhereAsTemplate(false); + } + + public String getClauseFromWhereWithWhereUnionTemplate() { + return buildClauseFromWhereAsTemplate(true); + } + + protected String buildClauseFromWhereAsTemplate(boolean template) { + StringBuilder sb = new StringBuilder(512); + sb.append(getFromClause()); + sb.append(getFromHint()); + sb.append(" "); + sb.append(buildWhereClause(template)); + sb.append(buildUnionClause(getUnionSelectClauseMark())); + return sb.toString(); + } + + 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()) { + sb.append(getLineSeparator()); + } + sb.append(unionAll ? " union all " : " union "); + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()); + } + sb.append(selectClause).append(" ").append(unionQueryClause); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Clause Parts + // ============ + public String getSelectClause() { + StringBuilder sb = new StringBuilder(); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); + List<ColumnInfo> columnInfoList = dbmeta.getColumnInfoList(); + + // [DBFlute-0.7.4] + Map<String, String> localSpecifiedMap = _specifiedSelectColumnMap != null ? _specifiedSelectColumnMap + .get(getLocalTableAliasName()) + : null; + boolean existsSpecifiedLocal = localSpecifiedMap != null + && !localSpecifiedMap.isEmpty(); + + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + + // [DBFlute-0.7.4] + if (existsSpecifiedLocal + && !localSpecifiedMap.containsKey(columnName)) { + continue; + } + + 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); + } + Set<String> tableAliasNameSet = _selectedSelectColumnMap.keySet(); + for (String tableAliasName : tableAliasNameSet) { + Map<String, SelectedSelectColumnInfo> map = _selectedSelectColumnMap + .get(tableAliasName); + Collection<SelectedSelectColumnInfo> selectColumnInfoList = map + .values(); + + // [DBFlute-0.7.4] + Map<String, String> foreginSpecifiedMap = _specifiedSelectColumnMap != null ? _specifiedSelectColumnMap + .get(tableAliasName) + : null; + boolean existsSpecifiedForeign = foreginSpecifiedMap != null + && !foreginSpecifiedMap.isEmpty(); + + for (SelectedSelectColumnInfo selectColumnInfo : selectColumnInfoList) { + String realColumnName = selectColumnInfo.buildRealColumnName(); + + // [DBFlute-0.7.4] + if (existsSpecifiedForeign + && !foreginSpecifiedMap.containsKey(selectColumnInfo + .getColumnName())) { + continue; + } + + sb.append(", ").append(realColumnName).append(" as ").append( + selectColumnInfo.getColumnAliasName()); + _selectClauseRealColumnAliasMap.put(realColumnName, + selectColumnInfo.getColumnAliasName()); + } + } + if (_isIncludedSelectColumnEffective + && !_includedSelectColumnMap.isEmpty()) { + sb.append(getIncludedSelectColumnClause()); + } + + // [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); + } + } + + 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); + } + if (_isIncludedSelectColumnEffective + && !_includedSelectColumnMap.isEmpty()) { + sb.append(getIncludedSelectColumnClause()); + } + + // [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); + } + } + + return sb.toString(); + } + + public String getSelectHint() { + return createSelectHint(); + } + + 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); + } + return sb.toString(); + } + + public String getFromClause() { + StringBuilder sb = new StringBuilder(); + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append("from "); + if (_baseTableInlineWhereList.isEmpty()) { + sb.append(_tableName).append(" dflocal"); + } else { + sb.append( + getInlineViewClause(_tableName, _baseTableInlineWhereList)) + .append(" dflocal"); + } + sb.append(getFromBaseTableHint()); + sb.append(getLeftOuterJoinClause()); + return sb.toString(); + } + + protected String getLeftOuterJoinClause() { + StringBuilder sb = new StringBuilder(); + for (Iterator<String> ite = _outerJoinMap.keySet().iterator(); ite + .hasNext();) { + String aliasName = ite.next(); + LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + String joinTableName = joinInfo.getJoinTableName(); + List<String> inlineWhereClauseList = joinInfo + .getInlineWhereClauseList(); + List<String> additionalOnClauseList = joinInfo + .getAdditionalOnClauseList(); + Map<String, String> joinOnMap = joinInfo.getJoinOnMap(); + assertJoinOnMapNotEmpty(joinOnMap, aliasName); + + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append(" left outer join "); + if (inlineWhereClauseList.isEmpty()) { + sb.append(joinTableName); + } else { + sb.append(getInlineViewClause(joinTableName, + inlineWhereClauseList)); + } + sb.append(" ").append(aliasName).append(" on "); + int count = 0; + Set<String> localColumnNameSet = joinOnMap.keySet(); + for (String localColumnName : localColumnNameSet) { + String foreignColumnName = (String) joinOnMap + .get(localColumnName); + if (count > 0) { + sb.append(" and "); + } + if (localColumnName.equals("$$fixedCondition$$")) { + sb.append(foreignColumnName); + } else { + sb.append(localColumnName).append(" = ").append( + foreignColumnName); + } + ++count; + } + for (String additionalOnClause : additionalOnClauseList) { + sb.append(" and ").append(additionalOnClause); + } + } + return sb.toString(); + } + + protected String getInlineViewClause(String joinTableName, + List<String> inlineWhereClauseList) { + StringBuilder sb = new StringBuilder(); + sb.append("(select * from ").append(joinTableName).append(" where "); + int count = 0; + for (final Iterator<String> ite = inlineWhereClauseList.iterator(); ite + .hasNext();) { + String clauseElement = ite.next(); + clauseElement = filterWhereClauseSimply(clauseElement); + if (count > 0) { + sb.append(" and "); + } + sb.append(clauseElement); + ++count; + } + sb.append(")"); + return sb.toString(); + } + + public String getFromBaseTableHint() { + return createFromBaseTableHint(); + } + + public String getFromHint() { + return createFromHint(); + } + + public String getWhereClause() { + return buildWhereClause(false); + } + + protected String buildWhereClause(boolean template) { + StringBuilder sb = new StringBuilder(); + int count = 0; + for (Iterator<String> ite = _whereList.iterator(); ite.hasNext(); count++) { + String clauseElement = (String) ite.next(); + clauseElement = filterWhereClauseSimply(clauseElement); + if (count == 0) { + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append("where ").append( + template ? getWhereFirstConditionMark() : "").append( + clauseElement); + } else { + if (isFormatClauseEffective()) { + sb.append(getLineSeparator()).append(" "); + } + sb.append(" and ").append(clauseElement); + } + } + if (template && sb.length() == 0) { + sb.append(getWhereClauseMark()); + } + return sb.toString(); + } + + public String getOrderByClause() { + String orderByClause = null; + if (!_unionQueryInfoList.isEmpty()) { + if (_selectClauseRealColumnAliasMap == null + || _selectClauseRealColumnAliasMap.isEmpty()) { + String msg = "The selectClauseColumnAliasMap should not be null or empty when union query exists: " + + toString(); + throw new IllegalStateException(msg); + } + orderByClause = _orderByClause + .getOrderByClause(_selectClauseRealColumnAliasMap); + } else { + orderByClause = _orderByClause.getOrderByClause(); + } + if (isFormatClauseEffective() && orderByClause != null + && orderByClause.trim().length() > 0) { + return getLineSeparator() + " " + orderByClause; + } else { + return orderByClause; + } + } + + public String getSqlSuffix() { + String sqlSuffix = createSqlSuffix(); + if (isFormatClauseEffective() && sqlSuffix != null + && sqlSuffix.trim().length() > 0) { + return getLineSeparator() + sqlSuffix; + } else { + return sqlSuffix; + } + } + + //========================================================================== + // ========= + // 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 + // ==================== + /** + * Register selected select column. + * + * @param foreignTableAliasName The alias name of foreign table. (NotNull) + * @param localTableName The table name of local. (NotNull) + * @param foreignPropertyName The property name of foreign table. (NotNull) + * @param localRelationPath The path of local relation. (Nullable) + */ + public void registerSelectedSelectColumn(String foreignTableAliasName, + String localTableName, String foreignPropertyName, + String localRelationPath) { + _selectedSelectColumnMap + .put(foreignTableAliasName, createSelectedSelectColumnInfo( + foreignTableAliasName, localTableName, + foreignPropertyName, localRelationPath)); + } + + protected Map<String, SelectedSelectColumnInfo> createSelectedSelectColumnInfo( + String foreignTableAliasName, String localTableName, + String foreignPropertyName, String localRelationPath) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(localTableName); + final ForeignInfo foreignInfo = dbmeta + .findForeignInfo(foreignPropertyName); + final int relationNo = foreignInfo.getRelationNo(); + String nextRelationPath = "_" + relationNo; + if (localRelationPath != null) { + nextRelationPath = localRelationPath + nextRelationPath; + } + final Map<String, SelectedSelectColumnInfo> resultMap = new LinkedHashMap<String, SelectedSelectColumnInfo>(); + final DBMeta foreignDBMeta = foreignInfo.getForeignDBMeta(); + final List<ColumnInfo> columnInfoList = foreignDBMeta + .getColumnInfoList(); + for (ColumnInfo columnInfo : columnInfoList) { + final String columnDbName = columnInfo.getColumnDbName(); + final SelectedSelectColumnInfo selectColumnInfo = new SelectedSelectColumnInfo(); + selectColumnInfo.setTableAliasName(foreignTableAliasName); + selectColumnInfo.setColumnName(columnDbName); + selectColumnInfo + .setColumnAliasName(columnDbName + nextRelationPath); + resultMap.put(columnDbName, selectColumnInfo); + } + return resultMap; + } + + public static class SelectedSelectColumnInfo { + protected String tableAliasName; + + protected String columnName; + + protected String columnAliasName; + + public String buildRealColumnName() { + if (tableAliasName != null) { + return tableAliasName + "." + columnName; + } else { + return columnName; + } + } + + public String getTableAliasName() { + return tableAliasName; + } + + public void setTableAliasName(String tableAliasName) { + this.tableAliasName = tableAliasName; + } + + public String getColumnName() { + return columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public String getColumnAliasName() { + return columnAliasName; + } + + public void setColumnAliasName(String columnAliasName) { + this.columnAliasName = columnAliasName; + } + } + + //========================================================================== + // ========= + // 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, + Map<String, String> joinOnMap) { + assertAlreadyOuterJoin(aliasName); + assertJoinOnMapNotEmpty(joinOnMap, aliasName); + final LeftOuterJoinInfo joinInfo = new LeftOuterJoinInfo(); + joinInfo.setAliasName(aliasName); + joinInfo.setJoinTableName(joinTableName); + joinInfo.setJoinOnMap(joinOnMap); + _outerJoinMap.put(aliasName, joinInfo); + } + + protected static class LeftOuterJoinInfo { + protected String _aliasName; + + protected String _joinTableName; + + protected List<String> _inlineWhereClauseList = new ArrayList<String>(); + + protected List<String> _additionalOnClauseList = new ArrayList<String>(); + + protected Map<String, String> _joinOnMap; + + protected boolean _onClauseInline; + + public String getAliasName() { + return _aliasName; + } + + public void setAliasName(String value) { + _aliasName = value; + } + + public String getJoinTableName() { + return _joinTableName; + } + + public void setJoinTableName(String value) { + _joinTableName = value; + } + + public List<String> getInlineWhereClauseList() { + return _inlineWhereClauseList; + } + + public void addInlineWhereClause(String value) { + _inlineWhereClauseList.add(value); + } + + public List<String> getAdditionalOnClauseList() { + return _additionalOnClauseList; + } + + public void addAdditionalOnClause(String value) { + _additionalOnClauseList.add(value); + } + + public Map<String, String> getJoinOnMap() { + return _joinOnMap; + } + + public void setJoinOnMap(Map<String, String> value) { + _joinOnMap = value; + } + + public boolean isOnClauseInline() { + return _onClauseInline; + } + + public void setOnClauseInline(boolean value) { + _onClauseInline = value; + } + } + + protected void assertAlreadyOuterJoin(String aliasName) { + if (_outerJoinMap.containsKey(aliasName)) { + String msg = "The alias name have already registered in outer join: " + + aliasName; + throw new IllegalStateException(msg); + } + } + + protected void assertJoinOnMapNotEmpty(Map<String, String> joinOnMap, + String aliasName) { + if (joinOnMap.isEmpty()) { + String msg = "The joinOnMap should not be empty: aliasName=" + + aliasName; + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // Where + // ===== + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value) { + assertStringNotNullAndNotTrimmedEmpty("columnFullName", columnFullName); + key.addWhereClause(_whereList, columnFullName, value); + arrangeWhereListAdditionalConditionAsOr(_whereList); + } + + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value, ConditionOption option) { + assertStringNotNullAndNotTrimmedEmpty("columnFullName", columnFullName); + assertObjectNotNull("option of " + columnFullName, option); + key.addWhereClause(_whereList, columnFullName, value, option); + arrangeWhereListAdditionalConditionAsOr(_whereList); + } + + public void registerWhereClause(String clause) { + assertStringNotNullAndNotTrimmedEmpty("clause", clause); + _whereList.add(clause); + arrangeWhereListAdditionalConditionAsOr(_whereList); + } + + public void exchangeFirstWhereClauseForLastOne() { + if (_whereList.size() > 1) { + final String first = (String) _whereList.get(0); + final String last = (String) _whereList.get(_whereList.size() - 1); + _whereList.set(0, last); + _whereList.set(_whereList.size() - 1, first); + } + } + + //========================================================================== + // ========= + // InlineWhere + // =========== + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value) { + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + key.addWhereClause(_baseTableInlineWhereList, columnName, value); + arrangeWhereListAdditionalConditionAsOr(_baseTableInlineWhereList); + } + + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value, ConditionOption option) { + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + assertObjectNotNull("option of " + columnName, option); + key + .addWhereClause(_baseTableInlineWhereList, columnName, value, + option); + arrangeWhereListAdditionalConditionAsOr(_baseTableInlineWhereList); + } + + public void registerBaseTableInlineWhereClause(String value) { + _baseTableInlineWhereList.add(value); + } + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + boolean onClauseInline) { + assertNotYetOuterJoin(aliasName); + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + if (onClauseInline) { + key.addWhereClause(joinInfo.getAdditionalOnClauseList(), aliasName + + "." + columnName, value); + } else { + key.addWhereClause(joinInfo.getInlineWhereClauseList(), columnName, + value); + } + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getInlineWhereClauseList()); + } + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + ConditionOption option, boolean onClauseInline) { + assertNotYetOuterJoin(aliasName); + assertStringNotNullAndNotTrimmedEmpty("columnName", columnName); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + if (onClauseInline) { + key.addWhereClause(joinInfo.getAdditionalOnClauseList(), aliasName + + "." + columnName, value, option); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getAdditionalOnClauseList()); + } else { + key.addWhereClause(joinInfo.getInlineWhereClauseList(), columnName, + value, option); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getInlineWhereClauseList()); + } + } + + public void registerOuterJoinInlineWhereClause(String aliasName, + String value, boolean onClauseInline) { + assertNotYetOuterJoin(aliasName); + final LeftOuterJoinInfo joinInfo = (LeftOuterJoinInfo) _outerJoinMap + .get(aliasName); + if (onClauseInline) { + joinInfo.addAdditionalOnClause(value); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getAdditionalOnClauseList()); + } else { + joinInfo.addInlineWhereClause(value); + arrangeWhereListAdditionalConditionAsOr(joinInfo + .getInlineWhereClauseList()); + } + } + + protected void assertNotYetOuterJoin(String aliasName) { + if (!_outerJoinMap.containsKey(aliasName)) { + String msg = "The alias name have not registered in outer join yet: " + + aliasName; + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // ========= + // AdditionalConditionAsOr + // ======================= + public void makeAdditionalConditionAsOrEffective() { + _isAdditionalConditionAsOrEffective = true; + } + + public void ignoreAdditionalConditionAsOr() { + _isAdditionalConditionAsOrEffective = false; + } + + protected void arrangeWhereListAdditionalConditionAsOr( + List<String> whereList) { + if (_isAdditionalConditionAsOrEffective) { + if (whereList.size() < 2) { + String msg = "The whereList should have two more elements when the isAdditionalConditionAsOrEffective is true: " + + toString(); + throw new IllegalStateException(msg); + } + final String lastWhereClause = (String) whereList.remove(whereList + .size() - 1); + final String preWhereClause = (String) whereList.remove(whereList + .size() - 1); + if (preWhereClause.startsWith("(") && preWhereClause.endsWith(")")) { + final String plainClause = preWhereClause.substring("(" + .length(), preWhereClause.length() - ")".length()); + whereList.add("(" + plainClause + " or " + lastWhereClause + + ")"); + } else { + whereList.add("(" + preWhereClause + " or " + lastWhereClause + + ")"); + } + } + } + + //========================================================================== + // ========= + // OrderBy + // ======= + public OrderByClause getSqlComponentOfOrderByClause() { + return _orderByClause; + } + + public SqlClause clearOrderBy() { + _isOrderByEffective = false; + _orderByClause.clear(); + return this; + } + + public SqlClause ignoreOrderBy() { + _isOrderByEffective = false; + return this; + } + + public SqlClause makeOrderByEffective() { + if (!_orderByClause.isEmpty()) { + _isOrderByEffective = true; + } + return this; + } + + public void reverseOrderBy_Or_OverrideOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc) { + _isOrderByEffective = true; + if (!_orderByClause.isSameOrderByColumn(orderByProperty)) { + clearOrderBy(); + registerOrderBy(orderByProperty, registeredOrderByProperty, + ascOrDesc); + } else { + _orderByClause.reverseAll(); + } + } + + public void registerOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc) { + try { + _isOrderByEffective = true; + final List<String> orderByList = new ArrayList<String>(); + { + final StringTokenizer st = new StringTokenizer(orderByProperty, + "/"); + while (st.hasMoreElements()) { + orderByList.add(st.nextToken()); + } + } + + if (registeredOrderByProperty == null + || registeredOrderByProperty.trim().length() == 0) { + registeredOrderByProperty = orderByProperty; + } + + final List<String> registeredOrderByList = new ArrayList<String>(); + { + final StringTokenizer st = new StringTokenizer( + registeredOrderByProperty, "/"); + while (st.hasMoreElements()) { + registeredOrderByList.add(st.nextToken()); + } + } + + int count = 0; + for (final Iterator<String> ite = orderByList.iterator(); ite + .hasNext();) { + String orderBy = ite.next(); + String registeredOrderBy = (String) registeredOrderByList + .get(count); + + _isOrderByEffective = true; + String aliasName = null; + String columnName = null; + String registeredAliasName = null; + String registeredColumnName = null; + + if (orderBy.indexOf(".") < 0) { + columnName = orderBy; + } else { + aliasName = orderBy.substring(0, orderBy.lastIndexOf(".")); + columnName = orderBy + .substring(orderBy.lastIndexOf(".") + 1); + } + + if (registeredOrderBy.indexOf(".") < 0) { + registeredColumnName = registeredOrderBy; + } else { + registeredAliasName = registeredOrderBy.substring(0, + registeredOrderBy.lastIndexOf(".")); + registeredColumnName = registeredOrderBy + .substring(registeredOrderBy.lastIndexOf(".") + 1); + } + + OrderByElement element = new OrderByElement(); + element.setAliasName(aliasName); + element.setColumnName(columnName); + element.setRegisteredAliasName(registeredAliasName); + element.setRegisteredColumnName(registeredColumnName); + if (ascOrDesc) { + element.setupAsc(); + } else { + element.setupDesc(); + } + _orderByClause.addOrderByElement(element); + + count++; + } + } catch (RuntimeException e) { + String msg = "registerOrderBy() threw the exception: orderByProperty=" + + orderByProperty; + msg = msg + " registeredColumnFullName=" + + registeredOrderByProperty; + msg = msg + " ascOrDesc=" + ascOrDesc; + msg = msg + " sqlClause=" + this.toString(); + throw new RuntimeException(msg, e); + } + } + + public void addNullsFirstToPreviousOrderBy() { + _orderByClause + .addNullsFirstToPreviousOrderByElement(createOrderByNullsSetupper()); + } + + public void addNullsLastToPreviousOrderBy() { + _orderByClause + .addNullsLastToPreviousOrderByElement(createOrderByNullsSetupper()); + } + + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() {// As + // Default + return new OrderByClause.OrderByNullsSetupper() { + public String setup(String columnName, String orderByElementClause, + boolean nullsFirst) { + return orderByElementClause + " nulls " + + (nullsFirst ? "first" : "last"); + } + }; + } + + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupperByCaseWhen() {// Helper + // For + // Nulls + // Unsupported + // Database + return new OrderByClause.OrderByNullsSetupper() { + public String setup(String columnName, String orderByElementClause, + boolean nullsFirst) { + final String thenNumber = nullsFirst ? "1" : "0"; + final String elseNumber = nullsFirst ? "0" : "1"; + final String caseWhen = "case when " + columnName + + " is not null then " + thenNumber + " else " + + elseNumber + " end asc"; + return caseWhen + ", " + orderByElementClause; + } + }; + } + + //========================================================================== + // ========= + // UnionQuery + // ========== + public void registerUnionQuery(String unionQueryClause, boolean unionAll) { + assertStringNotNullAndNotTrimmedEmpty("unionQueryClause", + unionQueryClause); + final UnionQueryInfo unionQueryInfo = new UnionQueryInfo(); + unionQueryInfo.setUnionQueryClause(unionQueryClause); + unionQueryInfo.setUnionAll(unionAll); + _unionQueryInfoList.add(unionQueryInfo); + } + + protected static class UnionQueryInfo { + protected String _unionQueryClause; + + protected boolean _unionAll; + + public String getUnionQueryClause() { + return _unionQueryClause; + } + + public void setUnionQueryClause(String unionQueryClause) { + _unionQueryClause = unionQueryClause; + } + + public boolean isUnionAll() { + return _unionAll; + } + + public void setUnionAll(boolean unionAll) { + _unionAll = unionAll; + } + } + + //========================================================================== + // ========= + // FetchScope + // ========== + /** + * @param fetchSize Fetch-size. (NotMinus & NotZero) + * @return this. (NotNull) + */ + public SqlClause fetchFirst(int fetchSize) { + _isFetchScopeEffective = true; + if (fetchSize <= 0) { + String msg = "Argument[fetchSize] should be plus: " + fetchSize; + throw new IllegalArgumentException(msg); + } + _fetchStartIndex = 0; + _fetchSize = fetchSize; + _fetchPageNumber = 1; + doClearFetchPageClause(); + doFetchFirst(); + return this; + } + + /** + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch size. (NotMinus) + * @return this. (NotNull) + */ + public SqlClause fetchScope(int fetchStartIndex, int fetchSize) { + _isFetchScopeEffective = true; + if (fetchStartIndex < 0) { + String msg = "Argument[fetchStartIndex] must be plus or zero: " + + fetchStartIndex; + throw new IllegalArgumentException(msg); + } + if (fetchSize <= 0) { + String msg = "Argument[fetchSize] should be plus: " + fetchSize; + throw new IllegalArgumentException(msg); + } + _fetchStartIndex = fetchStartIndex; + _fetchSize = fetchSize; + return fetchPage(1); + } + + /** + * @param fetchPageNumber Page-number. 1 origin. (NotMinus & NotZero: If + * minus or zero, set one.) + * @return this. (NotNull) + */ + public SqlClause fetchPage(int fetchPageNumber) { + _isFetchScopeEffective = true; + if (fetchPageNumber <= 0) { + fetchPageNumber = 1; + } + if (_fetchSize <= 0) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "Fetch size should not be minus or zero!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "When you invoke this method, it is necessary to invoke 'fetchFirst()' or 'fetchScope()' ahead of that. " + + getLineSeparator(); + msg = msg + + "Please confirm your program. Does it really invoke 'fetchPage()' with 'fetchFirst()' or 'fetchScope()'?" + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + msg = msg + " XxxCB cb = new XxxCB();" + getLineSeparator(); + msg = msg + " cb.fetchPage(3);" + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + " XxxCB cb = new XxxCB();" + getLineSeparator(); + msg = msg + " cb.fetchFirst(20); // The size of page" + + getLineSeparator(); + msg = msg + " cb.fetchPage(3); // The number of target page" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Actual Parameter Value]" + getLineSeparator(); + msg = msg + "fetchSize=" + _fetchSize + getLineSeparator(); + msg = msg + "fetchPageNumber=" + fetchPageNumber + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + _fetchPageNumber = fetchPageNumber; + if (_fetchPageNumber == 1 && _fetchStartIndex == 0) { + return fetchFirst(_fetchSize); + } + doClearFetchPageClause(); + doFetchPage(); + return this; + } + + abstract protected void doFetchFirst(); + + abstract protected void doFetchPage(); + + abstract protected void doClearFetchPageClause(); + + public int getFetchStartIndex() { + return _fetchStartIndex; + } + + public int getFetchSize() { + return _fetchSize; + } + + public int getFetchPageNumber() { + return _fetchPageNumber; + } + + /** + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex() { + if (_fetchPageNumber <= 0) { + String msg = "_fetchPageNumber must be plus: " + _fetchPageNumber; + throw new IllegalStateException(msg); + } + return _fetchStartIndex + (_fetchSize * (_fetchPageNumber - 1)); + } + + /** + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex() { + if (_fetchPageNumber <= 0) { + String msg = "_fetchPageNumber must be plus: " + _fetchPageNumber; + throw new IllegalStateException(msg); + } + return _fetchStartIndex + (_fetchSize * _fetchPageNumber); + } + + public boolean isFetchScopeEffective() { + return _isFetchScopeEffective; + } + + public SqlClause ignoreFetchScope() { + _isFetchScopeEffective = false; + doClearFetchPageClause(); + return this; + } + + public SqlClause makeFetchScopeEffective() { + if (getFetchSize() > 0 && getFetchPageNumber() > 0) { + fetchPage(getFetchPageNumber()); + } + return this; + } + + public boolean isFetchStartIndexSupported() { + return true; // Default + } + + public boolean isFetchSizeSupported() { + return true; // Default + } + + abstract protected String createSelectHint(); + + abstract protected String createFromBaseTableHint(); + + abstract protected String createFromHint(); + + abstract protected String createSqlSuffix(); + + //========================================================================== + // ========= + // Fetch Narrowing + // =============== + /** + * The implementation. + * + * @return Fetch-narrowing start-index. + */ + public int getFetchNarrowingSkipStartIndex() { + return getPageStartIndex(); + } + + /** + * The implementation. + * + * @return Fetch-narrowing size. + */ + public int getFetchNarrowingLoopCount() { + return getFetchSize(); + } + + /** + * The implementation. + * + * @return Determination. + */ + public boolean isFetchNarrowingEffective() { + return _isFetchScopeEffective; + } + + //========================================================================== + // ========= + // Resolver + // ======== + public String resolveJoinAliasName(String relationPath, int cqNestNo) { + return resolveNestLevelExpression("dfrelation" + relationPath, cqNestNo); + } + + public String resolveNestLevelExpression(String name, int cqNestNo) { + // if (cqNestNo > 1) { + // return name + "_n" + cqNestNo; + // } else { + // return name; + // } + return name; + } + + public int resolveRelationNo(String localTableName, + String foreignPropertyName) { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(localTableName); + final ForeignInfo foreignInfo = dbmeta + .findForeignInfo(foreignPropertyName); + return foreignInfo.getRelationNo(); + } + + //========================================================================== + // ========= + // Table Alias Info + // ================ + public String getLocalTableAliasName() { + return "dflocal"; + } + + public String getForeignTableAliasPrefix() { + return "dfrelation"; + } + + //========================================================================== + // ========= + // Template Mark + // ============= + public String getWhereClauseMark() { + return "#df:whereClause#"; + } + + public String getWhereFirstConditionMark() { + return "#df:whereFirstCondition#"; + } + + public String getUnionSelectClauseMark() { + return "#df:unionSelectClause#"; + } + + public String getUnionWhereClauseMark() { + return "#df:unionWhereClause#"; + } + + public String getUnionWhereFirstConditionMark() { + return "#df:unionWhereFirstCondition#"; + } + + //========================================================================== + // =========== + // Where Clause Simple Filter + // ========================== + public void addWhereClauseSimpleFilter( + WhereClauseSimpleFilter whereClauseSimpleFilter) { + if (_whereClauseSimpleFilterList == null) { + _whereClauseSimpleFilterList = new ArrayList<WhereClauseSimpleFilter>(); + } + _whereClauseSimpleFilterList.add(whereClauseSimpleFilter); + } + + protected String filterWhereClauseSimply(String clauseElement) { + if (_whereClauseSimpleFilterList == null + || _whereClauseSimpleFilterList.isEmpty()) { + return clauseElement; + } + for (final Iterator<WhereClauseSimpleFilter> ite = _whereClauseSimpleFilterList + .iterator(); ite.hasNext();) { + final WhereClauseSimpleFilter filter = ite.next(); + if (filter == null) { + String msg = "The list of filter should not have null: _whereClauseSimpleFilterList=" + + _whereClauseSimpleFilterList; + throw new IllegalStateException(msg); + } + clauseElement = filter.filterClauseElement(clauseElement); + } + return clauseElement; + } + + //========================================================================== + // =========== + // Selected Foreign Info + // ===================== + public boolean isSelectedForeignInfoEmpty() { + if (_selectedForeignInfo == null) { + return true; + } + return _selectedForeignInfo.isEmpty(); + } + + public boolean hasSelectedForeignInfo(String relationPath) { + if (_selectedForeignInfo == null) { + return false; + } + return _selectedForeignInfo.containsKey(relationPath); + } + + public void registerSelectedForeignInfo(String relationPath, + String foreignPropertyName) { + if (_selectedForeignInfo == null) { + _selectedForeignInfo = new HashMap<String, String>(); + } + _selectedForeignInfo.put(relationPath, foreignPropertyName); + } + + //========================================================================== + // ========= + // Format Clause + // ============= + public boolean isFormatClauseEffective() { + return _formatClause; + } + + public void makeFormatClauseEffective() { + _formatClause = true; + } + + //========================================================================== + // ========= + // Sub Query Indent + // ================ + public String resolveSubQueryBeginMark(String subQueryIdentity) { + return getSubQueryBeginMarkPrefix() + subQueryIdentity + + getSubQueryIdentityTerminal(); + } + + public String resolveSubQueryEndMark(String subQueryIdentity) { + return getSubQueryEndMarkPrefix() + subQueryIdentity + + getSubQueryIdentityTerminal(); + } + + protected String getSubQueryBeginMarkPrefix() { + return "--df:SubQueryBegin#"; + } + + protected String getSubQueryEndMarkPrefix() { + return "--df:SubQueryEnd#"; + } + + protected String getSubQueryIdentityTerminal() { + return "#IdentityTerminal#"; + } + + public String filterSubQueryIndent(String sql) { + return isFormatClauseEffective() ? filterSubQueryIndent(sql, "") : sql; + } + + protected String filterSubQueryIndent(String sql, String preIndent) { + if (!isFormatClauseEffective()) { + return sql; + } + final String lineSeparator = getLineSeparator(); + if (!sql.contains(getSubQueryBeginMarkPrefix())) { + return sql; + } + final String[] lines = sql.split(lineSeparator); + final String beginMarkPrefix = getSubQueryBeginMarkPrefix(); + final String endMarkPrefix = getSubQueryEndMarkPrefix(); + final String identityTerminal = getSubQueryIdentityTerminal(); + final int terminalLength = identityTerminal.length(); + StringBuilder mainSb = new StringBuilder(); + StringBuilder subSb = null; + boolean throughBegin = false; + boolean throughBeginFirst = false; + String subQueryIdentity = null; + String indent = null; + for (String line : lines) { + if (!throughBegin) { + if (line.contains(beginMarkPrefix)) { + throughBegin = true; + subSb = new StringBuilder(); + final int markIndex = line.indexOf(beginMarkPrefix); + final int terminalIndex = line.indexOf(identityTerminal); + if (terminalIndex < 0) { + String msg = "Identity terminal was Not Found at the begin line: [" + + line + "]"; + throw new SubQueryIndentFailureException(msg); + } + final String clause = line.substring(0, markIndex) + + line.substring(terminalIndex + terminalLength); + subQueryIdentity = line.substring(markIndex + + beginMarkPrefix.length(), terminalIndex); + subSb.append(clause); + indent = buildSpaceBar(markIndex - preIndent.length()); + } else { + mainSb.append(line).append(getLineSeparator()); + } + } else { + // - - - - - - - - + // In begin to end + // - - - - - - - - + if (line.contains(endMarkPrefix + subQueryIdentity)) {// The end + final int markIndex = line.indexOf(endMarkPrefix); + final int terminalIndex = line.indexOf(identityTerminal); + if (terminalIndex < 0) { + String msg = "Identity terminal was Not Found at the begin line: [" + + line + "]"; + throw new SubQueryIndentFailureException(msg); + } + final String clause = line.substring(0, markIndex) + + line.substring(terminalIndex + terminalLength); + subSb.append(clause).append(getLineSeparator()); + final String currentSql = filterSubQueryIndent(subSb + .toString(), preIndent + indent); + mainSb.append(currentSql); + throughBegin = false; + throughBeginFirst = false; + } else { + if (!throughBeginFirst) { + subSb.append(line.trim()).append(getLineSeparator()); + throughBeginFirst = true; + } else { + subSb.append(indent).append(line).append( + getLineSeparator()); + } + } + } + } + final String filteredSql = mainSb.toString(); + + if (throughBegin) { + String msg = "End Mark Not Found!"; + msg = msg + getLineSeparator() + "[Current SubQueryIdentity]" + + getLineSeparator(); + msg = msg + subQueryIdentity + getLineSeparator(); + msg = msg + getLineSeparator() + "[Before Filter]" + + getLineSeparator(); + msg = msg + sql + getLineSeparator(); + msg = msg + getLineSeparator() + "[After Filter]" + + getLineSeparator() + filteredSql; + throw new SubQueryIndentFailureException(msg); + } + if (filteredSql.contains(beginMarkPrefix)) { + String msg = "Any begin marks are not filtered!"; + msg = msg + getLineSeparator() + "[Current SubQueryIdentity]" + + getLineSeparator(); + msg = msg + subQueryIdentity + getLineSeparator(); + msg = msg + getLineSeparator() + "[Before Filter]" + + getLineSeparator(); + msg = msg + sql + getLineSeparator(); + msg = msg + getLineSeparator() + "[After Filter]" + + getLineSeparator() + filteredSql; + throw new SubQueryIndentFailureException(msg); + } + return filteredSql; + } + + protected String buildSpaceBar(int size) { + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < size; i++) { + sb.append(" "); + } + return sb.toString(); + } + + public static class SubQueryIndentFailureException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public SubQueryIndentFailureException(String msg) { + super(msg); + } + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specification + // ============= + public void specifySelectColumn(String tableAliasName, String columnName) { + if (_specifiedSelectColumnMap == null) { + _specifiedSelectColumnMap = new HashMap<String, Map<String, String>>(); + } + if (!_specifiedSelectColumnMap.containsKey(tableAliasName)) { + _specifiedSelectColumnMap.put(tableAliasName, + new HashMap<String, String>()); + } + Map<String, String> elementMap = _specifiedSelectColumnMap + .get(tableAliasName); + elementMap.put(columnName, null); // The value is dummy for extension at + // the future. + _specifiedSelectColumnMap.put(tableAliasName, elementMap); + } + + public void specifyDeriveSubQuery(String aliasName, String deriveSubQuery) { + if (_specifiedDeriveSubQueryMap == null) { + _specifiedDeriveSubQueryMap = new LinkedHashMap<String, String>(); + } + _specifiedDeriveSubQueryMap.put(aliasName, deriveSubQuery); + } + + public boolean hasSpecifiedDeriveSubQuery(String aliasName) { + if (_specifiedDeriveSubQueryMap == null) { + return false; + } + return _specifiedDeriveSubQueryMap.containsKey(aliasName); + } + + public String getSpecifiedColumnNameAsOne() { + if (_specifiedSelectColumnMap != null + && _specifiedSelectColumnMap.size() == 1) { + Map<String, String> elementMap = _specifiedSelectColumnMap + .get(_specifiedSelectColumnMap.keySet().iterator().next()); + if (elementMap != null && elementMap.size() == 1) { + return elementMap.keySet().iterator().next(); + } + } + return null; + } + + public void clearSpecifiedSelectColumn() { + if (_specifiedSelectColumnMap != null) { + _specifiedSelectColumnMap.clear(); + _specifiedSelectColumnMap = null; + } + } + + // [DBFlute-0.7.5] + //========================================================================== + // ========= + // Query Update + // ============ + public String getClauseQueryUpdate(Map<String, String> columnParameterMap) { + if (columnParameterMap.isEmpty()) { + return null; + } + final String aliasName = getLocalTableAliasName(); + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The target table of queryUpdate() should have only one primary key:"; + msg = msg + " primaryKeys=" + + dbmeta.getPrimaryUniqueInfo().getUniqueColumnList(); + throw new IllegalStateException(msg); + } + final String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + final String selectClause = "select " + aliasName + "." + + primaryKeyName; + String fromWhereClause = getClauseFromWhereWithUnionTemplate(); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, + getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, + getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, + getUnionWhereFirstConditionMark(), ""); + + final StringBuilder sb = new StringBuilder(); + String ln = ""; + if (isFormatClauseEffective()) { + ln = getLineSeparator(); + } + sb.append("update ").append(_tableName).append(ln); + int index = 0; + // It is guaranteed that the map has one or more elements. + for (String columnName : columnParameterMap.keySet()) { + final String parameter = columnParameterMap.get(columnName); + if (index == 0) { + sb.append(" set ").append(columnName).append(" = ").append( + parameter).append(ln); + } else { + sb.append(" , ").append(columnName).append(" = ").append( + parameter).append(ln); + } + ++index; + } + if (isUpdateSubQueryUseLocalTableSupported()) { + final String subQuery = filterSubQueryIndent(selectClause + " " + + fromWhereClause); + sb.append(" where ").append(primaryKeyName); + sb.append(" in (").append(ln).append(subQuery).append(ln).append( + ")"); + return sb.toString(); + } else { + String subQuery = filterSubQueryIndent(fromWhereClause); + subQuery = replaceString(subQuery, aliasName + ".", ""); + subQuery = replaceString(subQuery, " " + aliasName + " ", " "); + subQuery = subQuery.substring(subQuery.indexOf("where ")); + sb.append(" ").append(subQuery); + return sb.toString(); + } + } + + public String getClauseQueryDelete() { + final String aliasName = getLocalTableAliasName(); + final DBMeta dbmeta = findDBMeta(); + if (dbmeta.hasTwoOrMorePrimaryKeys()) { + String msg = "The target table of queryDelete() should have only one primary key:"; + msg = msg + " primaryKeys=" + + dbmeta.getPrimaryUniqueInfo().getUniqueColumnList(); + throw new IllegalStateException(msg); + } + final String primaryKeyName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + final String selectClause = "select " + aliasName + "." + + primaryKeyName; + String fromWhereClause = getClauseFromWhereWithUnionTemplate(); + + // Replace template marks. These are very important! + fromWhereClause = replaceString(fromWhereClause, + getUnionSelectClauseMark(), selectClause); + fromWhereClause = replaceString(fromWhereClause, + getUnionWhereClauseMark(), ""); + fromWhereClause = replaceString(fromWhereClause, + getUnionWhereFirstConditionMark(), ""); + + if (isUpdateSubQueryUseLocalTableSupported()) { + final String subQuery = filterSubQueryIndent(selectClause + " " + + fromWhereClause); + final StringBuilder sb = new StringBuilder(); + String ln = ""; + if (isFormatClauseEffective()) { + 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( + ")"); + return sb.toString(); + } else { + String subQuery = filterSubQueryIndent(fromWhereClause); + subQuery = replaceString(subQuery, aliasName + ".", ""); + subQuery = replaceString(subQuery, " " + aliasName + " ", " "); + subQuery = subQuery.substring(subQuery.indexOf("from ")); + return "delete " + subQuery; + } + } + + protected boolean isUpdateSubQueryUseLocalTableSupported() { + return true; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint + // ================= + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return false; + } + + // [DBFlute-0.7.5] + //========================================================================== + // ========= + // Assist Helper + // ============= + protected DBMeta findDBMeta() { + return DBMetaInstanceHandler.findDBMeta(_tableName); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String replaceString(String text, String fromText, String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + protected void assertObjectNotNull(String variableName, Object value) { + SimpleAssertUtil.assertObjectNotNull(variableName, value); + } + + // ----------------------------------------------------- + // Assert String + // ------------- + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + SimpleAssertUtil.assertStringNotNullAndNotTrimmedEmpty(variableName, + value); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/AbstractSqlClause.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByClause.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByClause.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByClause.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,281 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OrderByClause implements Serializable { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // =========== + // Attribute + // ========= + protected List<OrderByElement> _orderByList = new ArrayList<OrderByElement>(); + + //========================================================================== + // =========== + // Constructor + // =========== + /** + * Constructor. + */ + public OrderByClause() { + } + + //========================================================================== + // =========== + // Manipulation + // ============ + /** + * Add order-by element. + * + * @param orderByElement Order-by element. (NotNull) + */ + public void addOrderByElement(OrderByElement orderByElement) { + _orderByList.add(orderByElement); + } + + /** + * Insert first order-by element . + * + * @param orderByElement Order-by element. (NotNull) + */ + public void insertFirstOrderByElement(OrderByElement orderByElement) { + _orderByList.add(0, orderByElement); + } + + public void reverseAll() { + for (Iterator<OrderByElement> ite = _orderByList.iterator(); ite + .hasNext();) { + ite.next().reverse(); + } + } + + public void exchangeFirstOrderByElementForLastOne() { + if (_orderByList.size() > 1) { + final OrderByElement first = _orderByList.get(0); + final OrderByElement last = _orderByList + .get(_orderByList.size() - 1); + _orderByList.set(0, last); + _orderByList.set(_orderByList.size() - 1, first); + } + } + + public void addNullsFirstToPreviousOrderByElement( + OrderByNullsSetupper filter) { + if (_orderByList.isEmpty()) { + return; + } + final OrderByElement last = _orderByList.get(_orderByList.size() - 1); + last.setOrderByNullsSetupper(filter, true); + } + + public void addNullsLastToPreviousOrderByElement(OrderByNullsSetupper filter) { + if (_orderByList.isEmpty()) { + return; + } + final OrderByElement last = _orderByList.get(_orderByList.size() - 1); + last.setOrderByNullsSetupper(filter, false); + } + + public static interface OrderByNullsSetupper { + public String setup(String columnName, String orderByElementClause, + boolean nullsFirst); + } + + //========================================================================== + // =========== + // Order-By Expression + // =================== + public List<OrderByElement> getOrderByList() { + return _orderByList; + } + + public String getOrderByClause() { + return getOrderByClause(null); + } + + public String getOrderByClause( + Map<String, String> selectClauseRealColumnAliasMap) { + if (_orderByList.isEmpty()) { + return ""; + } + final StringBuffer sb = new StringBuffer(); + final String delimiter = ", "; + for (final Iterator<OrderByElement> ite = _orderByList.iterator(); ite + .hasNext();) { + final OrderByElement element = ite.next(); + sb.append(delimiter); + if (selectClauseRealColumnAliasMap != null) { + sb.append(element + .getElementClause(selectClauseRealColumnAliasMap)); + } else { + sb.append(element.getElementClause()); + } + } + sb.delete(0, delimiter.length()).insert(0, "order by "); + return sb.toString(); + } + + public boolean isSameOrderByColumn(String orderByProperty) { + final List<String> orderByList = new ArrayList<String>(); + { + final StringTokenizer st = new StringTokenizer(orderByProperty, "/"); + while (st.hasMoreElements()) { + orderByList.add(st.nextToken()); + } + } + if (_orderByList.size() != orderByList.size()) { + return false; + } + int count = 0; + for (final Iterator<String> ite = orderByList.iterator(); ite.hasNext();) { + final String columnFullName = ite.next(); + final OrderByElement element = (OrderByElement) _orderByList + .get(count); + if (!element.getColumnFullName().equals(columnFullName)) { + return false; + } + count++; + } + return true; + } + + //========================================================================== + // =========== + // First Element + // ============= + public boolean isFirstElementAsc() { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new IllegalStateException(msg); + } + final OrderByElement element = (OrderByElement) _orderByList.get(0); + return element.isAsc(); + } + + public boolean isFirstElementDesc() { + return !isFirstElementAsc(); + } + + public boolean isSameAsFirstElementAliasName(String expectedAliasName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualAliasName = element.getAliasName(); + if (actualAliasName != null && expectedAliasName != null) { + return actualAliasName.equalsIgnoreCase(expectedAliasName); + } else { + return false; + } + } + + /** + * @param expectedColumnName Expected column-name. (Nullable) + * @return Determination. + */ + public boolean isSameAsFirstElementColumnName(String expectedColumnName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualColumnName = element.getColumnName(); + if (actualColumnName != null && expectedColumnName != null) { + return actualColumnName.equalsIgnoreCase(expectedColumnName); + } else { + return false; + } + } + + /** + * @param expectedAliasName Expected alias-name. (Nullable) + * @return Determination. + */ + public boolean isSameAsFirstElementRegisteredAliasName( + String expectedAliasName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualAliasName = element.getRegisteredAliasName(); + if (actualAliasName != null && expectedAliasName != null) { + return actualAliasName.equalsIgnoreCase(expectedAliasName); + } else { + return false; + } + } + + /** + * @param expectedColumnName Expected column-name. (Nullable) + * @return Determination. + */ + public boolean isSameAsFirstElementRegisteredColumnName( + String expectedColumnName) { + if (isEmpty()) { + String msg = "This order-by clause is empty: " + toString(); + throw new RuntimeException(msg); + } + OrderByElement element = (OrderByElement) _orderByList.get(0); + String actualColumnName = element.getRegisteredColumnName(); + if (actualColumnName != null && expectedColumnName != null) { + return actualColumnName.equalsIgnoreCase(expectedColumnName); + } else { + return false; + } + } + + //========================================================================== + // =========== + // Delegate of List + // ================ + /** + * Is empty? + * + * @return Determination. + */ + public boolean isEmpty() { + return _orderByList.isEmpty(); + } + + /** + * Get iterator of order-by list. + * + * @return Determination. + */ + public Iterator<OrderByElement> iterator() { + return _orderByList.iterator(); + } + + /** + * Clear order-by list. + */ + public void clear() { + _orderByList.clear(); + } + + //========================================================================== + // =========== + // Basic Override + // ============== + /** + * This method overrides the method that is declared at super. + * + * @return The view string of all-columns value. (NotNUll) + */ + public String toString() { + return _orderByList.toString(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByClause.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByElement.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByElement.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByElement.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,273 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +import java.io.Serializable; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class OrderByElement implements Serializable { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // =========== + // Attribute + // ========= + /** The value of alias name. */ + protected String _aliasName; + + /** The value of column name. */ + protected String _columnName; + + /** The value of registered alias name. */ + protected String _registeredAliasName; + + /** The value of registered column name. */ + protected String _registeredColumnName; + + /** The value of ascDesc. */ + protected String _ascDesc = "asc"; + + /** The setupper of order-by nulls. */ + protected OrderByClause.OrderByNullsSetupper _orderByNullsSetupper; + + /** Is nulls ordered first? */ + protected boolean _nullsFirst; + + //========================================================================== + // =========== + // Manipulation + // ============ + public void setupAsc() { + _ascDesc = "asc"; + } + + public void setupDesc() { + _ascDesc = "desc"; + } + + public void reverse() { + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + if (_ascDesc.equals("asc")) { + _ascDesc = "desc"; + } else if (_ascDesc.equals("desc")) { + _ascDesc = "asc"; + } else { + String msg = "The attribute[ascDesc] should be asc or desc: but ascDesc=" + + _ascDesc; + throw new IllegalStateException(msg); + } + } + + //========================================================================== + // =========== + // Order-By Expression + // =================== + public boolean isAsc() { + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + if (_ascDesc.equals("asc")) { + return true; + } else if (_ascDesc.equals("desc")) { + return false; + } else { + String msg = "The attribute[ascDesc] should be asc or desc: but ascDesc=" + + _ascDesc; + throw new IllegalStateException(msg); + } + } + + public String getColumnFullName() { + final StringBuilder sb = new StringBuilder(); + if (_aliasName != null) { + sb.append(_aliasName).append("."); + } + if (_columnName == null) { + String msg = "The attribute[columnName] should not be null."; + throw new IllegalStateException(msg); + } + sb.append(_columnName); + return sb.toString(); + } + + public String getElementClause() { + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + final StringBuilder sb = new StringBuilder(); + sb.append(getColumnFullName()).append(" ").append(_ascDesc); + if (_orderByNullsSetupper != null) { + return _orderByNullsSetupper.setup(getColumnFullName(), sb + .toString(), _nullsFirst); + } else { + return sb.toString(); + } + } + + public String getElementClause( + Map<String, String> selectClauseRealColumnAliasMap) { + if (selectClauseRealColumnAliasMap == null) { + String msg = "The argument[selectClauseRealColumnAliasMap] should not be null."; + throw new IllegalArgumentException(msg); + } + if (_ascDesc == null) { + String msg = "The attribute[ascDesc] should not be null."; + throw new IllegalStateException(msg); + } + final StringBuilder sb = new StringBuilder(); + final String columnAlias = selectClauseRealColumnAliasMap + .get(getColumnFullName()); + if (columnAlias == null || columnAlias.trim().length() == 0) { + throwOrderByColumnNotFoundException(getColumnFullName(), + selectClauseRealColumnAliasMap); + } + sb.append(columnAlias).append(" ").append(_ascDesc); + if (_orderByNullsSetupper != null) { + return _orderByNullsSetupper.setup(columnAlias, sb.toString(), + _nullsFirst); + } else { + return sb.toString(); + } + } + + protected void throwOrderByColumnNotFoundException(String columnName, + Map<String, String> selectClauseRealColumnAliasMap) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The column for order-by was Not Found in select-clause!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "If you use 'union()' or 'unionAll()', Check your condition-bean!" + + getLineSeparator(); + msg = msg + "Order-by for union can use only columns on select-clause." + + getLineSeparator(); + msg = msg + + "So the rule when using union is little difference from the one when NOT using." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " [before (x)]" + getLineSeparator(); + msg = msg + " AaaCB cb = new AaaCB();" + getLineSeparator(); + msg = msg + " cb.query().setXxx...();" + getLineSeparator(); + msg = msg + " {" + getLineSeparator(); + msg = msg + " AaaCB unionCB = new AaaCB();" + getLineSeparator(); + msg = msg + " unionCB.query().setXxx...();" + getLineSeparator(); + msg = msg + " cb.union(unionCB.query());" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + + " cb.query().queryBbb().addOrderBy_BbbName_Asc();// *NG!" + + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + " [after (o)]" + getLineSeparator(); + msg = msg + " AaaCB cb = new AaaCB();" + getLineSeparator(); + msg = msg + " cb.setupSelect_Bbb();// *Point!" + getLineSeparator(); + msg = msg + " cb.query().setXxx...();" + getLineSeparator(); + msg = msg + " {" + getLineSeparator(); + msg = msg + " AaaCB unionCB = new AaaCB();" + getLineSeparator(); + msg = msg + " unionCB.query().setXxx...();" + getLineSeparator(); + msg = msg + " cb.union(unionCB.query());" + getLineSeparator(); + msg = msg + " }" + getLineSeparator(); + msg = msg + + " cb.query().queryBbb().addOrderBy_BbbName_Asc();// *OK!" + + getLineSeparator(); + msg = msg + " " + getLineSeparator(); + msg = msg + + "Or else if you DON'T use 'union()' or 'unionAll()', This is the Framework Exception!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target Column]" + getLineSeparator(); + msg = msg + columnName + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Internal Object]" + getLineSeparator(); + msg = msg + "selectClauseRealColumnAliasMap=" + + selectClauseRealColumnAliasMap + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // =========== + // Basic Override + // ============== + /** + * This method overrides the method that is declared at super. + * + * @return The view-string of all-columns value. (NotNull) + */ + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("{aliasName=").append(_aliasName); + sb.append(" columnName=").append(_columnName); + sb.append(" registeredAliasName=").append(_registeredAliasName); + sb.append(" registeredColumnName=").append(_registeredColumnName); + sb.append(" ascDesc=").append(_ascDesc).append("}"); + return sb.toString(); + } + + //========================================================================== + // =========== + // Accessor + // ======== + public String getAliasName() { + return _aliasName; + } + + public String getColumnName() { + return _columnName; + } + + public String getRegisteredAliasName() { + return _registeredAliasName; + } + + public String getRegisteredColumnName() { + return _registeredColumnName; + } + + public String getAscDesc() { + return _ascDesc; + } + + public void setAliasName(String value) { + _aliasName = value; + } + + public void setColumnName(String value) { + _columnName = value; + } + + public void setRegisteredAliasName(String value) { + _registeredAliasName = value; + } + + public void setRegisteredColumnName(String value) { + _registeredColumnName = value; + } + + public void setAscDesc(String value) { + _ascDesc = value; + } + + public void setOrderByNullsSetupper( + OrderByClause.OrderByNullsSetupper value, boolean nullsFirst) { + _orderByNullsSetupper = value; + _nullsFirst = nullsFirst; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/OrderByElement.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClause.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClause.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClause.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,624 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; + +/** + * The interface of SQL-clause. + * + * @author DBFlute(AutoGenerator) + */ +public interface SqlClause { + + //========================================================================== + // =========== + // Clause + // ====== + // ----------------------------------------------------- + // Complete Clause + // --------------- + /** + * Get the clause of all parts. + * + * <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. (NotNull) + */ + 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 + // --------------- + /** + * Get from-where clause without select and orderBy and sqlSuffix. For + * subQuery and selectCount. + * <p> + * You should handle UnionSelectClauseMark and UnionWhereClauseMark and + * UnionWhereFirstConditionMark in clause. + * </p> + * + * @return The 'from-where' clause(contains union) without 'select' and + * 'orderBy' and 'sqlSuffix'. (NotNull) + */ + public String getClauseFromWhereWithUnionTemplate(); + + /** + * Get from-where clause without select and orderBy and sqlSuffix as + * template. For subQuery and selectCount. + * <p> + * You should handle UnionSelectClauseMark and UnionWhereClauseMark and + * UnionWhereFirstConditionMark and WhereClauseMark and + * WhereFirstConditionMark in clause. + * </p> + * + * @return The 'from-where' clause(contains union) without 'select' and + * 'orderBy' and 'sqlSuffix'. (NotNull) + */ + public String getClauseFromWhereWithWhereUnionTemplate(); + + //========================================================================== + // =========== + // Clause Parts + // ============ + /** + * Get the clause of 'select'. This is an internal method. + * + * @return The clause of select. {[select ...] from table...} (NotNull) + */ + 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...} + * (NotNull) + */ + 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) + */ + public String getFromClause(); + + /** + * Get the clause of from-base-table. This is an internal method. + * + * @return The hint of from-base-table. {select * from table + * [from-base-table-hint] where ...} (NotNull) + */ + public String getFromBaseTableHint(); + + /** + * Get the hint of 'from'. This is an internal method. + * + * @return The hint of 'from'. {select * from table left outer join ... on + * ... [from-hint] where ...} (NotNull) + */ + public String getFromHint(); + + /** + * Get the clause of 'where'. This is an internal method. + * + * @return The clause of 'where'. (NotNull) + */ + public String getWhereClause(); + + /** + * Get the clause of 'order-by'. This is an internal method. + * + * @return The clause of 'order-by'. (NotNull) + */ + public String getOrderByClause(); + + /** + * Get the suffix of SQL. This is an internal method. + * + * @return The suffix of SQL. {select * from table where ... order by ... + * [sql-suffix]} (NotNull) + */ + public String getSqlSuffix(); + + //========================================================================== + // ========= + // Copy Parts + // ========== + /** + * Copy included-select-column. + * + * @param sqlClause SQL-clause. (NotNull) + */ + public void copyIncludedSelectColumn(SqlClause sqlClause); + + //========================================================================== + // ========= + // SelectedSelectColumn + // ==================== + /** + * Register selected-select-column. + * + * @param foreignTableAliasName The alias name of foreign table. (NotNull) + * @param localTableName The table name of local. (NotNull) + * @param foreignPropertyName The property name of foreign table. (NotNull) + * @param localRelationPath The path of local relation. (Nullable) + */ + public void registerSelectedSelectColumn(String foreignTableAliasName, + String localTableName, String foreignPropertyName, + String localRelationPath); + + //========================================================================== + // ========= + // 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 + // ========= + /** + * Register outer-join. + * + * @param joinTableName The name of join table. {left outer join + * [joinTableName]} (NotNull) + * @param aliasName The alias name of join table. {left outer join + * joinTableName [aliasName]} (NotNull and Unique per invoking + * method) + * @param joinOnMap Map that has conditions of on-clause. (NotNull) + */ + public void registerOuterJoin(String joinTableName, String aliasName, + Map<String, String> joinOnMap); + + //========================================================================== + // ========= + // Where + // ===== + /** + * Register 'where' clause. + * + * @param columnFullName The full name of column. + * {[table-name].[column-name]}. (NotNull) + * @param key Condition-key. (NotNull) + * @param value Condition-value. (NotNull) + */ + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value); + + /** + * Register 'where' clause. + * + * @param columnFullName The full name of column. + * {[table-name].[column-name]}. (NotNull) + * @param key Condition-key. (NotNull) + * @param value Condition-value. (NotNull) + * @param option Condition-option. (NotNull) + */ + public void registerWhereClause(String columnFullName, ConditionKey key, + ConditionValue value, ConditionOption option); + + /** + * Register 'where' clause. + * + * @param clause The clause of 'where'. (NotNull) + */ + public void registerWhereClause(String clause); + + /** + * Exchange first The clause of 'where' for last one. + */ + public void exchangeFirstWhereClauseForLastOne(); + + //========================================================================== + // ========= + // InlineWhere + // =========== + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value); + + public void registerBaseTableInlineWhereClause(String columnName, + ConditionKey key, ConditionValue value, ConditionOption option); + + public void registerBaseTableInlineWhereClause(String value); + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + boolean onClauseInline); + + public void registerOuterJoinInlineWhereClause(String aliasName, + String columnName, ConditionKey key, ConditionValue value, + ConditionOption option, boolean onClauseInline); + + public void registerOuterJoinInlineWhereClause(String aliasName, + String value, boolean onClauseInline); + + //========================================================================== + // ========= + // AdditionalConditionAsOr + // ======================= + public void makeAdditionalConditionAsOrEffective(); + + public void ignoreAdditionalConditionAsOr(); + + //========================================================================== + // ========= + // OrderBy + // ======= + public OrderByClause getSqlComponentOfOrderByClause(); + + public SqlClause clearOrderBy(); + + public SqlClause ignoreOrderBy(); + + public SqlClause makeOrderByEffective(); + + /** + * @param orderByProperty Order-by-property. + * 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @param registeredOrderByProperty Registered-order-by-property. + * ([table-name].[column-name]) (Nullable) + * @param ascOrDesc Is it ascend or descend? + */ + public void registerOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc); + + /** + * @param orderByProperty Order-by-property. + * 'aliasName.columnName/aliasName.columnName/...' (NotNull) + * @param registeredOrderByProperty Registered-order-by-property. + * ([table-name].[column-name]) (Nullable) + * @param ascOrDesc Is it ascend or descend? + */ + public void reverseOrderBy_Or_OverrideOrderBy(String orderByProperty, + String registeredOrderByProperty, boolean ascOrDesc); + + public void addNullsFirstToPreviousOrderBy(); + + public void addNullsLastToPreviousOrderBy(); + + //========================================================================== + // ========= + // Union + // ===== + public void registerUnionQuery(String unionClause, boolean unionAll); + + //========================================================================== + // ========= + // FetchScope + // ========== + /** + * Fetch first. + * + * @param fetchSize Fetch-size. (NotMinus) + * @return this. (NotNull) + */ + public SqlClause fetchFirst(int fetchSize); + + /** + * Fetch scope. + * + * @param fetchStartIndex Fetch-start-index. 0 origin. (NotMinus) + * @param fetchSize Fetch-size. (NotMinus) + * @return this. (NotNull) + */ + public SqlClause fetchScope(int fetchStartIndex, int fetchSize); + + /** + * Fetch page. + * <p> + * When you invoke this, it is normally necessary to invoke 'fetchFirst()' + * or 'fetchScope()' ahead of that. But you also can use default-fetch-size + * without invoking 'fetchFirst()' or 'fetchScope()'. If you invoke this, + * your SQL returns [fetch-size] records from [fetch-start-index] calculated + * by [fetch-page-number]. + * </p> + * + * @param fetchPageNumber Fetch-page-number. 1 origin. (NotMinus & NotZero: + * If minus or zero, set one.) + * @return this. (NotNull) + */ + public SqlClause fetchPage(int fetchPageNumber); + + /** + * Get fetch start index. + * + * @return Fetch start index. + */ + public int getFetchStartIndex(); + + /** + * Get fetch size. + * + * @return Fetch size. + */ + public int getFetchSize(); + + /** + * Get fetch page number. + * + * @return Fetch page number. + */ + public int getFetchPageNumber(); + + /** + * Get page start index. + * + * @return Page start index. 0 origin. (NotMinus) + */ + public int getPageStartIndex(); + + /** + * Get page end index. + * + * @return Page end index. 0 origin. (NotMinus) + */ + public int getPageEndIndex(); + + /** + * Is fetch scope effective? + * + * @return Determiantion. + */ + public boolean isFetchScopeEffective(); + + /** + * Ignore fetch-scope. + * + * @return this. (NotNull) + */ + public SqlClause ignoreFetchScope(); + + /** + * Make fetch-scope effective. + * + * @return this. (NotNull) + */ + public SqlClause makeFetchScopeEffective(); + + /** + * Is fetch start index supported? + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported(); + + /** + * Is fetch size supported? + * + * @return Determination. + */ + public boolean isFetchSizeSupported(); + + //========================================================================== + // ========= + // Fetch Narrowing + // =============== + /** + * Is fetch-narrowing effective? + * + * @return Determiantion. + */ + public boolean isFetchNarrowingEffective(); + + /** + * Get fetch-narrowing skip-start-index. + * + * @return Skip-start-index. + */ + public int getFetchNarrowingSkipStartIndex(); + + /** + * Get fetch-narrowing loop-count. + * + * @return Loop-count. + */ + public int getFetchNarrowingLoopCount(); + + //========================================================================== + // ========= + // Lock + // ==== + /** + * Lock for update. + * <p> + * If you invoke this, your SQL lock target records for update. It depends + * whether this method supports this on the database type. + * </p> + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate(); + + //========================================================================== + // ========= + // Resolver + // ======== + /** + * Resolve join alias name. + * + * @param relationPath Relation path. (NotNull) + * @param cqNestNo The nest no of condition query. + * @return Resolved join alias name. (NotNull) + */ + public String resolveJoinAliasName(String relationPath, int cqNestNo); + + /** + * Resolve nest level expression. + * + * @param name Name. (NotNull) + * @param cqNestNo The nest no of condition query. + * @return Resolved name about nest level. (NotNull) + */ + public String resolveNestLevelExpression(String name, int cqNestNo); + + /** + * Resolve relation no. + * + * @param baseTableName The table name of base. (NotNull) + * @param foreignPropertyName The property name of foreign. (NotNull) + * @return Resolved relation no. + */ + public int resolveRelationNo(String baseTableName, + String foreignPropertyName); + + //========================================================================== + // ========= + // Table Alias Info + // ================ + public String getLocalTableAliasName(); + + public String getForeignTableAliasPrefix(); + + //========================================================================== + // ========= + // Template Mark + // ============= + public String getWhereClauseMark(); + + public String getWhereFirstConditionMark(); + + public String getUnionSelectClauseMark(); + + public String getUnionWhereClauseMark(); + + public String getUnionWhereFirstConditionMark(); + + //========================================================================== + // ========= + // Where Clause Simple Filter + // ========================== + public void addWhereClauseSimpleFilter( + WhereClauseSimpleFilter whereClauseSimpleFilter); + + //========================================================================== + // ========= + // Selected Foreign Info + // ===================== + public boolean isSelectedForeignInfoEmpty(); + + public boolean hasSelectedForeignInfo(String relationPath); + + public void registerSelectedForeignInfo(String relationPath, + String foreignPropertyName); + + //========================================================================== + // ========= + // Format Clause + // ============= + public boolean isFormatClauseEffective(); + + public void makeFormatClauseEffective(); + + //========================================================================== + // ========= + // Sub Query Indent + // ================ + public String resolveSubQueryBeginMark(String subQueryIdentity); + + public String resolveSubQueryEndMark(String subQueryIdentity); + + public String filterSubQueryIndent(String sql); + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specification + // ============= + public void specifySelectColumn(String tableAliasName, String columnName); + + public void specifyDeriveSubQuery(String aliasName, String deriveSubQuery); + + public boolean hasSpecifiedDeriveSubQuery(String aliasName); + + public String getSpecifiedColumnNameAsOne(); + + public void clearSpecifiedSelectColumn(); + + // [DBFlute-0.7.5] + //========================================================================== + // ========= + // Query Update + // ============ + /** + * @param columnParameterMap The map of column parameters. (NotNull) + * @return The clause of query update. (Nullable: If columnParameterMap is + * empty, return null) + */ + public String getClauseQueryUpdate(Map<String, String> columnParameterMap); + + public String getClauseQueryDelete(); + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint + // ================= + /** + * Is the SQLException from unique constraint? {Use both SQLState and + * ErrorCode} + * + * @param sqlState SQLState of the SQLException. (Nullable) + * @param errorCode ErrorCode of the SQLException. (Nullable) + * @return Is the SQLException from unique constraint? + */ + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClause.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDb2.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDb2.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDb2.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,165 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for DB2. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseDb2 extends AbstractSqlClause { + + //========================================================================== + // ========= + // Attribute + // ========= + /** String of fetch-first as sql-suffix. */ + protected String _fetchFirstSqlSuffix = ""; + + /** String of lock as from-hint. */ + protected String _lockSqlSuffix = ""; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseDb2(String tableName) { + super(tableName); + } + + //========================================================================== + // ========= + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + //========================================================================== + // ========= + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchFirstSqlSuffix = " fetch first " + getFetchSize() + + " rows only"; + } + } + + /** + * The implementation. {Unsupported!} + */ + protected void doFetchPage() { + if (isFetchSizeSupported()) { + if (isFetchStartIndexSupported()) { + _fetchFirstSqlSuffix = " fetch first " + getFetchSize() + + " rows only"; + } else { + _fetchFirstSqlSuffix = " fetch first " + getPageEndIndex() + + " rows only"; + } + } + } + + /** + * The implementation. {Unsupported!} + */ + protected void doClearFetchPageClause() { + _fetchFirstSqlSuffix = ""; + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update with RS"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchFirstSqlSuffix + _lockSqlSuffix; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return "23505".equals(sqlState); + } + + // [DBFlute-0.7.9] + //========================================================================== + // ========= + // DB2 Dependency + // ============== + public void lockWithRR() { + _lockSqlSuffix = " with RR"; + } + + public void lockWithRS() { + _lockSqlSuffix = " with RS"; + } + + public void lockWithCS() { + _lockSqlSuffix = " with CS"; + } + + public void lockWithUR() { + _lockSqlSuffix = " with UR"; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDb2.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDefault.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDefault.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDefault.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,113 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Default. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseDefault extends AbstractSqlClause { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param tableName Table name. (NotNull) + **/ + public SqlClauseDefault(String tableName) { + super(tableName); + } + + //========================================================================== + // ========= + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + } + + /** + * The implementation. + */ + protected void doFetchPage() { + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; // Default + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchSizeSupported() { + return false; // Default + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + String msg = "LockForUpdate-SQL is unsupported in the database. Sorry...: " + + toString(); + throw new UnsupportedOperationException(msg); + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return ""; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDefault.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDerby.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDerby.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDerby.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,136 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Default. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseDerby extends AbstractSqlClause { + + //========================================================================== + // ========= + // Attribute + // ========= + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseDerby(String tableName) { + super(tableName); + } + + //========================================================================== + // ========= + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + //========================================================================== + // ========= + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + } + + /** + * The implementation. + */ + protected void doFetchPage() { + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; // Default + } + + /** + * The override. + * + * @return Determination. + */ + public boolean isFetchSizeSupported() { + return false; // Default + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _lockSqlSuffix; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return "23505".equals(sqlState); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseDerby.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,103 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Firebird. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseFirebird extends AbstractSqlClause { + + /** String of fetch-scope as select-hint. */ + protected String _fetchScopeSelectHint = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseFirebird(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize(); + } + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize() + " skip " + + getPageStartIndex(); + } + if (isFetchStartIndexSupported() && !isFetchSizeSupported()) { + _fetchScopeSelectHint = " skip " + getPageStartIndex(); + } + if (!isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getPageEndIndex(); + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSelectHint = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update with lock"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchScopeSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _lockSqlSuffix; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseFirebird.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseH2.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseH2.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseH2.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,104 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for H2. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseH2 extends AbstractSqlClause { + + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseH2(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + _fetchScopeSqlSuffix = " limit " + getFetchSize() + " offset " + + getPageStartIndex(); + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSqlSuffix = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return "23001".equals(sqlState); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseH2.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,111 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for Interbase. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseInterbase extends AbstractSqlClause { + + //========================================================================== + // ========= + // Attribute + // ========= + /** String of fetch-scope as select-hint. */ + protected String _fetchScopeSelectHint = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseInterbase(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize(); + } + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getFetchSize() + " skip " + + getPageStartIndex(); + } + if (isFetchStartIndexSupported() && !isFetchSizeSupported()) { + _fetchScopeSelectHint = " skip " + getPageStartIndex(); + } + if (!isFetchStartIndexSupported() && isFetchSizeSupported()) { + _fetchScopeSelectHint = " first " + getPageEndIndex(); + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSelectHint = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update with lock"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchScopeSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _lockSqlSuffix; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseInterbase.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseMySql.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseMySql.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseMySql.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,135 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for MySQL. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseMySql extends AbstractSqlClause { + + //========================================================================== + // ========= + // Attribute + // ========= + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseMySql(String tableName) { + super(tableName); + } + + //========================================================================== + // ========= + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + //========================================================================== + // ========= + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + _fetchScopeSqlSuffix = " limit " + getPageStartIndex() + ", " + + getFetchSize(); + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSqlSuffix = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } + + // [DBFlute-0.7.5] + //========================================================================== + // ========= + // Query Update Override + // ===================== + @Override + protected boolean isUpdateSubQueryUseLocalTableSupported() { + return false; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return errorCode != null && errorCode == 1062; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseMySql.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseOracle.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseOracle.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseOracle.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,182 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * SqlClause for Oracle. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseOracle extends AbstractSqlClause { + + //========================================================================== + // ========= + // Attribute + // ========= + /** String of fetch-scope as select-hint. */ + protected String _fetchScopeSelectHint = ""; + + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseOracle(String tableName) { + super(tableName); + } + + //========================================================================== + // ========= + // Database Original Override + // ========================== + @Override + protected String buildUnionClause(String selectClause) { + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Remove select-hint comment from select clause of union + // for fetch-scope with union(). + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + selectClause = replaceString(selectClause, SELECT_HINT, ""); + return super.buildUnionClause(selectClause); + } + + //========================================================================== + // ========= + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (!isFetchStartIndexSupported() && !isFetchSizeSupported()) { + return; + } + String ln = null; + if (isFormatClauseEffective()) { + ln = getLineSeparator(); + } else { + ln = ""; + } + _fetchScopeSelectHint = " * from (select base.*, rownum as rn from (" + + ln + "select"; + _fetchScopeSqlSuffix = ""; + if (isFetchStartIndexSupported()) { + _fetchScopeSqlSuffix = ") base )" + ln + " where rn > " + + getPageStartIndex(); + } + if (isFetchSizeSupported()) { + if (isFetchStartIndexSupported()) { + _fetchScopeSqlSuffix = _fetchScopeSqlSuffix + " and rn <= " + + getPageEndIndex(); + } else { + _fetchScopeSqlSuffix = ") base )" + ln + " where rn <= " + + getPageEndIndex(); + } + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSelectHint = ""; + _fetchScopeSqlSuffix = ""; + } + + //========================================================================== + // ========= + // Lock Override + // ============= + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + final DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(_tableName); + if (dbmeta.hasPrimaryKey()) { + final String primaryKeyColumnName = dbmeta.getPrimaryUniqueInfo() + .getFirstColumn().getColumnDbName(); + _lockSqlSuffix = " for update of " + getLocalTableAliasName() + "." + + primaryKeyColumnName; + } else { + final String randomColumnName = ((ColumnInfo) dbmeta + .getColumnInfoList().get(0)).getColumnDbName(); + _lockSqlSuffix = " for update of " + getLocalTableAliasName() + "." + + randomColumnName; + } + return this; + } + + //========================================================================== + // ========= + // Hint Override + // ============= + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchScopeSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return errorCode != null && errorCode == 1; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseOracle.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,104 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for PostreSQL. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClausePostgreSql extends AbstractSqlClause { + + /** String of fetch-scope as sql-suffix. */ + protected String _fetchScopeSqlSuffix = ""; + + /** String of lock as sql-suffix. */ + protected String _lockSqlSuffix = ""; + + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClausePostgreSql(String tableName) { + super(tableName); + } + + /** + * The implementation. + */ + protected void doFetchFirst() { + doFetchPage(); + } + + /** + * The implementation. + */ + protected void doFetchPage() { + _fetchScopeSqlSuffix = " offset " + getPageStartIndex() + " limit " + + getFetchSize(); + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchScopeSqlSuffix = ""; + } + + /** + * The implementation. + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockSqlSuffix = " for update"; + return this; + } + + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return ""; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return _fetchScopeSqlSuffix + _lockSqlSuffix; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return "23505".equals(sqlState); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClausePostgreSql.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,147 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +/** + * SqlClause for MSSQL. + * + * @author DBFlute(AutoGenerator) + */ +public class SqlClauseSqlServer extends AbstractSqlClause { + + //========================================================================== + // ========= + // Attribute + // ========= + /** String of fetch-first as select-hint. */ + protected String _fetchFirstSelectHint = ""; + + /** String of lock as from-hint. */ + protected String _lockFromHint = ""; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param tableName Table name. (NotNull) + **/ + public SqlClauseSqlServer(String tableName) { + super(tableName); + } + + //========================================================================== + // ========= + // OrderBy Override + // ================ + @Override + protected OrderByClause.OrderByNullsSetupper createOrderByNullsSetupper() { + return createOrderByNullsSetupperByCaseWhen(); + } + + //========================================================================== + // ========= + // FetchScope Override + // =================== + /** + * The implementation. + */ + protected void doFetchFirst() { + if (isFetchSizeSupported()) { + _fetchFirstSelectHint = " top " + getFetchSize(); + } + } + + /** + * The implementation. + */ + protected void doFetchPage() { + if (isFetchSizeSupported()) { + if (isFetchStartIndexSupported()) { + _fetchFirstSelectHint = " top " + getFetchSize(); + } else { + _fetchFirstSelectHint = " top " + getPageEndIndex(); + } + } + } + + /** + * The implementation. + */ + protected void doClearFetchPageClause() { + _fetchFirstSelectHint = ""; + } + + /** + * @return Determination. + */ + public boolean isFetchStartIndexSupported() { + return false; + } + + //========================================================================== + // ========= + // Lock Override + // ============= + /** + * The implementation. {Implement} + * + * @return this. (NotNull) + */ + public SqlClause lockForUpdate() { + _lockFromHint = " with (updlock)"; + return this; + } + + //========================================================================== + // ========= + // Hint Override + // ============= + /** + * The implementation. + * + * @return Select-hint. (NotNull) + */ + protected String createSelectHint() { + return _fetchFirstSelectHint; + } + + /** + * The implementation. + * + * @return From-base-table-hint. {select * from table [from-base-table-hint] + * where ...} (NotNull) + */ + protected String createFromBaseTableHint() { + return _lockFromHint; + } + + /** + * The implementation. + * + * @return From-hint. (NotNull) + */ + protected String createFromHint() { + return ""; + } + + /** + * The implementation. + * + * @return Sql-suffix. (NotNull) + */ + protected String createSqlSuffix() { + return ""; + } + + // [DBFlute-0.7.7] + //========================================================================== + // ========= + // Unique Constraint Override + // ========================== + @Override + public boolean isUniqueConstraintException(String sqlState, + Integer errorCode) { + return errorCode != null && errorCode == 2627; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/SqlClauseSqlServer.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,146 @@ +package jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * The interface of simple filter for where clause. + * + * @author DBFlute(AutoGenerator) + */ +public interface WhereClauseSimpleFilter { + + public static final String BIND_COMMENT_BEGIN_PART = "/*dto"; + + public static final String BIND_COMMENT_END_PART = "*/null"; + + public static final String EMBEDDED_COMMENT_BEGIN_PART = "/*$dto"; + + public static final String EMBEDDED_COMMENT_END_PART = "*/null"; + + public static final String EMBEDDED_COMMENT_QUOTED_BEGIN_PART = "'/*$dto"; + + public static final String EMBEDDED_COMMENT_QUOTED_END_PART = "*/'dummy''"; + + /** + * Filter clause element. + * + * @param clauseElement Clause element of where. (NotNull and NotEmpty) + * @return Filtered where clause. (NotNull and NotEmpty) + */ + public String filterClauseElement(String clauseElement); + + /** + * The simple filter for where clause to embedded. <br /> *Attension -- + * Target column is not perfect. This class determines by column name only! + * So when the column name of base table is same as the column name of join + * table, both are target! + * + * @author DBFlute(AutoGenerator) + */ + public static class WhereClauseToEmbeddedSimpleFilter implements + WhereClauseSimpleFilter { + + protected java.util.Set<ColumnInfo> _filterTargetColumnInfoSet; + + public WhereClauseToEmbeddedSimpleFilter( + ColumnInfo filterTargetColumnInfo) { + this._filterTargetColumnInfoSet = new java.util.HashSet<ColumnInfo>(); + this._filterTargetColumnInfoSet.add(filterTargetColumnInfo); + } + + public WhereClauseToEmbeddedSimpleFilter( + java.util.Set<ColumnInfo> filterTargetColumnInfoSet) { + this._filterTargetColumnInfoSet = filterTargetColumnInfoSet; + } + + /** + * Filter clause element. + * + * @param clauseElement Clause element of where. (NotNull and NotEmpty) + * @return Filtered where clause. (NotNull and NotEmpty) + */ + public String filterClauseElement(String clauseElement) { + if (_filterTargetColumnInfoSet == null + || _filterTargetColumnInfoSet.isEmpty()) { + return toEmbedded(clauseElement); + } + for (final java.util.Iterator<ColumnInfo> ite = _filterTargetColumnInfoSet + .iterator(); ite.hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + if (isTargetClause(clauseElement, columnInfo.getColumnDbName())) { + return toEmbedded(clauseElement); + } + } + return clauseElement; + } + + protected boolean isTargetClause(String clauseElement, + final String columnDbName) { + return clauseElement.indexOf("." + columnDbName + " ") >= 0; + } + + protected String toEmbedded(String clauseElement) { + clauseElement = replace(clauseElement, BIND_COMMENT_BEGIN_PART, + EMBEDDED_COMMENT_BEGIN_PART); + clauseElement = replace(clauseElement, BIND_COMMENT_END_PART, + EMBEDDED_COMMENT_END_PART); + return clauseElement; + } + + protected 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(); + } + } + + /** + * The simple filter for where clause to embedded and quoted. <br /> + * *Attension -- Target column is not perfect. This class determines by + * column name only! So when the column name of base table is same as the + * column name of join table, both are target! + * + * @author DBFlute(AutoGenerator) + */ + public static class WhereClauseToEmbeddedQuotedSimpleFilter extends + WhereClauseToEmbeddedSimpleFilter { + + public WhereClauseToEmbeddedQuotedSimpleFilter( + ColumnInfo filterTargetColumnInfo) { + super(filterTargetColumnInfo); + } + + public WhereClauseToEmbeddedQuotedSimpleFilter( + java.util.Set<ColumnInfo> filterTargetColumnInfoSet) { + super(filterTargetColumnInfoSet); + } + + protected String toEmbedded(String clauseElement) { + clauseElement = replace(clauseElement, BIND_COMMENT_BEGIN_PART, + EMBEDDED_COMMENT_QUOTED_BEGIN_PART); + clauseElement = replace(clauseElement, BIND_COMMENT_END_PART, + EMBEDDED_COMMENT_QUOTED_END_PART); + return clauseElement; + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/cbean/sqlclause/WhereClauseSimpleFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/AbstractDBMeta.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/AbstractDBMeta.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/AbstractDBMeta.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1250 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta; + +import java.lang.reflect.Method; +import java.util.ArrayList; +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 jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.RelationInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.MapListString; +import jp.sf.pal.scheduler.db.allcommon.helper.MapListStringImpl; +import jp.sf.pal.scheduler.db.allcommon.helper.MapStringBuilder; +import jp.sf.pal.scheduler.db.allcommon.helper.MapStringBuilderImpl; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleAssertUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * The abstract class of DB meta. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractDBMeta implements DBMeta { + + //========================================================================== + // ========= + // Attribute + // ========= + protected List<ColumnInfo> _columnInfoList; + + //========================================================================== + // ========= + // Column Info + // =========== + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column. (NotNull) + * @return Determination. + */ + public boolean hasColumn(String columnFlexibleName) { + if (!hasFlexibleName(columnFlexibleName)) { + return false; + } + final String propertyName = findPropertyName(columnFlexibleName); + return hasMethod("column" + initCap(propertyName)); + } + + /** + * The implementation. + * + * @param columnFlexibleName The flexible name of the column. (NotNull and + * NotEmpty) + * @return The information of the column. (NotNull) + */ + public ColumnInfo findColumnInfo(String columnFlexibleName) { + assertStringNotNullAndNotTrimmedEmpty("columnFlexibleName", + columnFlexibleName); + if (!hasColumn(columnFlexibleName)) { + 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()); + } + } + + protected ColumnInfo cci(String columnDbName, String propertyName, + Class<?> propertyType, boolean primary, Integer columnSize, + Integer columnDecimalDigits) {// createColumnInfo() + return new ColumnInfo(this, columnDbName, propertyName, propertyType, + primary, columnSize, columnDecimalDigits); + } + + protected ColumnInfo cci(String columnDbName, String propertyName, + Class<?> propertyType, boolean primary, Integer columnSize, + Integer columnDecimalDigits, OptimisticLockType optimisticLockType) {// createColumnInfo + // ( + // ) + return new ColumnInfo(this, columnDbName, propertyName, propertyType, + primary, columnSize, columnDecimalDigits, optimisticLockType); + } + + /** + * The implementation. + * + * @return The list of columns. (NotNull and NotEmpty) + */ + public List<ColumnInfo> getColumnInfoList() { + if (_columnInfoList != null) { + return _columnInfoList; + } + synchronized (this) { + if (_columnInfoList != null) { + return _columnInfoList; + } + Method[] methods = this.getClass().getMethods(); + _columnInfoList = newArrayList(); + String prefix = "column"; + Class<ColumnInfo> returnType = ColumnInfo.class; + Object[] args = new Object[] {}; + try { + for (Method method : methods) { + if (method.getName().startsWith(prefix) + && returnType.equals(method.getReturnType())) { + _columnInfoList.add((ColumnInfo) method.invoke(this, + args)); + } + } + } catch (Exception e) { + throw new IllegalStateException(e); + } + return _columnInfoList; + } + } + + protected void initializeColumnInfoList() { + getColumnInfoList();// Ignore return value because of initialization + // only! + } + + //========================================================================== + // =========== + // Name Handling + // ============= + /** + * The implementation. + * + * @param flexibleName Flexible-name(IgnoreCase). (NotNull and 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; + } + + /** + * The implementation. + * + * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @return DB name. (NotNull and NotEmpty) + */ + public String findDbName(String flexibleName) { + final String key = flexibleName.toLowerCase(); + if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { + return (String) getPropertyNameDbNameKeyToLowerMap().get(key); + } + if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { + final String dbNameKeyToLower = ((String) getDbNamePropertyNameKeyToLowerMap() + .get(key)).toLowerCase(); + if (getPropertyNameDbNameKeyToLowerMap().containsKey( + dbNameKeyToLower)) { + return (String) getPropertyNameDbNameKeyToLowerMap().get( + dbNameKeyToLower); + } + } + String msg = "Not found object by the flexible name: flexibleName=" + + flexibleName; + throw new IllegalStateException(msg); + } + + /** + * The implementation. + * + * @param flexibleName Flexible-name(IgnoreCase). (NotNull and NotEmpty) + * @return DB name. (NotNull and NotEmpty) + */ + public String findPropertyName(String flexibleName) { + final String key = flexibleName.toLowerCase(); + if (getDbNamePropertyNameKeyToLowerMap().containsKey(key)) { + return (String) getDbNamePropertyNameKeyToLowerMap().get(key); + } + if (getPropertyNameDbNameKeyToLowerMap().containsKey(key)) { + final String dbNameToLower = ((String) getPropertyNameDbNameKeyToLowerMap() + .get(key)).toLowerCase(); + if (getDbNamePropertyNameKeyToLowerMap().containsKey(dbNameToLower)) { + return (String) getDbNamePropertyNameKeyToLowerMap().get( + dbNameToLower); + } + } + String msg = "Not found object by the flexible name: flexibleName=" + + flexibleName; + throw new IllegalStateException(msg); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + protected UniqueInfo createPrimaryUniqueInfo() { + UniqueInfo uniqueInfo = new UniqueInfo(); + uniqueInfo.setDBMeta(this); + uniqueInfo.setPrimary(true); + return uniqueInfo; + } + + protected UniqueInfo createPrimaryUniqueInfo(ColumnInfo uniqueColumnInfo) { + UniqueInfo uniqueInfo = new UniqueInfo(); + uniqueInfo.setDBMeta(this); + uniqueInfo.setPrimary(true); + uniqueInfo.addUniqueColumnList(uniqueColumnInfo); + return uniqueInfo; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + /** + * @param relationPropertyName Relation property name. (Both OK - InitCap or + * not). (NotNull) + * @return The information of relation. (NotNull) + */ + public RelationInfo findRelationInfo(String relationPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("relationPropertyName", + relationPropertyName); + return hasForeign(relationPropertyName) ? (RelationInfo) findForeignInfo(relationPropertyName) + : (RelationInfo) findReferrerInfo(relationPropertyName); + } + + // ----------------------------------------------------- + // Foreign Element + // --------------- + /** + * @param foreignPropertyName The property name of foreign. (Both OK - + * InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasForeign(String foreignPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("foreignPropertyName", + foreignPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "foreign", foreignPropertyName); + return hasMethod(methodName); + } + + /** + * @param foreignPropertyName The property name of foreign. (Both OK - + * InitCap or not). (NotNull) + * @return Foreign DBMeta. (NotNull) + */ + public DBMeta findForeignDBMeta(String foreignPropertyName) { + return findForeignInfo(foreignPropertyName).getForeignDBMeta(); + } + + /** + * @param foreignPropertyName The property name of foreign. (Both OK - + * InitCap or not). (NotNull) + * @return Foreign information. (NotNull) + */ + public jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo findForeignInfo( + String foreignPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("foreignPropertyName", + foreignPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "foreign", foreignPropertyName); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "Not found foreign by foreignPropertyName: foreignPropertyName=" + + foreignPropertyName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + return (ForeignInfo) method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + protected ForeignInfo cfi(String propName, DBMeta localDbm, + DBMeta foreignDbm, + Map<ColumnInfo, ColumnInfo> localForeignColumnInfoMap, int relNo, + boolean oneToOne) {// createForeignInfo() + final ForeignInfo foreignInfo = new ForeignInfo(); + foreignInfo.setForeignPropertyName(propName); + foreignInfo.setLocalDBMeta(localDbm); + foreignInfo.setForeignDBMeta(foreignDbm); + foreignInfo.setLocalForeignColumnInfoMap(localForeignColumnInfoMap); + foreignInfo.setRelationNo(relNo); + foreignInfo.setOneToOne(oneToOne); + return foreignInfo; + } + + // ----------------------------------------------------- + // Referrer Element + // ---------------- + /** + * @param referrerPropertyName The property name of referrer. (Both OK - + * InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasReferrer(String referrerPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", + referrerPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "referrer", referrerPropertyName); + return hasMethod(methodName); + } + + /** + * @param referrerPropertyName The property name of referrer. (Both OK - + * InitCap or not). (NotNull) + * @return Referrer DBMeta. (NotNull) + */ + public DBMeta findReferrerDBMeta(String referrerPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", + referrerPropertyName); + return findReferrerInfo(referrerPropertyName).getReferrerDBMeta(); + } + + /** + * @param referrerPropertyName The property name of referrer. (Both OK - + * InitCap or not). (NotNull) + * @return Referrer information. (NotNull) + */ + public ReferrerInfo findReferrerInfo(String referrerPropertyName) { + assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", + referrerPropertyName); + final String methodName = buildRelationInfoGetterMethodNameInitCap( + "referrer", referrerPropertyName); + java.lang.reflect.Method method = null; + try { + method = this.getClass().getMethod(methodName, new Class[] {}); + } catch (NoSuchMethodException e) { + String msg = "Not found referrer by referrerPropertyName: referrerPropertyName=" + + referrerPropertyName; + msg = msg + " tableName=" + getTableDbName() + " methodName=" + + methodName; + throw new RuntimeException(msg, e); + } + try { + return (ReferrerInfo) method.invoke(this, new Object[] {}); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e.getCause()); + } + } + + protected ReferrerInfo cri(String propName, DBMeta localDbm, + DBMeta referrerDbm, + Map<ColumnInfo, ColumnInfo> localReferrerColumnInfoMap, + boolean oneToOne) {// createReferrerInfo() + final ReferrerInfo referrerInfo = new ReferrerInfo(); + referrerInfo.setReferrerPropertyName(propName); + referrerInfo.setLocalDBMeta(localDbm); + referrerInfo.setReferrerDBMeta(referrerDbm); + referrerInfo.setLocalReferrerColumnInfoMap(localReferrerColumnInfoMap); + referrerInfo.setOneToOne(oneToOne); + return referrerInfo; + } + + // ----------------------------------------------------- + // Common Logic + // ------------ + protected String buildRelationInfoGetterMethodNameInitCap( + String targetName, String relationPropertyName) { + return targetName + relationPropertyName.substring(0, 1).toUpperCase() + + relationPropertyName.substring(1); + } + + // ----------------------------------------------------- + // Relation Trace + // -------------- + /** + * Relation trace. + */ + protected static abstract class AbstractRelationTrace implements + RelationTrace { + + /** The list of relation. */ + protected List<RelationInfo> _relationList; + + /** The list of relation trace. */ + protected List<AbstractRelationTrace> _relationTraceList; + + /** The list of relation info as trace. */ + protected List<RelationInfo> _traceRelationInfoList; + + /** The column info as trace. */ + protected ColumnInfo _traceColumnInfo; + + /** The handler of fixed relation trace. */ + protected RelationTraceFixHandler _relationTraceFixHandler; + + /** + * Constructor for first step. + * + * @param relationTraceFixHandler The handler of fixed relation trace. + * (Nullable) + */ + public AbstractRelationTrace( + RelationTraceFixHandler relationTraceFixHandler) { + this(new ArrayList<RelationInfo>(), + new ArrayList<AbstractRelationTrace>()); + this._relationTraceFixHandler = relationTraceFixHandler; + } + + /** + * Constructor for relation step. + * + * @param relationList The list of relation. (NotNull) + * @param relationTraceList The list of relation trace. (NotNull) + */ + public AbstractRelationTrace(List<RelationInfo> relationList, + List<AbstractRelationTrace> relationTraceList) { + this._relationList = relationList; + this._relationTraceList = relationTraceList; + this._relationTraceList.add(this); + } + + /** + * The implementation. + * + * @return The trace of relation as the list of relation info. (NotNull) + */ + public List<RelationInfo> getTraceRelation() { + return _traceRelationInfoList; + } + + /** + * The implementation. + * + * @return The trace of column as column info. (Nullable) + */ + public ColumnInfo getTraceColumn() { + return _traceColumnInfo; + } + + /** + * Fix trace. + * + * @param traceRelationInfoList The trace of relation as the list of + * relation info. (NotNull) + * @param traceColumnInfo The trace of column as column info. (Nullable) + * @return Relation trace(result). (NotNull) + */ + protected RelationTrace fixTrace( + List<RelationInfo> traceRelationInfoList, + ColumnInfo traceColumnInfo) { + final AbstractRelationTrace localRelationTrace = (AbstractRelationTrace) _relationTraceList + .get(0); + localRelationTrace.setTraceRelation(traceRelationInfoList); + localRelationTrace.setTraceColumn(traceColumnInfo); + localRelationTrace.recycle(); + localRelationTrace.handleFixedRelationTrace(); + return localRelationTrace; + } + + protected void setTraceRelation(List<RelationInfo> traceRelationInfoList) { + this._traceRelationInfoList = traceRelationInfoList; + } + + protected void setTraceColumn(ColumnInfo traceColumn) { + this._traceColumnInfo = traceColumn; + } + + /** + * The implementation. + */ + protected void recycle() { + this._relationList = new ArrayList<RelationInfo>(); + this._relationTraceList = new ArrayList<AbstractRelationTrace>(); + this._relationTraceList.add(this); + } + + protected void handleFixedRelationTrace() { + if (_relationTraceFixHandler != null) { + _relationTraceFixHandler.handleFixedTrace(this); + } + } + } + + //========================================================================== + // ========= + // Map String + // ========== + /** + * The implementation. + * + * @return Map list string that is prepared. (NotNull) + */ + public MapListString createMapListString() { + return MapStringUtil.createMapListString(); + } + + /** + * The implementation. + * + * @return Map string builder that is prepared. (NotNull) + */ + public MapStringBuilder createMapStringBuilder() { + final List<String> columnDbNameList = new ArrayList<String>(); + for (final Iterator<ColumnInfo> ite = getColumnInfoList().iterator(); ite + .hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + columnDbNameList.add(columnInfo.getColumnDbName()); + } + return MapStringUtil.createMapStringBuilder(columnDbNameList); + } + + //========================================================================== + // ========= + // Various Info + // ============ + // These methods is expected to override if it needs. + public boolean hasSequence() { + return false; + } + + public String getSequenceNextValSql() { + return null; + } + + public boolean hasVersionNo() { + return false; + } + + public ColumnInfo getVersionNoColumnInfo() { + return null; + } + + public boolean hasUpdateDate() { + return false; + } + + public ColumnInfo getUpdateDateColumnInfo() { + return null; + } + + public boolean hasCommonColumn() { + return false; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + protected <ENTITY extends Entity> void doAcceptPrimaryKeyMap(ENTITY entity, + Map<String, ? extends Object> columnValueMap, + Map<String, Eps<ENTITY>> entityPropertySetupperMap) { + MapAssertUtil.assertColumnValueMapNotNullAndNotEmpty(columnValueMap); + MapStringValueAnalyzer analyzer = new MapStringValueAnalyzer( + columnValueMap, entity.getModifiedPropertyNames()); + List<ColumnInfo> columnInfoList = getPrimaryUniqueInfo() + .getUniqueColumnList(); + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + String propertyName = columnInfo.getPropertyName(); + String uncapPropName = initUncap(propertyName); + Class<?> propertyType = columnInfo.getPropertyType(); + if (analyzer.init(columnName, uncapPropName, propertyName)) { + final Object value; + if (String.class.isAssignableFrom(propertyType)) { + value = analyzer.analyzeString(propertyType); + } else if (Number.class.isAssignableFrom(propertyType)) { + value = analyzer.analyzeNumber(propertyType); + } else if (java.util.Date.class.isAssignableFrom(propertyType)) { + value = analyzer.analyzeDate(propertyType); + } else { + value = analyzer.analyzeOther(propertyType); + } + findEps(entityPropertySetupperMap, propertyName).setup(entity, + value); + } + } + } + + protected <ENTITY extends Entity> void doAcceptColumnValueMap( + ENTITY entity, Map<String, ? extends Object> columnValueMap, + Map<String, Eps<ENTITY>> entityPropertySetupperMap) { + MapAssertUtil.assertColumnValueMapNotNullAndNotEmpty(columnValueMap); + MapStringValueAnalyzer analyzer = new MapStringValueAnalyzer( + columnValueMap, entity.getModifiedPropertyNames()); + List<ColumnInfo> columnInfoList = getColumnInfoList(); + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + String propertyName = columnInfo.getPropertyName(); + String uncapPropName = initUncap(propertyName); + Class<?> propertyType = columnInfo.getPropertyType(); + if (analyzer.init(columnName, uncapPropName, propertyName)) { + final Object value; + if (String.class.isAssignableFrom(propertyType)) { + value = analyzer.analyzeString(propertyType); + } else if (Number.class.isAssignableFrom(propertyType)) { + value = analyzer.analyzeNumber(propertyType); + } else if (java.util.Date.class.isAssignableFrom(propertyType)) { + value = analyzer.analyzeDate(propertyType); + } else { + value = analyzer.analyzeOther(propertyType); + } + findEps(entityPropertySetupperMap, propertyName).setup(entity, + value); + } + } + } + + protected String doExtractPrimaryKeyMapString(Entity entity, + String startBrace, String endBrace, String delimiter, String equal) { + String mapMarkAndStartBrace = MAP_STRING_MAP_MARK + startBrace; + StringBuilder sb = new StringBuilder(); + List<ColumnInfo> columnInfoList = getPrimaryUniqueInfo() + .getUniqueColumnList(); + try { + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + Method getterMethod = columnInfo.findGetter(); + Object value = getterMethod.invoke(entity, (Object[]) null); + helpAppendingColumnValueString(sb, delimiter, equal, + columnName, value); + } + } catch (Exception e) { + throw new IllegalStateException(e); + } + sb.delete(0, delimiter.length()).insert(0, mapMarkAndStartBrace) + .append(endBrace); + return sb.toString(); + } + + protected String doExtractColumnValueMapString(Entity entity, + String startBrace, String endBrace, String delimiter, String equal) { + String mapMarkAndStartBrace = MAP_STRING_MAP_MARK + startBrace; + StringBuilder sb = new StringBuilder(); + List<ColumnInfo> columnInfoList = getColumnInfoList(); + try { + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + Method getterMethod = columnInfo.findGetter(); + Object value = getterMethod.invoke(entity, (Object[]) null); + helpAppendingColumnValueString(sb, delimiter, equal, + columnName, value); + } + } catch (Exception e) { + throw new IllegalStateException(e); + } + sb.delete(0, delimiter.length()).insert(0, mapMarkAndStartBrace) + .append(endBrace); + return sb.toString(); + } + + // ----------------------------------------------------- + // Convert + // ------- + protected Map<String, Object> doConvertToColumnValueMap(Entity entity) { + Map<String, Object> valueMap = newLinkedHashMap(); + try { + List<ColumnInfo> columnInfoList = getColumnInfoList(); + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + Method getterMethod = columnInfo.findGetter(); + Object value = getterMethod.invoke(entity, (Object[]) null); + valueMap.put(columnName, value); + } + } catch (Exception e) { + throw new IllegalStateException(e); + } + return valueMap; + } + + protected Map<String, String> doConvertToColumnStringValueMap(Entity entity) { + Map<String, String> valueMap = newLinkedHashMap(); + try { + List<ColumnInfo> columnInfoList = getColumnInfoList(); + for (ColumnInfo columnInfo : columnInfoList) { + String columnName = columnInfo.getColumnDbName(); + Method getterMethod = columnInfo.findGetter(); + Object value = getterMethod.invoke(entity, (Object[]) null); + valueMap.put(columnName, helpGettingColumnStringValue(value)); + } + } catch (Exception e) { + throw new IllegalStateException(e); + } + return valueMap; + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected <ENTITY extends Entity> void setupEps( + Map<String, Eps<ENTITY>> entityPropertySetupperMap, + Eps<ENTITY> setupper, ColumnInfo columnInfo) { + String columnName = columnInfo.getColumnDbName(); + String propertyName = columnInfo.getPropertyName(); + registerEntityPropertySetupper(columnName, propertyName, setupper, + entityPropertySetupperMap); + } + + protected <ENTITY extends Entity> void registerEntityPropertySetupper( + String columnName, String propertyName, Eps<ENTITY> setupper, + Map<String, Eps<ENTITY>> entityPropertySetupperMap) { + 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( + Map<String, Eps<ENTITY>> entityPropertySetupperMap, + String propertyName) { + Eps<ENTITY> setupper = entityPropertySetupperMap.get(propertyName); + if (setupper == null) { + String msg = "The propertyName was Not Found in the map of setupper of entity property:"; + msg = msg + " propertyName=" + propertyName + + " _entityPropertySetupperMap.keySet()=" + + entityPropertySetupperMap.keySet(); + throw new IllegalStateException(msg); + } + return setupper; + } + + //========================================================================== + // ========= + // Util Class + // ========== + /** + * This class is for Internal. Don't use this! + */ + protected static class MapStringUtil { + + public static void acceptPrimaryKeyMapString( + String primaryKeyMapString, Entity entity) { + if (primaryKeyMapString == null) { + String msg = "The argument[primaryKeyMapString] should not be null."; + throw new IllegalArgumentException(msg); + } + final String prefix = MAP_STRING_MAP_MARK + MAP_STRING_START_BRACE; + final String suffix = MAP_STRING_END_BRACE; + if (!primaryKeyMapString.trim().startsWith(prefix)) { + primaryKeyMapString = prefix + primaryKeyMapString; + } + if (!primaryKeyMapString.trim().endsWith(suffix)) { + primaryKeyMapString = primaryKeyMapString + suffix; + } + MapListString mapListString = createMapListString(); + entity.getDBMeta().acceptPrimaryKeyMap(entity, + mapListString.generateMap(primaryKeyMapString)); + } + + public static void acceptColumnValueMapString( + String columnValueMapString, Entity entity) { + if (columnValueMapString == null) { + String msg = "The argument[columnValueMapString] should not be null."; + throw new IllegalArgumentException(msg); + } + final String prefix = MAP_STRING_MAP_MARK + MAP_STRING_START_BRACE; + final String suffix = MAP_STRING_END_BRACE; + if (!columnValueMapString.trim().startsWith(prefix)) { + columnValueMapString = prefix + columnValueMapString; + } + if (!columnValueMapString.trim().endsWith(suffix)) { + columnValueMapString = columnValueMapString + suffix; + } + MapListString mapListString = createMapListString(); + entity.getDBMeta().acceptColumnValueMap(entity, + mapListString.generateMap(columnValueMapString)); + } + + public static String extractPrimaryKeyMapString(Entity entity) { + final String startBrace = MAP_STRING_START_BRACE; + final String endBrace = MAP_STRING_END_BRACE; + final String delimiter = MAP_STRING_DELIMITER; + final String equal = MAP_STRING_EQUAL; + return entity.getDBMeta().extractPrimaryKeyMapString(entity, + startBrace, endBrace, delimiter, equal); + } + + public static String extractColumnValueMapString(Entity entity) { + final String startBrace = MAP_STRING_START_BRACE; + final String endBrace = MAP_STRING_END_BRACE; + final String delimiter = MAP_STRING_DELIMITER; + final String equal = MAP_STRING_EQUAL; + return entity.getDBMeta().extractColumnValueMapString(entity, + startBrace, endBrace, delimiter, equal); + } + + public static void checkTypeString(Object value, String propertyName, + String typeName) { + if (value == null) { + throw new IllegalArgumentException( + "The value should not be null: " + propertyName); + } + if (!(value instanceof String)) { + String msg = "The value of " + propertyName + " should be " + + typeName + " or String: "; + msg = msg + "valueType=" + value.getClass() + " value=" + value; + throw new IllegalArgumentException(msg); + } + } + + public static long parseDateStringAsMillis(Object value, + String propertyName, String typeName) { + checkTypeString(value, propertyName, typeName); + try { + final String valueString = filterTimestampValue(((String) value) + .trim()); + return java.sql.Timestamp.valueOf(valueString).getTime(); + } catch (RuntimeException e) { + String msg = "The value of " + propertyName + " should be " + + typeName + ". but: " + value; + throw new RuntimeException(msg + + " threw the exception: value=[" + value + "]", e); + } + } + + public static String filterTimestampValue(String value) { + value = value.trim(); + if (value.indexOf("/") == 4 && value.lastIndexOf("/") == 7) { + value = value.replaceAll("/", "-"); + } + if (value.indexOf("-") == 4 && value.lastIndexOf("-") == 7) { + if (value.length() == "2007-07-09".length()) { + value = value + " 00:00:00"; + } + } + return value; + } + + public static String formatDate(java.util.Date value) { + return getFormatDateFormat().format(value); + } + + public static String formatTimestamp(java.sql.Timestamp value) { + return getFormatDateFormat().format(value); + } + + public static java.text.DateFormat getParseDateFormat() { + return java.text.DateFormat.getDateInstance(); + } + + public static java.text.DateFormat getFormatDateFormat() { + return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + } + + public static MapListString createMapListString() { + final MapListString mapListString = new MapListStringImpl(); + mapListString.setMapMark(MAP_STRING_MAP_MARK); + mapListString.setListMark(MAP_STRING_LIST_MARK); + mapListString.setStartBrace(MAP_STRING_START_BRACE); + mapListString.setEndBrace(MAP_STRING_END_BRACE); + mapListString.setEqual(MAP_STRING_EQUAL); + mapListString.setDelimiter(MAP_STRING_DELIMITER); + return mapListString; + } + + public static MapStringBuilder createMapStringBuilder( + List<String> columnNameList) { + MapStringBuilder mapStringBuilder = new MapStringBuilderImpl(); + mapStringBuilder.setMsMapMark(MAP_STRING_MAP_MARK); + mapStringBuilder.setMsStartBrace(MAP_STRING_START_BRACE); + mapStringBuilder.setMsEndBrace(MAP_STRING_END_BRACE); + mapStringBuilder.setMsEqual(MAP_STRING_EQUAL); + mapStringBuilder.setMsDelimiter(MAP_STRING_DELIMITER); + mapStringBuilder.setColumnNameList(columnNameList); + return mapStringBuilder; + } + } + + /** + * This class is for Internal. Don't use this! + */ + protected static class MapAssertUtil { + public static void assertPrimaryKeyMapNotNullAndNotEmpty( + java.util.Map<String, ? extends Object> primaryKeyMap) { + if (primaryKeyMap == null) { + String msg = "The argument[primaryKeyMap] should not be null."; + throw new IllegalArgumentException(msg); + } + if (primaryKeyMap.isEmpty()) { + String msg = "The argument[primaryKeyMap] should not be empty."; + throw new IllegalArgumentException(msg); + } + } + + public static void assertColumnExistingInPrimaryKeyMap( + java.util.Map<String, ? extends Object> primaryKeyMap, + String columnName) { + if (!primaryKeyMap.containsKey(columnName)) { + String msg = "The primaryKeyMap must have the value of " + + columnName; + throw new IllegalStateException(msg + ": primaryKeyMap --> " + + primaryKeyMap); + } + } + + public static void assertColumnValueMapNotNullAndNotEmpty( + java.util.Map<String, ? extends Object> columnValueMap) { + if (columnValueMap == null) { + String msg = "The argument[columnValueMap] should not be null."; + throw new IllegalArgumentException(msg); + } + if (columnValueMap.isEmpty()) { + String msg = "The argument[columnValueMap] should not be empty."; + throw new IllegalArgumentException(msg); + } + } + } + + /** + * This class is for Internal. Don't use this! + */ + protected static class MapStringValueAnalyzer { + protected java.util.Map<String, ? extends Object> _valueMap; + + protected java.util.Set<String> _modifiedPropertyNames; + + protected String _columnName; + + protected String _uncapPropName; + + protected String _propertyName; + + public MapStringValueAnalyzer( + java.util.Map<String, ? extends Object> valueMap, + java.util.Set<String> modifiedPropertyNames) { + this._valueMap = valueMap; + this._modifiedPropertyNames = modifiedPropertyNames; + } + + public boolean init(String columnName, String uncapPropName, + String propertyName) { + this._columnName = columnName; + this._uncapPropName = uncapPropName; + this._propertyName = propertyName; + return _valueMap.containsKey(_columnName); + } + + public <COLUMN_TYPE> COLUMN_TYPE analyzeString( + Class<COLUMN_TYPE> javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + helpCheckingTypeString(obj, _uncapPropName, javaType.getName()); + return (COLUMN_TYPE) obj; + } + + public <COLUMN_TYPE> COLUMN_TYPE analyzeNumber( + Class<COLUMN_TYPE> javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + if (javaType.isAssignableFrom(obj.getClass())) { + return (COLUMN_TYPE) obj; + } + return (COLUMN_TYPE) newInstanceByConstructor(javaType, + String.class, obj.toString()); + } + + public <COLUMN_TYPE> COLUMN_TYPE analyzeDate(Class<COLUMN_TYPE> javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + if (javaType.isAssignableFrom(obj.getClass())) { + return (COLUMN_TYPE) obj; + } + return (COLUMN_TYPE) newInstanceByConstructor(javaType, long.class, + helpParsingDateString(obj, _uncapPropName, javaType + .getName())); + } + + public <COLUMN_TYPE> COLUMN_TYPE analyzeOther( + Class<COLUMN_TYPE> javaType) { + final Object obj = _valueMap.get(_columnName); + if (obj == null) { + _modifiedPropertyNames.remove(_propertyName); + return null; + } + return (COLUMN_TYPE) obj; + } + + private void helpCheckingTypeString(Object value, String uncapPropName, + String typeName) { + MapStringUtil.checkTypeString(value, uncapPropName, typeName); + } + + private long helpParsingDateString(Object value, String uncapPropName, + String typeName) { + return MapStringUtil.parseDateStringAsMillis(value, uncapPropName, + typeName); + } + + protected Object newInstanceByConstructor(Class targetType, + Class argType, Object arg) { + java.lang.reflect.Constructor constructor; + try { + constructor = targetType + .getConstructor(new Class[] { argType }); + } catch (SecurityException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (NoSuchMethodException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } + try { + return constructor.newInstance(new Object[] { arg }); + } catch (IllegalArgumentException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (InstantiationException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (IllegalAccessException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } catch (java.lang.reflect.InvocationTargetException e) { + String msg = "targetType=" + targetType + " argType=" + argType + + " arg=" + arg; + throw new RuntimeException(msg, e); + } + } + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected <ENTITY> ENTITY downcast(Entity entity) { + checkDowncast(entity); + return (ENTITY) entity; + } + + protected void checkDowncast(Entity entity) { + assertObjectNotNull("entity", entity); + Class<? extends Entity> entityType = getEntityType(); + Class<? extends Entity> targetType = entity.getClass(); + if (!entityType.isAssignableFrom(targetType)) { + String name = entityType.getSimpleName(); + String msg = "The entity should be " + name + " but it was: " + + targetType; + throw new IllegalStateException(msg); + } + } + + protected void helpAppendingColumnValueString(StringBuilder sb, + String delimiter, String equal, String colName, Object value) { + sb.append(delimiter).append(colName).append(equal); + sb.append(helpGettingColumnStringValue(value)); + } + + protected String helpGettingColumnStringValue(Object value) { + if (value instanceof java.sql.Timestamp) { + return (value != null ? helpFormatingTimestamp((java.sql.Timestamp) value) + : ""); + } else if (value instanceof java.util.Date) { + return (value != null ? helpFormatingDate((java.util.Date) value) + : ""); + } else { + return (value != null ? value.toString() : ""); + } + } + + protected String helpFormatingDate(java.util.Date date) { + return MapStringUtil.formatDate(date); + } + + protected String helpFormatingTimestamp(java.sql.Timestamp timestamp) { + return MapStringUtil.formatTimestamp(timestamp); + } + + protected Map<String, String> setupKeyToLowerMap(boolean dbNameKey) { + final Map<String, String> map; + if (dbNameKey) { + map = newLinkedHashMap(getTableDbName().toLowerCase(), + getTablePropertyName()); + } else { + map = newLinkedHashMap(getTablePropertyName().toLowerCase(), + getTableDbName()); + } + Method[] methods = this.getClass().getMethods(); + String columnInfoMethodPrefix = "column"; + try { + for (Method method : methods) { + String name = method.getName(); + if (!name.startsWith(columnInfoMethodPrefix)) { + continue; + } + ColumnInfo columnInfo = (ColumnInfo) method.invoke(this); + String dbName = columnInfo.getColumnDbName(); + String propertyName = columnInfo.getPropertyName(); + if (dbNameKey) { + map.put(dbName.toLowerCase(), propertyName); + } else { + map.put(propertyName.toLowerCase(), dbName); + } + } + return Collections.unmodifiableMap(map); + } catch (Exception e) { + throw new IllegalStateException(e); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + // ----------------------------------------------------- + // String Handling + // --------------- + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + protected String initCap(String str) { + return SimpleStringUtil.initCap(str); + } + + protected String initUncap(String str) { + return SimpleStringUtil.initUncap(str); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + // ----------------------------------------------------- + // Collection Generator + // -------------------- + protected <KEY, VALUE> HashMap<KEY, VALUE> newHashMap() { + return new HashMap<KEY, VALUE>(); + } + + protected <KEY, VALUE> LinkedHashMap<KEY, VALUE> newLinkedHashMap() { + return new LinkedHashMap<KEY, VALUE>(); + } + + protected <KEY, VALUE> LinkedHashMap<KEY, VALUE> newLinkedHashMap(KEY key, + VALUE value) { + LinkedHashMap<KEY, VALUE> map = newLinkedHashMap(); + map.put(key, value); + return map; + } + + protected <ELEMENT> ArrayList<ELEMENT> newArrayList() { + return new ArrayList<ELEMENT>(); + } + + protected <ELEMENT> ArrayList<ELEMENT> newArrayList( + Collection<ELEMENT> collection) { + return new ArrayList<ELEMENT>(collection); + } + + // ----------------------------------------------------- + // Reflection Handling + // ------------------- + private Set<String> _cachedMethodNames = new HashSet<String>(); // for + + // performance + + protected boolean hasMethod(String methodName) { + assertStringNotNullAndNotTrimmedEmpty("methodName", methodName); + if (_cachedMethodNames.isEmpty()) { + synchronized (_cachedMethodNames) { + if (_cachedMethodNames.isEmpty()) { + final Method[] methods = this.getClass().getMethods(); + for (Method method : methods) { + _cachedMethodNames.add(method.getName()); + } + } + } + } + return _cachedMethodNames.contains(methodName); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the argument is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertObjectNotNull(String variableName, Object value) { + SimpleAssertUtil.assertObjectNotNull(variableName, value); + } + + // ----------------------------------------------------- + // Assert String + // ------------- + /** + * Assert that the string is not null and not trimmed empty. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + */ + protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, + String value) { + SimpleAssertUtil.assertStringNotNullAndNotTrimmedEmpty(variableName, + value); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/AbstractDBMeta.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMeta.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMeta.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMeta.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,601 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.RelationInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.MapListString; +import jp.sf.pal.scheduler.db.allcommon.helper.MapStringBuilder; + +/** + * The interface of DB meta. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface DBMeta { + + //========================================================================== + // ========= + // 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 Info + // ========== + /** + * Get table db-name. + * + * @return Table db-name. (NotNull) + */ + public String getTableDbName(); + + /** + * Get table property-name(JavaBeansRule). + * + * @return Table property-name(JavaBeansRule). (NotNull) + */ + public String getTablePropertyName(); + + /** + * Get table SQL-name. + * + * @return Table SQL-name. (NotNull) + */ + public String getTableSqlName(); + + //========================================================================== + // ========= + // Name Handling + // ============= + /** + * Has object of flexible name? {Target objects are TABLE and COLUMN} + * + * @param flexibleName The flexible name. (NotNull and NotEmpty) + * @return Determination. + */ + public boolean hasFlexibleName(String flexibleName); + + /** + * 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) + */ + public String findDbName(String flexibleName); + + /** + * Find property name(JavaBeansRule) by flexible name. {Target objects are + * TABLE and COLUMN} + * + * @param flexibleName The flexible name. (NotNull and NotEmpty) + * @return Db name. (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. + * + * @return The type-name of entity. (NotNull) + */ + public String getEntityTypeName(); + + /** + * Get the type-name of 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. + * + * @return The type-name of dao. (Nullable: If the dao does not exist) + */ + public String getDaoTypeName(); + + /** + * Get the type-name of behavior. + * + * @return The type-name of behavior. (Nullable: If the behavior does not + * exist) + */ + public String getBehaviorTypeName(); + + //========================================================================== + // ========= + // Object Type + // =========== + /** + * Get the type of entity. + * + * @return The type of entity. (NotNull) + */ + public Class<? extends Entity> getEntityType(); + + //========================================================================== + // ========= + // Object Instance + // =============== + /** + * New the instance of entity. + * + * @return The instance of entity. (NotNull) + */ + public Entity newEntity(); + + //========================================================================== + // ========= + // Column Info + // =========== + /** + * @return The list of DB name of column. (NotNull and NotEmpty) + */ + public List<ColumnInfo> getColumnInfoList(); + + /** + * Has column? + * + * @param columnFlexibleName The flexible name of the column. (NotNull) + * @return Determination. + */ + public boolean hasColumn(String columnFlexibleName); + + /** + * Find the information of the column by the flexible name of the column. + * + * <pre> + * If the table name is 'BOOK_ID', you can find the dbmeta by ...(as follows) + * 'BOOK_ID', 'BOok_iD', 'book_id' + * , 'BookId', 'bookid', 'bOoKiD' + * </pre> + * + * @param columnFlexibleName The flexible name of the column. (NotNull) + * @return The information of the column. (NotNull) + */ + public ColumnInfo findColumnInfo(String columnFlexibleName); + + //========================================================================== + // ========= + // Unique Info + // =========== + /** + * Get primary unique info. + * + * @return Primary unique info. (NotNull) + */ + public UniqueInfo getPrimaryUniqueInfo(); + + /** + * Has primary-key? + * + * @return Determination. + */ + public boolean hasPrimaryKey(); + + /** + * Has two or more primary-keys? + * + * @return Determination. + */ + public boolean hasTwoOrMorePrimaryKeys(); + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Relation Element + // ---------------- + /** + * Find relation info. + * + * @param relationPropertyName Relation property name. (Both OK - InitCap or + * not). (NotNull) + * @return Relation info. (NotNull) + */ + public RelationInfo findRelationInfo(String relationPropertyName); + + // ----------------------------------------------------- + // Foreign Element + // --------------- + /** + * Has foreign? + * + * @param foreignPropName Foreign property name. (Both OK - InitCap or not). + * (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasForeign(String foreignPropName); + + /** + * Find foreign dbmeta. + * + * @param foreignPropName Foreign property name. (Both OK - InitCap or not). + * (NotNull) + * @return Foreign DBMeta. (NotNull) + */ + public DBMeta findForeignDBMeta(String foreignPropName); + + /** + * Find foreign info. + * + * @param foreignPropName Foreign property name. (Both OK - InitCap or not). + * (NotNull) + * @return Foreign info. (NotNull) + */ + public ForeignInfo findForeignInfo(String foreignPropName); + + // ----------------------------------------------------- + // Referrer Element + // ---------------- + /** + * Has referrer? + * + * @param referrerPropertyName The property name of referrer. (Both OK - + * InitCap or not). (NotNull) + * @return Determination. (NotNull) + */ + public boolean hasReferrer(String referrerPropertyName); + + /** + * Find referrer dbmeta. + * + * @param referrerPropertyName The property name of referrer. (Both OK - + * InitCap or not). (NotNull) + * @return Referrer DBMeta. (NotNull) + */ + public DBMeta findReferrerDBMeta(String referrerPropertyName); + + /** + * Find referrer information. + * + * @param referrerPropertyName The property name of referrer. (Both OK - + * InitCap or not). (NotNull) + * @return Referrer information. (NotNull) + */ + public ReferrerInfo findReferrerInfo(String referrerPropertyName); + + // ----------------------------------------------------- + // Relation Trace + // -------------- + /** + * Relation trace. + */ + public static interface RelationTrace { + + /** + * Get the trace of relation. + * + * @return The trace of relation as the list of relation info. (NotNull) + */ + public List<RelationInfo> getTraceRelation(); + + /** + * Get the trace of column. + * + * @return The trace of column as column info. (Nullable) + */ + public ColumnInfo getTraceColumn(); + } + + public static interface RelationTraceFixHandler { + public void handleFixedTrace(RelationTrace relationTrace); + } + + //========================================================================== + // ========= + // Sequence Info + // ============= + /** + * Has sequence? + * + * @return Determination. + */ + public boolean hasSequence(); + + /** + * Get the SQL string for getting next value of sequence. + * + * @return The SQL string for getting next value of sequence. (Nullable: If + * it does not have sequence, returns null.) + */ + public String getSequenceNextValSql(); + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + /** + * Has version no? + * + * @return Determination. + */ + public boolean hasVersionNo(); + + /** + * Get the column information of version no. + * + * @return The column information of version no. (Nullable: If it doesn't + * have the column, return null.) + */ + public ColumnInfo getVersionNoColumnInfo(); + + /** + * Has update date? + * + * @return Determination. + */ + public boolean hasUpdateDate(); + + /** + * Get the column information of update date. + * + * @return The column information of update date. (Nullable: If it doesn't + * have the column, return null.) + */ + public ColumnInfo getUpdateDateColumnInfo(); + + //========================================================================== + // ========= + // Common Column Info + // ================== + /** + * Has common column? + * + * @return Determination. + */ + public boolean hasCommonColumn(); + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + /** + * Accept primary-key map. The column that column-value map-string doesn't + * have the value of is reflected as null. The column that column-value + * map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param primaryKeyMap Primary-key map. (NotNull and NotEmpty) + */ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap); + + /** + * Accept primary-key map-string. The column that column-value map-string + * doesn't have the value of is reflected as null. The column that + * column-value map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param primaryKeyMapString Primary-key map-string. (NotNull) + */ + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString); + + /** + * Accept column-value map. The column that column-value map-string doesn't + * have the value of is reflected as null. The column that column-value + * map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param columnValueMap Column-value map. (NotNull and NotEmpty) + */ + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap); + + /** + * Accept column-value map-string. The column that column-value map-string + * doesn't have the value of is reflected as null. The column that + * column-value map-string doesn't have the key of is NOT updated nothing. + * + * @param entity Target entity. (NotNull) + * @param columnValueMapString Column-value map-string. (NotNull) + */ + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString); + + // ----------------------------------------------------- + // Extract + // ------- + /** + * Extract primary-key map-string. Delimiter is at-mark and semicolon. + * <p> + * + * <pre> + * ex) Uses that this method have. + * final String primaryKeyMapString = LdBookDbm.extractPrimaryKeyMapString(entity); + * final LdBook entity = dao.selectEntity(new LdBookCB().acceptPrimaryKeyMapString(primaryKeyMapString)); + * ... // as primary key for condition. + * </pre> + * + * @param entity Target entity. (NotNull) + * @return Primary-key map-string. (NotNull) + */ + public String extractPrimaryKeyMapString(Entity entity); + + /** + * Extract primary-key map-string. + * + * @param entity Target entity. (NotNull) + * @param startBrace Start-brace. (NotNull) + * @param endBrace End-brace. (NotNull) + * @param delimiter Delimiter. (NotNull) + * @param equal Equal. (NotNull) + * @return Primary-key map-string. (NotNull) + */ + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal); + + /** + * Extract column-value map-string. Delimiter is at-mark and semicolon. + * + * @param entity Target entity. (NotNull) + * @return Column-value map-string. (NotNull) + */ + public String extractColumnValueMapString(Entity entity); + + /** + * Extract column-value map-string. + * + * @param entity Target entity. (NotNull) + * @param startBrace Start-brace. (NotNull) + * @param endBrace End-brace. (NotNull) + * @param delimiter Delimiter. (NotNull) + * @param equal Equal. (NotNull) + * @return Column-value map-string. (NotNull) + */ + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal); + + // ----------------------------------------------------- + // Convert + // ------- + /** + * Convert entity to column value as list. + * + * @param entity Target entity. (NotNull) + * @return The list of column value. (NotNull) + */ + public List<Object> convertToColumnValueList(Entity entity); + + /** + * Convert entity to column value as map. + * + * @param entity Target entity. (NotNull) + * @return The map of column value. (NotNull) + */ + public Map<String, Object> convertToColumnValueMap(Entity entity); + + /** + * Convert entity to column string-value as list. + * + * @param entity Target entity. (NotNull) + * @return The list of column string-value. (NotNull) + */ + public List<String> convertToColumnStringValueList(Entity entity); + + /** + * Convert entity to column string-value as map. + * + * @param entity Target entity. (NotNull) + * @return The map of column string-value. (NotNull) + */ + public Map<String, String> convertToColumnStringValueMap(Entity entity); + + //========================================================================== + // ========= + // Map String + // ========== + /** + * Create map list string that is prepared. (for INTERNAL) + * + * @return Map list string that is prepared. (NotNull) + */ + public MapListString createMapListString(); + + /** + * Create map string builder that is prepared. (for INTERNAL) + * + * @return Map string builder that is prepared. (NotNull) + */ + public MapStringBuilder createMapStringBuilder(); + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + /** + * Has the setupper of entity property by the name of property? <br /> + * Comparing is so flexible. {Ignore cases and underscore} + * + * @param propertyName The name of the property. (NotNull) + * @return Determination. + */ + public boolean hasEntityPropertySetupper(String propertyName); + + /** + * Set up entity property. (for INTERNAL) + * + * @param propertyName The name of the property. (NotNull) + * @param entity The entity for the property. (NotNull) + * @param value The value of the property. (Nullable) + */ + public void setupEntityProperty(String propertyName, Object entity, + Object value); + + /** + * The setupper of entity property. <br /> This class is for Internal. Don't + * use this! + * + * @param <ENTITY_TYPE> The type of entity. + */ + public interface Eps<ENTITY_TYPE extends Entity> { + + /** + * @param entity Entity. (NotNull) + * @param value Value. (Nullable) + */ + void setup(ENTITY_TYPE entity, Object value); + } + + //========================================================================== + // ========= + // Optimistic Lock Type + // ==================== + public static enum OptimisticLockType { + NONE, VERSION_NO, UPDATE_DATE + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMeta.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMetaInstanceHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMetaInstanceHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMetaInstanceHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,260 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.util.SimpleAssertUtil; + +/** + * DBMeta instance handler. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class DBMetaInstanceHandler { + + //========================================================================== + // ========= + // Definition + // ========== + /** Table DB-name instance map. */ + protected static final Map<String, DBMeta> _tableDbNameInstanceMap = new LinkedHashMap<String, DBMeta>(); + + /** 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>(); + + tmpMap.put("GROUP_INFO", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.GroupInfoDbm"); + tmpMap.put("GROUP_MAPPING", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.GroupMappingDbm"); + tmpMap.put("ROLE_INFO", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.RoleInfoDbm"); + tmpMap.put("ROLE_MAPPING", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.RoleMappingDbm"); + tmpMap.put("ROUTINE_SCHEDULE", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.RoutineScheduleDbm"); + tmpMap + .put("ROUTINE_SCHEDULE_CONTENT", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.RoutineScheduleContentDbm"); + tmpMap + .put("ROUTINE_SCHEDULE_MAPPING", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.RoutineScheduleMappingDbm"); + tmpMap.put("SINGLE_SCHEDULE", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.SingleScheduleDbm"); + tmpMap + .put("SINGLE_SCHEDULE_CONTENT", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.SingleScheduleContentDbm"); + tmpMap + .put("SINGLE_SCHEDULE_MAPPING", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.SingleScheduleMappingDbm"); + tmpMap.put("USER_INFO", + "jp.sf.pal.scheduler.db.bsentity.dbmeta.UserInfoDbm"); + + _tableDbNameClassNameMap = Collections.unmodifiableMap(tmpMap); + } + + /** The key-to-lower map of DB-name and property-name for table. */ + protected static final Map<String, String> _tableDbNamePropertyNameKeyToLowerMap; + static { + Map<String, String> tmpMap = new LinkedHashMap<String, String>(); + + tmpMap.put("GROUP_INFO".toLowerCase(), "groupInfo"); + tmpMap.put("GROUP_MAPPING".toLowerCase(), "groupMapping"); + tmpMap.put("ROLE_INFO".toLowerCase(), "roleInfo"); + tmpMap.put("ROLE_MAPPING".toLowerCase(), "roleMapping"); + tmpMap.put("ROUTINE_SCHEDULE".toLowerCase(), "routineSchedule"); + tmpMap.put("ROUTINE_SCHEDULE_CONTENT".toLowerCase(), + "routineScheduleContent"); + tmpMap.put("ROUTINE_SCHEDULE_MAPPING".toLowerCase(), + "routineScheduleMapping"); + tmpMap.put("SINGLE_SCHEDULE".toLowerCase(), "singleSchedule"); + tmpMap.put("SINGLE_SCHEDULE_CONTENT".toLowerCase(), + "singleScheduleContent"); + tmpMap.put("SINGLE_SCHEDULE_MAPPING".toLowerCase(), + "singleScheduleMapping"); + tmpMap.put("USER_INFO".toLowerCase(), "userInfo"); + + _tableDbNamePropertyNameKeyToLowerMap = Collections + .unmodifiableMap(tmpMap); + } + + /** The key-to-lower map of property-name and DB-name for table. */ + protected static final Map<String, String> _tablePropertyNameDbNameKeyToLowerMap; + static { + Map<String, String> tmpMap = new LinkedHashMap<String, String>(); + + tmpMap.put("groupInfo".toLowerCase(), "GROUP_INFO"); + tmpMap.put("groupMapping".toLowerCase(), "GROUP_MAPPING"); + tmpMap.put("roleInfo".toLowerCase(), "ROLE_INFO"); + tmpMap.put("roleMapping".toLowerCase(), "ROLE_MAPPING"); + tmpMap.put("routineSchedule".toLowerCase(), "ROUTINE_SCHEDULE"); + tmpMap.put("routineScheduleContent".toLowerCase(), + "ROUTINE_SCHEDULE_CONTENT"); + tmpMap.put("routineScheduleMapping".toLowerCase(), + "ROUTINE_SCHEDULE_MAPPING"); + tmpMap.put("singleSchedule".toLowerCase(), "SINGLE_SCHEDULE"); + tmpMap.put("singleScheduleContent".toLowerCase(), + "SINGLE_SCHEDULE_CONTENT"); + tmpMap.put("singleScheduleMapping".toLowerCase(), + "SINGLE_SCHEDULE_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); + } + } + + /** + * @return The initialized map that contains all instances of dbmeta. + * (NotNull & NotEmpty) + */ + public static Map<String, DBMeta> getDBMetaMap() { + initializeDBMetaMap(); + return _tableDbNameInstanceMap; + } + + protected static void initializeDBMetaMap() { + if (isInitialized()) { + return; + } + final Set<String> tableDbNameSet = _tableDbNameClassNameMap.keySet(); + for (String tableDbName : tableDbNameSet) { + findDBMeta(tableDbName); // Initialize! + } + if (!isInitialized()) { + String msg = "Failed to initialize tableDbNameInstanceMap:"; + msg = msg + " tableDbNameInstanceMap=" + _tableDbNameInstanceMap; + throw new IllegalStateException(msg); + } + } + + protected static boolean isInitialized() { + return _tableDbNameInstanceMap.size() == _tableDbNameClassNameMap + .size(); + } + + //========================================================================== + // ========= + // Main Method + // =========== + /** + * Find dbmeta by table flexible-name. + * + * <pre> + * If the table name is 'ORDER_DETAIL', you can find the dbmeta 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. + */ + 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 + } + } + String msg = "The instance map returned null by the key: key=" + + tableFlexibleName + " instanceMap=" + _tableDbNameInstanceMap; + throw new DBMetaNotFoundException(msg); + } + + public static class DBMetaNotFoundException extends IllegalStateException { + private static final long serialVersionUID = 1L; + + public DBMetaNotFoundException(String msg) { + super(msg); + } + } + + /** + * Get instance by table DB-name. + * + * @param tableDbName Table DB-name. (NotNull) + * @return Instance. (NotNull) + */ + protected static DBMeta byTableDbName(String tableDbName) { + assertStringNotNullAndNotTrimmedEmpty("tableDbName", tableDbName); + DBMeta instance = getCachedDBMeta(tableDbName); + if (instance == null) { + String msg = "The instance map returned null by the key: key=" + + tableDbName + " instanceMap=" + _tableDbNameInstanceMap; + throw new DBMetaNotFoundException(msg); + } + return instance; + } + + protected static DBMeta getCachedDBMeta(String tableName) {// For lazy-load! + // Thank you + // koyak! + if (_tableDbNameInstanceMap.containsKey(tableName)) { + return _tableDbNameInstanceMap.get(tableName); + } + synchronized (_tableDbNameInstanceMap) { + if (_tableDbNameInstanceMap.containsKey(tableName)) { + return _tableDbNameInstanceMap.get(tableName); + } + String entityName = _tableDbNameClassNameMap.get(tableName); + _tableDbNameInstanceMap.put(tableName, getDBMeta(entityName)); + } + return _tableDbNameInstanceMap.get(tableName); + } + + //========================================================================== + // ========= + // General Helper + // ============== + // ----------------------------------------------------- + // Assert Object + // ------------- + protected static void assertObjectNotNull(String variableName, Object value) { + SimpleAssertUtil.assertObjectNotNull(variableName, value); + } + + // ----------------------------------------------------- + // Assert String + // ------------- + protected static void assertStringNotNullAndNotTrimmedEmpty( + String variableName, String value) { + SimpleAssertUtil.assertStringNotNullAndNotTrimmedEmpty(variableName, + value); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/DBMetaInstanceHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyArranger.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,915 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.RelationInfo; + +/** + * The arranger of hierarchy. + * + * <pre> + * ex) LIBRARY Hierarchy + * + * LIBRARY + * |1 + * |--* NEXT_LIBRARY (Referrer) + * | |* + * | |--1 LIBRARY (Foreign) + * | + * |--* COLLECTION (Referrer) + * | |1 + * | |--1 COLLECTION_STATUS (Referrer) + * | | |* + * | | |--1 COLLECTION_STATUS_LOOKUP (Foreign) + * | | + * | |--1 BOOK (Foreign) + * | | |* + * | | |--1 AUTHOR (Foreign) + * | | |--1 PUBLISER (Foreign) + * | | |--1 GENRE (Foreign) + * | | |* + * | | |--1 GENRE (Foreign) + * | | + * | |--* LENDING_COLLECTION (Referrer) + * | | + * | + * |--* LIBRARY_USER (Referrer) + * |* |1 + * | |--* LENDING (Referrer) + * | |1 + * | |--* LENDING_COLLECTION (Referrer) + * | + * |--1 LB_USER (Foreign) + * |1 + * |--* BLACK_LIST (Referrer) + * |1 + * |--* BLACK_ACTION (Referrer) + * |* + * |--1 BLACK_ACTION_LOOKUP (Foreign) + * + * + * ex) The SQL of LIBRARY Hierarchy as FLAT + * + * select library.LIBRARY_ID as LIBRARY_ID + * , library.LIBRARY_NAME as LIBRARY_NAME + * , library.R_USER as R_USER + * , library.R_TIMESTAMP as R_TIMESTAMP + * , nextBase.LIBRARY_ID as BASE_LIBRARY_ID + * , nextBase.NEXT_LIBRARY_ID as NEXT_LIBRARY_ID + * , nextBaseNextLibrary.LIBRARY_ID as NEXT_LIBRARY_NEXT_LIBRARY_ID + * , nextBaseNextLibrary.LIBRARY_NAME as NEXT_LIBRARY_NEXT_LIBRARY_NAME + * , collection.COLLECTION_ID as COLLECTION_ID + * , collection.ARRIVAL_DATE as COLLECTION_ARRIVAL_DATE + * , collectionStatus.COLLECTION_ID as COLLECTION_STATUS_ID + * , collectionStatus.COLLECTION_STATUS_CODE as COLLECTION_STATUS_CODE + * , collectionStatusLookup.COLLECTION_STATUS_CODE as COLLECTION_STATUS_CODE + * , collectionStatusLookup.COLLECTION_STATUS_NAME as COLLECTION_STATUS_NAME + * , book.BOOK_ID as COLLECTION_BOOK_ID + * , book.BOOK_NAME as COLLECTION_BOOK_NAME + * , author.AUTHOR_ID as COLLECTION_BOOK_AUTHOR_ID + * , author.AUTHOR_NAME as COLLECTION_BOOK_AUTHOR_NAME + * , libraryUser.LIBRARY_ID as LIBRARY_USER_LIBRARY_ID + * , libraryUser.LB_USER_ID as LIBRARY_USER_LB_USER_ID + * , lending.LIBRARY_ID as LENDING_LIBRARY_ID + * , lending.LB_USER_ID as LENDING_LB_USER_ID + * , lending.LENDING_DATE as LENDING_DATE + * , lending.U_USER as LENDING_U_USER + * , lending.U_MODULE as LENDING_U_MODULE + * , lbUser.LB_USER_ID as LB_USER_ID + * , lbUser.LB_USER_NAME as LB_USER_NAME + * from LIBRARY library + * left outer join NEXT_LIBRARY nextBase on library.LIBRARY_ID = nextBase.LIBRARY_ID + * left outer join LIBRARY nextBaseNextLibrary on nextBase.NEXT_LIBRARY_ID = nextBaseNextLibrary.LIBRARY_ID + * left outer join COLLECTION collection on library.LIBRARY_ID = collection.LIBRARY_ID + * left outer join COLLECTION_STATUS collectionStatus on collection.COLLECTION_ID = collectionStatus.COLLECTION_ID + * left outer join COLLECTION_STATUS_LOOKUP collectionStatusLookup on collectionStatus.COLLECTION_STATUS_CODE = collectionStatusLookup.COLLECTION_STATUS_CODE + * left outer join BOOK book on collection.BOOK_ID = book.BOOK_ID + * left outer join AUTHOR author on book.AUTHOR_ID = author.AUTHOR_ID + * left outer join LIBRARY_USER libraryUser on library.LIBRARY_ID = libraryUser.LIBRARY_ID + * left outer join LENDING lending on libraryUser.LIBRARY_ID = lending.LIBRARY_ID and libraryUser.LB_USER_ID = lending.LB_USER_ID + * left outer join LB_USER lbUser on libraryUser.LB_USER_ID = lbUser.LB_USER_ID + * + * + * ex) Invoking Hierarchy Arranger + * + * private List<Library> makeLibraryList() { + * final HierarchyRequest<Library> request = createHierarchyRequest(createFlatLibraryList()); + * return new HierarchyArranger<Library>().arrangeHierarchy(request); + * } + * + * + * ex) Creating Hierarchy Request + * + * private HierarchyRequest<Library> createHierarchsyRequest(java.util.List>HierarchyFlatLibrary> flatLibraryList) { + * + * // Define dbmeta. + * final HierarchyFlatLibraryDbm sourceDbm = HierarchyFlatLibraryDbm.getInstance(); + * + * // Define hierarychy request as library. + * final HierarchyRequest<Library> request = new HierarchyRequest<Library>(Library.class); + * + * // Register the list of source iterator. (by calling creator for flat library list) + * request.registerSourceList(flatLibraryList); + * + * // Create relation trace. + * final LibraryRelationTrace trace = LibraryDbm.getInstance().createRelationTrace(null); + * + * // Register column [libraryId] + * request.mapping(sourceDbm.columnLibraryId(), trace.columnLibraryId()); + * + * // Register column [libraryName] + * request.mapping(sourceDbm.columnLibraryName(), trace.columnLibraryName()); + * + * // Register column [RUser] + * request.mapping(sourceDbm.columnRUser(), trace.columnRUser()); + * + * // Register column [RTimestamp] + * request.mapping(sourceDbm.columnRTimestamp(), trace.columnRTimestamp()); + * + * // Register column [baseLibraryId] + * request.mapping(sourceDbm.columnBaseLibraryId(), trace.referrerNextLibraryByBaseIdList().columnLibraryId()); + * + * // Register column [nextLibraryId] + * request.mapping(sourceDbm.columnNextLibraryId(), trace.referrerNextLibraryByBaseIdList().columnNextLibraryId()); + * + * // Register column [nextLibraryNextLibraryId] + * request.mapping(sourceDbm.columnNextLibraryNextLibraryId(), trace.referrerNextLibraryByBaseIdList().foreignLibraryByNextId().columnLibraryId()); + * + * // Register column [nextLibraryNextLibraryName] + * request.mapping(sourceDbm.columnNextLibraryNextLibraryName(), trace.referrerNextLibraryByBaseIdList().foreignLibraryByNextId().columnLibraryName()); + * + * // Register column [collectionId] + * request.mapping(sourceDbm.columnCollectionId(), trace.referrerCollectionList().columnCollectionId()); + * + * // Register column [arrivalDate] + * request.mapping(sourceDbm.columnCollectionArrivalDate(), trace.referrerCollectionList().columnArrivalDate()); + * + * // Register column [collectionStatusId] + * request.mapping(sourceDbm.columnCollectionStatusId(), trace.referrerCollectionList().foreignCollectionStatusAsOne().columnCollectionId()); + * + * // Register column [collectionStatusCode] + * request.mapping(sourceDbm.columnCollectionStatusCode(), trace.referrerCollectionList().foreignCollectionStatusAsOne().foreignCollectionStatusLookup().columnCollectionStatusCode()); + * + * // Register column [collectionStatusName] + * request.mapping(sourceDbm.columnCollectionStatusName(), trace.referrerCollectionList().foreignCollectionStatusAsOne().foreignCollectionStatusLookup().columnCollectionStatusName()); + * + * // Register column [collectionBookId] + * request.mapping(sourceDbm.columnCollectionBookId(), trace.referrerCollectionList().foreignBook().columnBookId()); + * + * // Register column [collectionBookName] + * request.mapping(sourceDbm.columnCollectionBookName(), trace.referrerCollectionList().foreignBook().columnBookName()); + * + * // Register column [collectionBookAuthorId] + * request.mapping(sourceDbm.columnCollectionBookAuthorId(), trace.referrerCollectionList().foreignBook().foreignAuthor().columnAuthorId()); + * + * // Register column [collectionBookAuthorName] + * request.mapping(sourceDbm.columnCollectionBookAuthorName(), trace.referrerCollectionList().foreignBook().foreignAuthor().columnAuthorName()); + * + * // Register column [libraryUserLibraryId] + * request.mapping(sourceDbm.columnLibraryUserLibraryId(), trace.referrerLibraryUserList().columnLibraryId()); + * + * // Register column [libraryUserLbUserId] + * request.mapping(sourceDbm.columnLibraryUserLbUserId(), trace.referrerLibraryUserList().columnLbUserId()); + * + * // Register column [lendingLibraryId] + * request.mapping(sourceDbm.columnLendingLibraryId(), trace.referrerLibraryUserList().referrerLendingList().columnLibraryId()); + * + * // Register column [lendingLbUserId] + * request.mapping(sourceDbm.columnLendingLbUserId(), trace.referrerLibraryUserList().referrerLendingList().columnLbUserId()); + * + * // Register column [lendingDate] + * request.mapping(sourceDbm.columnLendingDate(), trace.referrerLibraryUserList().referrerLendingList().columnLendingDate()); + * + * // Register column [lendingUUser] + * request.mapping(sourceDbm.columnLendingUUser(), trace.referrerLibraryUserList().referrerLendingList().columnUUser()); + * + * // Register column [lendingUModule] + * request.mapping(sourceDbm.columnLendingUModule(), trace.referrerLibraryUserList().referrerLendingList().columnUModule()); + * + * // Register column [lbUserId] + * request.mapping(sourceDbm.columnLbUserId(), trace.referrerLibraryUserList().foreignLbUser().columnLbUserId()); + * + * // Register column [lbUserName] + * request.mapping(sourceDbm.columnLbUserName(), trace.referrerLibraryUserList().foreignLbUser().columnLbUserName()); + * + * return request; + * } + * + * private java.util.List>HierarchyFlatLibrary> createFlatLibraryList() { + * (...select and get list) + * return flatLibraryList; + * } + * + * + * === Relation Trace Tips === + * + * RelationTrace.f + [Code Assist] -- go to Foreign + * RelationTrace.r + [Code Assist] -- go to Referrer + * RelationTrace.c + [Code Assist] -- end relation by Column + * + * <pre> + * + * @author DBFlute(AutoGenerator) + * @param <LOCAL_ENTITY> The type of local entity extends Entity + */ + @ SuppressWarnings("unchecked") +public class HierarchyArranger<LOCAL_ENTITY extends Entity> { + + //========================================================================== + // ========= + // Main + // ==== + /** + * Arrange hierarchy. + * + * @param request Hierarchy request. (NotNull) + * @return The list of local entity. (NotNull) + */ + public List<LOCAL_ENTITY> arrangeHierarchy( + HierarchyRequest<LOCAL_ENTITY> request) { + final List<LOCAL_ENTITY> localTableList = new ArrayList<LOCAL_ENTITY>(); + final Map<String, Entity> alreadyRegisteredEntityMap = new HashMap<String, Entity>(); + + // ============ + // Record Loop! + // ============ + final HierarchySourceIterator sourceIterator = request + .getSourceIterator(); + while (sourceIterator.hasNext()) { + final HierarchySourceRow sourceRow = sourceIterator.next(); + final TopInfo<LOCAL_ENTITY> topInfo = new TopInfo<LOCAL_ENTITY>(); + topInfo.setHierarchyRequest(request); + topInfo.setSourceRow(sourceRow); + topInfo.setAlreadyRegisteredEntityMap(alreadyRegisteredEntityMap); + + final Map<String, Object> primaryKeyMap = extractTopPrimaryKeyMapFromSource(topInfo); + final String alreadyRegisteredKey = buildTopAlreadyRegisteredKey(primaryKeyMap); + if (alreadyRegisteredEntityMap.containsKey(alreadyRegisteredKey)) { + final Entity localEntity = alreadyRegisteredEntityMap + .get(alreadyRegisteredKey); + topInfo.setLocalEntity(localEntity); + } else { + // Make local entity and register it to the result list. + final LOCAL_ENTITY localEntity = newLocalEntity(request + .getDestinationDBMeta()); + topInfo.setLocalEntity(localEntity); + localTableList.add(localEntity); + alreadyRegisteredEntityMap.put(alreadyRegisteredKey, + localEntity); + } + + // ============ + // Column Loop! + // ============ + doColumnLoop(topInfo); + } + + // Clear modified properties. + final java.util.Set<String> alreadyRegisteredEntityKeySet = alreadyRegisteredEntityMap + .keySet(); + for (String key : alreadyRegisteredEntityKeySet) { + final Entity currentRegisteredEntity = alreadyRegisteredEntityMap + .get(key); + currentRegisteredEntity.clearModifiedPropertyNames(); + } + + return localTableList; + } + + /** + * Build top already-registered key. + * + * @param primaryKeyMap The map of primary key. (NotNull) + * @return Top already-registered key. (NotNull) + */ + protected String buildTopAlreadyRegisteredKey( + Map<String, Object> primaryKeyMap) { + return HierarchyRequestElement.TOP_KEY + ":" + primaryKeyMap; + } + + /** + * Do column loop. + * + * @param topInfo The information object of top that has generics of the + * type of local entity. (NotNull) + */ + protected void doColumnLoop(TopInfo<LOCAL_ENTITY> topInfo) { + final HierarchyRequest<LOCAL_ENTITY> request = topInfo + .getHierarchyRequest(); + final Entity localEntity = topInfo.getLocalEntity(); + final List<HierarchyRequestElement> requestElementList = request + .getRequestElementList(); + + // ============ + // Column Loop! + // ============ + for (HierarchyRequestElement requestElement : requestElementList) { + final List<String> relationPropertyNameList = requestElement + .getRelationPropertyNameList(); + + // If the column belongs to local entity, inject the value to entity + // and continue loop. + if (relationPropertyNameList == null + || relationPropertyNameList.isEmpty()) { + final HierarchySourceColumn sourceColumn = requestElement + .getSourceColumnInfo(); + final HierarchySourceRow sourceRow = topInfo.getSourceRow(); + final Object sourceColumnValue = extractColumnValueFromSource( + sourceRow, sourceColumn); + final ColumnInfo destinationColumnInfo = requestElement + .getDestinationColumnInfo(); + injectColumnValueToDestinationIfNotNull(localEntity, + destinationColumnInfo, sourceColumnValue); + continue; + } + + // ============== + // Relation Loop! + // ============== + doRelationLoop(topInfo, requestElement, relationPropertyNameList); + } + } + + /** + * Do relation loop. + * + * @param topInfo The information object of top that has generics of local + * entity. (NotNull) + * @param requestElement The element of request. This is relation loop + * resource. (NotNull) + * @param relationPropNameList The list of relation property name that has + * generics of string. (NotNull) + */ + protected void doRelationLoop(TopInfo<LOCAL_ENTITY> topInfo, + HierarchyRequestElement requestElement, + java.util.List<String> relationPropNameList) { + final HierarchyRequest<LOCAL_ENTITY> request = topInfo + .getHierarchyRequest(); + final Map<String, Entity> alreadyRegisteredEntityMap = topInfo + .getAlreadyRegisteredEntityMap(); + + // Temporary variables for local + Entity localEntity = topInfo.getLocalEntity();// as Default + DBMeta localDBMeta = request.getDestinationDBMeta();// as Default + String localRelationPath = HierarchyRequestElement.TOP_KEY;// as Default + + // ============== + // Relation Loop! + // ============== + final StringBuilder relationPropKeyStringBuilder = new StringBuilder(); + int relationLoopCount = 0; + for (String relationPropName : relationPropNameList) { + if (relationPropKeyStringBuilder.length() > 0) { + relationPropKeyStringBuilder.append("_"); + } + relationPropKeyStringBuilder.append(relationPropName); + final String targetRelationPath = relationPropKeyStringBuilder + .toString(); + final RelationInfo relationInfo = localDBMeta + .findRelationInfo(relationPropName); + + final Map<String, Object> targetPrimaryKeyMap; + final String alreadyRegisteredEntityKey; + if (!relationInfo.isReferrer()) { + // ======= + // Foreign + // ======= + final ForeignInfo foreignInfo = localDBMeta + .findForeignInfo(relationPropName); + final String foreignPropName = foreignInfo + .getForeignPropertyName(); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - + // If the value of primary key does not exist, break this + // relation path! + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - + if (isNotExistPrimaryKey(topInfo, targetRelationPath)) { + break; + } + + targetPrimaryKeyMap = extractPrimaryKeyMapFromSource(topInfo, + targetRelationPath); + alreadyRegisteredEntityKey = targetRelationPath + ":" + + targetPrimaryKeyMap.toString(); + if (!alreadyRegisteredEntityMap + .containsKey(alreadyRegisteredEntityKey)) { + // - - - - - - - - - - - - - - - - - - - - - - - + // Initialize the foreign entity and inject it. + // - - - - - - - - - - - - - - - - - - - - - - - + final Entity foreignEntity = foreignInfo.getForeignDBMeta() + .newEntity(); + injectForeignEntity(localEntity, foreignPropName, + foreignEntity); + + // - - - - - - - - - - - - - - - - - - + // Initialize primary key of foreign. + // - - - - - - - - - - - - - - - - - - + injectForeignPrimaryKey(foreignEntity, targetPrimaryKeyMap); + + // - - - - - - - - - - - - - - - - - - + // Initialize foreign key of local. + // - - - - - - - - - - - - - - - - - - + injectLocalForeignKey(topInfo, localEntity, foreignInfo, + targetRelationPath); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // Put foreign entity to the map of + // already-registered-entity. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + alreadyRegisteredEntityMap.put(alreadyRegisteredEntityKey + .toString(), foreignEntity); + } else { + // - - - - - - - - - - - - - - + // Inject the foreign entity. + // - - - - - - - - - - - - - - + final Entity foreignEntity = alreadyRegisteredEntityMap + .get(alreadyRegisteredEntityKey); + injectForeignEntity(localEntity, foreignPropName, + foreignEntity); + } + } else { + // ======= + // Referrer + // ======= + final ReferrerInfo referrerInfo = localDBMeta + .findReferrerInfo(relationPropName); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + // Extract referrer list from current local entity and + // initialize it if needs. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - + 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); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - + // If the value of primary key does not exist, break this + // relation path! + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - + if (isNotExistPrimaryKey(topInfo, targetRelationPath)) { + break; + } + + targetPrimaryKeyMap = extractPrimaryKeyMapFromSource(topInfo, + targetRelationPath); + alreadyRegisteredEntityKey = targetRelationPath + ":" + + targetPrimaryKeyMap.toString(); + if (!alreadyRegisteredEntityMap + .containsKey(alreadyRegisteredEntityKey)) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - + // Initialize referrer entity and register it to the list of + // referrer with primary key value. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - + final Entity referrerEntity = relationInfo + .getTargetDBMeta().newEntity(); + referrerList.add(referrerEntity); + + // - - - - - - - - - - - - - - - - - - + // Initialize primary key of referrer. + // - - - - - - - - - - - - - - - - - - + injectReferrerPrimaryKey(referrerEntity, + targetPrimaryKeyMap); + + // - - - - - - - - - - - - - - - - - - + // Initialize foreign key of referrer. + // - - - - - - - - - - - - - - - - - - + injectReferrerForeignKey(topInfo, referrerEntity, + referrerInfo, localRelationPath); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + // Put referrer entity to the map of + // already-registered-entity. + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - + alreadyRegisteredEntityMap.put(alreadyRegisteredEntityKey + .toString(), referrerEntity); + } + } + + // - - - - - - - - - - - - - - - - - - + // Set next value to current element. + // - - - - - - - - - - - - - - - - - - + localEntity = alreadyRegisteredEntityMap + .get(alreadyRegisteredEntityKey); + localDBMeta = localEntity.getDBMeta(); + localRelationPath = targetRelationPath; + + if (relationLoopCount == (relationPropNameList.size() - 1)) {// The + // last + // loop + // ! + // - - - - - - - - - - - - + // Here is the last loop! + // - - - - - - - - - - - - + doLastLoopInjection(topInfo, requestElement, localEntity, + targetPrimaryKeyMap); + } + ++relationLoopCount; + } + } + + /** + * Is not existing primary key at the relation path?. + * + * @param topInfo The information object of top that has generics of local + * entity. (NotNull) + * @param relationPath The path of relation. (NotNull) + * @return Determination. + */ + protected boolean isNotExistPrimaryKey(TopInfo<LOCAL_ENTITY> topInfo, + String relationPath) { + final Map<String, Object> primaryKeyMap = extractPrimaryKeyMapFromSource( + topInfo, relationPath); + final Set<String> keySet = primaryKeyMap.keySet(); + for (String key : keySet) { + final Object value = primaryKeyMap.get(key); + if (value == null) { + return true; + } + } + return false; + } + + /** + * Do last loop injection. + * + * @param topInfo The information object of top that has generics of local + * entity. (NotNull) + * @param requestElement The element of request. This is relation loop + * resource. (NotNull) + * @param localEntity The interface of local entity. (NotNull) + * @param primaryKeyMap The map of primary key. (NotNull) + */ + protected void doLastLoopInjection(TopInfo<LOCAL_ENTITY> topInfo, + HierarchyRequestElement requestElement, Entity localEntity, + Map<String, Object> primaryKeyMap) { + final ColumnInfo destinationColumnInfo = requestElement + .getDestinationColumnInfo(); + if (!primaryKeyMap.containsKey(destinationColumnInfo.getColumnDbName())) {// The + // column + // is + // primary + // key + // ! + final HierarchySourceRow sourceRow = topInfo.getSourceRow(); + final HierarchySourceColumn sourceColumnInfo = requestElement + .getSourceColumnInfo(); + final Object sourceColumnValue = extractColumnValueFromSource( + sourceRow, sourceColumnInfo); + if (sourceColumnValue != null) { + injectColumnValueToDestinationIfNotNull(localEntity, + destinationColumnInfo, sourceColumnValue); + } + } + } + + //========================================================================== + // ========= + // Extract Logic + // ============= + protected Map<String, Object> extractTopPrimaryKeyMapFromSource( + TopInfo<LOCAL_ENTITY> topInfo) { + return extractPrimaryKeyMapFromSource(topInfo, + HierarchyRequestElement.TOP_KEY); + } + + protected Map<String, Object> extractPrimaryKeyMapFromSource( + TopInfo<LOCAL_ENTITY> topInfo, String relationPath) { + final HierarchyRequest<LOCAL_ENTITY> request = topInfo + .getHierarchyRequest(); + final HierarchySourceRow sourceRow = topInfo.getSourceRow(); + final java.util.List<HierarchyRequestElement> primaryKeyElement = request + .findPrimaryKeyElement(relationPath); + final java.util.Map<String, Object> primaryKeyMap = new java.util.LinkedHashMap<String, Object>(); + for (HierarchyRequestElement element : primaryKeyElement) { + final HierarchySourceColumn sourcePrimaryKey = element + .getSourceColumnInfo(); + final Object sourcePrimaryKeyValue = extractColumnValueFromSource( + sourceRow, sourcePrimaryKey); + primaryKeyMap.put(element.getDestinationColumnInfo() + .getColumnDbName(), sourcePrimaryKeyValue); + } + return primaryKeyMap; + } + + protected Object extractColumnValueFromSource(HierarchySourceRow sourceRow, + HierarchySourceColumn sourceColumn) { + return sourceRow.extractColumnValue(sourceColumn); + } + + @SuppressWarnings("unchecked") + protected java.util.List<Entity> extractReferrerList(Entity entity, + ReferrerInfo referrerInfo) { + return (java.util.List<Entity>) invoke(referrerInfo.findGetter(), + entity, new Object[] {}); + } + + //========================================================================== + // ========= + // Inject Logic + // ============ + /** + * @param entity Entity. (NotNull) + * @param columnInfo Column info. (NotNull) + * @param columnValue Column value. (NotNull) + */ + protected void injectColumnValueToDestinationIfNotNull(Entity entity, + ColumnInfo columnInfo, final Object columnValue) { + if (columnValue != null) { + injectColumnValueToDestination(entity, + columnInfo.getColumnDbName(), columnValue); + } + } + + protected void injectColumnValueToDestination(Entity entity, + String columnDbName, final Object columnValue) { + if (columnValue == null) { + String msg = "The argument[columnValue] should not be null: "; + msg = msg + " table=" + entity.getTableDbName() + " column=" + + columnDbName; + throw new IllegalStateException(msg); + } + invoke(entity.getDBMeta().findColumnInfo(columnDbName).findSetter(), + entity, new Object[] { columnValue }); + } + + protected void injectColumnValueMapToDestination(Entity entity, + final Map<String, Object> columnValueMap) { + final Set<String> columnNameSet = columnValueMap.keySet(); + for (String columnName : columnNameSet) { + final Object columnValue = columnValueMap.get(columnName); + injectColumnValueToDestination(entity, columnName, columnValue); + } + } + + protected void injectForeignEntity(Entity entity, String foreignPropName, + Entity foreignEntity) { + final String capPropReferrerName = initCap(foreignPropName); + final Method method = findMethod(entity.getClass(), "set" + + capPropReferrerName, new Class[] { foreignEntity.getDBMeta() + .getEntityType() }); + invoke(method, entity, new Object[] { foreignEntity }); + } + + protected void injectReferrerList(Entity entity, ReferrerInfo referrerInfo, + java.util.List<Entity> referrerList) { + invoke(referrerInfo.findSetter(), entity, new Object[] { referrerList }); + } + + protected void injectForeignPrimaryKey(Entity foreignEntity, + Map<String, Object> foreigPrimaryKeyMap) { + injectColumnValueMapToDestination(foreignEntity, foreigPrimaryKeyMap); + } + + protected void injectReferrerPrimaryKey(Entity referrerEntity, + Map<String, Object> referrerPrimaryKeyMap) { + injectColumnValueMapToDestination(referrerEntity, referrerPrimaryKeyMap); + } + + protected void injectLocalForeignKey(TopInfo<LOCAL_ENTITY> topInfo, + Entity localEntity, ForeignInfo foreignInfo, + String foreignRelationPath) { + final HierarchyRequest<LOCAL_ENTITY> request = topInfo + .getHierarchyRequest(); + final Map<String, Object> foreignPrimaryKeyMap = extractPrimaryKeyMapFromSource( + topInfo, foreignRelationPath); + final List<HierarchyRequestElement> primaryKeyElementList = request + .findPrimaryKeyElement(foreignRelationPath); + final Map<String, Object> localForeignKeyMap = new HashMap<String, Object>(); + for (HierarchyRequestElement foreignElement : primaryKeyElementList) { + final String foreignPrimaryKeyColumnName = foreignElement + .getDestinationColumnInfo().getColumnDbName(); + final ColumnInfo localForeignKeyInfo = foreignInfo + .findLocalByForeign(foreignPrimaryKeyColumnName); + final Object localForeignKeyValue = foreignPrimaryKeyMap + .get(foreignPrimaryKeyColumnName); + localForeignKeyMap.put(localForeignKeyInfo.getColumnDbName(), + localForeignKeyValue); + } + injectColumnValueMapToDestination(localEntity, localForeignKeyMap); + } + + protected void injectReferrerForeignKey(TopInfo<LOCAL_ENTITY> topInfo, + Entity referrerEntity, ReferrerInfo referrerInfo, + String localRelationPath) { + final HierarchyRequest<LOCAL_ENTITY> request = topInfo + .getHierarchyRequest(); + final Map<String, Object> localPrimaryKeyMap = extractPrimaryKeyMapFromSource( + topInfo, localRelationPath); + final List<HierarchyRequestElement> primaryKeyElementList = request + .findPrimaryKeyElement(localRelationPath); + final Map<String, Object> referrerForeignKeyMap = new HashMap<String, Object>(); + for (HierarchyRequestElement localElement : primaryKeyElementList) { + final String localPrimaryKeyName = localElement + .getDestinationColumnInfo().getColumnDbName(); + final ColumnInfo referrerForeignKeyInfo = referrerInfo + .findReferrerByLocal(localPrimaryKeyName); + final Object referrerForeignKeyValue = localPrimaryKeyMap + .get(localPrimaryKeyName); + referrerForeignKeyMap.put(referrerForeignKeyInfo.getColumnDbName(), + referrerForeignKeyValue); + } + injectColumnValueMapToDestination(referrerEntity, referrerForeignKeyMap); + } + + //========================================================================== + // ========= + // Other Logic + // =========== + @SuppressWarnings("unchecked") + protected LOCAL_ENTITY newLocalEntity(final DBMeta destinationDBMeta) { + final LOCAL_ENTITY localEntity; + try { + localEntity = (LOCAL_ENTITY) destinationDBMeta.getEntityType() + .newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + return localEntity; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected String initCap(final String name) { + final String capPropReferrerName = name.substring(0, 1).toUpperCase() + + name.substring(1); + return capPropReferrerName; + } + + private java.lang.reflect.Method findMethod(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); + } + } + + private Object invoke(java.lang.reflect.Method method, Object target, + Object[] args) { + try { + return method.invoke(target, args); + } catch (RuntimeException e) { + final String lineSeparator = System.getProperty("line.separator"); + final Class<?>[] parameterTypes = method.getParameterTypes(); + String msg = "Invoking method threw the exception:" + lineSeparator; + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + lineSeparator; + msg = msg + "[" + method.getDeclaringClass().getSimpleName() + "." + + method.getName() + "()]" + lineSeparator; + msg = msg + " methodArgTypes = {" + + createTypeViewFromTypeArray(parameterTypes) + "}" + + lineSeparator; + msg = msg + " specifiedArgValues = {" + + createValueViewFromValueArray(args) + "}" + lineSeparator; + msg = msg + " specifiedArgTypes = {" + + createTypeViewFromValueArray(args) + "}" + lineSeparator; + if (parameterTypes.length > 0 && args.length > 0 && args[0] != null + && !parameterTypes[0].equals(args[0].getClass())) { + msg = msg + " " + lineSeparator; + final String compareString = "{" + parameterTypes[0] + " -- " + + args[0].getClass() + "}"; + msg = msg + " *Warning! The argType is ummatched: " + + compareString + lineSeparator; + } + msg = msg + "* * * * * * * * * */" + lineSeparator; + throw new RuntimeException(msg, e); + } 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); + } + } + + private String createValueViewFromValueArray(Object[] array) { + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < array.length; i++) { + final Object value = array[i]; + if (sb.length() == 0) { + sb.append(value); + } else { + sb.append(", ").append(value); + } + } + return sb.toString(); + } + + private String createTypeViewFromValueArray(Object[] array) { + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < array.length; i++) { + final Object value = array[i]; + final String typeName = value != null ? value.getClass() + .getSimpleName() : "null"; + if (sb.length() == 0) { + sb.append(typeName); + } else { + sb.append(", ").append(typeName); + } + } + return sb.toString(); + } + + private String createTypeViewFromTypeArray(Class[] array) { + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < array.length; i++) { + final Class type = array[i]; + if (sb.length() == 0) { + sb.append(type.getSimpleName()); + } else { + sb.append(", ").append(type.getSimpleName()); + } + } + return sb.toString(); + } + + //========================================================================== + // ========= + // Info Class + // ========== + protected static class TopInfo<LOCAL_ENTITY extends Entity> { + private HierarchyRequest<LOCAL_ENTITY> hierarchyRequest; + + private HierarchySourceRow sourceRow; + + private Entity localEntity; + + private Map<String, Entity> alreadyRegisteredEntityMap; + + public HierarchySourceRow getSourceRow() { + return sourceRow; + } + + public void setSourceRow(HierarchySourceRow sourceRow) { + this.sourceRow = sourceRow; + } + + public Entity getLocalEntity() { + return localEntity; + } + + public void setLocalEntity(Entity localEntity) { + this.localEntity = localEntity; + } + + public Map<String, Entity> getAlreadyRegisteredEntityMap() { + return alreadyRegisteredEntityMap; + } + + public void setAlreadyRegisteredEntityMap( + Map<String, Entity> alreadyRegisteredEntityMap) { + this.alreadyRegisteredEntityMap = alreadyRegisteredEntityMap; + } + + public HierarchyRequest<LOCAL_ENTITY> getHierarchyRequest() { + return hierarchyRequest; + } + + public void setHierarchyRequest( + HierarchyRequest<LOCAL_ENTITY> hierarchyRequest) { + this.hierarchyRequest = hierarchyRequest; + } + } +} Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,94 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * The basic request of hierarchy. + * + * @author DBFlute(AutoGenerator) + * @param <LOCAL_ENTITY> The type of local entity. + * @param <LOCAL_RELATION_TRACE> The type of local relation trace. + */ + @ SuppressWarnings("unchecked") +public class HierarchyBasicRequest<LOCAL_ENTITY extends Entity, LOCAL_RELATION_TRACE extends DBMeta.RelationTrace> + extends HierarchyRequest<LOCAL_ENTITY> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ColumnInfo _currentSourceColumnInfo; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param localEntityType The type of local entity. (NotNull) + */ + public HierarchyBasicRequest(Class<LOCAL_ENTITY> localEntityType) { + super(localEntityType); + } + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + // ----------------------------------------------------- + // public + // ------ + /** + * Set up source. + * + * @param sourceColumnInfo The column info of source. (NotNull) + * @return Destination relation trace. (NotNull) + */ + public DestinationRelationTrace<LOCAL_RELATION_TRACE> src( + ColumnInfo sourceColumnInfo) { + this._currentSourceColumnInfo = sourceColumnInfo; + final HierarchyBasicRequest<LOCAL_ENTITY, LOCAL_RELATION_TRACE> outer = this; + return new DestinationRelationTrace<LOCAL_RELATION_TRACE>() { + public LOCAL_RELATION_TRACE dst() { + return outer.dst(); + } + }; + } + + /** + * Set up destination. + * + * @return Local relation trace. (NotNull) + */ + public LOCAL_RELATION_TRACE dst() { + final DBMeta.RelationTraceFixHandler handler = new DBMeta.RelationTraceFixHandler() { + public void handleFixedTrace(DBMeta.RelationTrace relationTrace) { + mapping(_currentSourceColumnInfo, relationTrace); + } + }; + final Object target = destinationDBMeta; + java.lang.reflect.Method method = null; + try { + method = target.getClass().getMethod("createRelationTrace", + new Class[] { DBMeta.RelationTraceFixHandler.class }); + } catch (NoSuchMethodException e) { + String msg = "Not found method: method=createRelationTrace(DBMeta.RelationTraceFixHandler)"; + throw new IllegalStateException(msg, e); + } + try { + return (LOCAL_RELATION_TRACE) method.invoke(target, + new Object[] { handler }); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new IllegalStateException(e.getCause()); + } + } + + public static interface DestinationRelationTrace<LOCAL_RELATION_TRACE> { + public LOCAL_RELATION_TRACE dst(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyBasicRequest.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,347 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic.HierarchySourceEntityColumn; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic.HierarchySourceEntityListIterator; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.RelationInfo; + +/** + * The request of hierarchy. + * + * @author DBFlute(AutoGenerator) + * @param <LOCAL_ENTITY> The type of local entity. + */ + @ SuppressWarnings("unchecked") +public class HierarchyRequest<LOCAL_ENTITY extends Entity> { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The dbmeta of desination. */ + protected DBMeta destinationDBMeta; + + /** The iterator of hierarychy source. */ + protected HierarchySourceIterator sourceIterator; + + /** The list of request element. */ + protected List<HierarchyRequestElement> requestElementList = new ArrayList<HierarchyRequestElement>(); + + /** The set of already registered source column info for check. */ + protected java.util.Set<ColumnInfo> alreadyRegisteredSourceColumnInfoSet4Check = new java.util.HashSet<ColumnInfo>(); + + /** First source column info for check. */ + protected ColumnInfo firstSourceColumnInfo4Check; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param localEntityType The type of local entity. (NotNull) + */ + public HierarchyRequest(Class<LOCAL_ENTITY> localEntityType) { + LOCAL_ENTITY localEntity; + try { + localEntity = localEntityType.newInstance(); + } catch (InstantiationException e) { + String msg = "localEntityType.newInstance() threw the InstantiationException:"; + msg = msg + " localEntityType=" + localEntityType; + throw new IllegalStateException(msg, e); + } catch (IllegalAccessException e) { + String msg = "localEntityType.newInstance() threw the IllegalAccessException:"; + msg = msg + " localEntityType=" + localEntityType; + throw new IllegalStateException(msg, e); + } + destinationDBMeta = localEntity.getDBMeta(); + } + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + // ----------------------------------------------------- + // public + // ------ + /** + * Register the list of source. <br /> This method uses the default source + * iterator. + * + * @param sourceList The list of source. (NotNull) + * @param <SOURCE> The type of source. (NotNull) + */ + public <SOURCE> void registerSourceList(java.util.List<SOURCE> sourceList) { + sourceIterator = createDefaultSourceIterator(sourceList); + } + + /** + * Set up mapping between the source column and the destination relation. + * + * @param sourceColumn The column of source. (NotNull) + * @param relationTrace The relation trace of destination. (NotNull) + */ + public void mapping(HierarchySourceColumn sourceColumn, + DBMeta.RelationTrace relationTrace) { + setupElement(sourceColumn, relationTrace.getTraceColumn()); + addRelationToLastElement(relationTrace.getTraceRelation()); + } + + /** + * Set up mapping between the source column and the destination relation. + * + * @param sourceColumnInfo The column info of source. (NotNull) + * @param relationTrace The relation trace of destination. (NotNull) + */ + public void mapping(ColumnInfo sourceColumnInfo, + DBMeta.RelationTrace relationTrace) { + setupElement(sourceColumnInfo, relationTrace.getTraceColumn()); + addRelationToLastElement(relationTrace.getTraceRelation()); + } + + // ----------------------------------------------------- + // internal + // ------- + /** + * Set up element. + * + * @param sourceColumn The column of source. (NotNull) + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + protected void setupElement(HierarchySourceColumn sourceColumn, + ColumnInfo destinationColumnInfo) { + assertSameLocalDestinationDBMeta(destinationColumnInfo); + final HierarchyRequestElement element = new HierarchyRequestElement(); + requestElementList.add(element); + element.mapping(sourceColumn, destinationColumnInfo); + element.setDestinationDBMeta(destinationColumnInfo.getDBMeta()); + } + + /** + * Set up element. <br /> This method uses the default source column. + * + * @param sourceColumnInfo The column info of source. (NotNull) + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + protected void setupElement(ColumnInfo sourceColumnInfo, + ColumnInfo destinationColumnInfo) { + if (alreadyRegisteredSourceColumnInfoSet4Check + .contains(sourceColumnInfo)) { + String msg = "The wrong sourceColumnInfo!" + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The source column has already been registered:" + + getLineSeparator(); + msg = msg + "- - - - -" + getLineSeparator(); + msg = msg + " sourceColumnInfo=" + sourceColumnInfo + + getLineSeparator(); + msg = msg + " registeredColumnInfo=" + + alreadyRegisteredSourceColumnInfoSet4Check + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + alreadyRegisteredSourceColumnInfoSet4Check.add(sourceColumnInfo); + assertSameSourceDBMeta(sourceColumnInfo); + assertSameLocalDestinationDBMeta(destinationColumnInfo); + final HierarchyRequestElement element = new HierarchyRequestElement(); + requestElementList.add(element); + final HierarchySourceColumn sourceColumn = createDefaultSourceColumn(sourceColumnInfo); + element.mapping(sourceColumn, destinationColumnInfo); + element.setDestinationDBMeta(destinationColumnInfo.getDBMeta()); + } + + /** + * Make relatetion by the list of relation info. + * + * @param relationInfoList The list of relation info. (NotNull) + */ + protected void addRelationToLastElement(List<RelationInfo> relationInfoList) { + if (requestElementList.isEmpty()) { + String msg = "You shuold invoke mapping() before invoking relation()!"; + throw new IllegalStateException(msg); + } + for (RelationInfo relationInfo : relationInfoList) { + final int lastIndex = requestElementList.size() - 1; + final HierarchyRequestElement element = (HierarchyRequestElement) requestElementList + .get(lastIndex); + element.relation(relationInfo); + } + } + + /** + * Assert same source dbmeta. + * + * @param sourceColumnInfo The column info of source. (NotNull) + */ + protected void assertSameSourceDBMeta(ColumnInfo sourceColumnInfo) { + if (firstSourceColumnInfo4Check == null) { + firstSourceColumnInfo4Check = sourceColumnInfo; + return; + } + final DBMeta expectedDBMeta = firstSourceColumnInfo4Check.getDBMeta(); + final DBMeta actualDBMeta = sourceColumnInfo.getDBMeta(); + if (!expectedDBMeta.equals(actualDBMeta)) { + String msg = "The wrong sourceColumnInfo!" + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The dbmeta of sourceColumnInfo is difference from"; + msg = msg + " the one of Your First Source Column Info:" + + getLineSeparator(); + msg = msg + "- - - - -" + getLineSeparator(); + msg = msg + "sourceColumnInfo=" + sourceColumnInfo + + getLineSeparator(); + msg = msg + "firstSourceColumnInfo4Check=" + + firstSourceColumnInfo4Check + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + + /** + * Assert same source dbmeta. + * + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + protected void assertSameLocalDestinationDBMeta( + ColumnInfo destinationColumnInfo) { + if (!requestElementList.isEmpty()) { + final HierarchyRequestElement currentElement = currentElement(); + final List<RelationInfo> relationInfoList = currentElement + .getRelationInfoList(); + if (relationInfoList.isEmpty()) { + final DBMeta actualDBMeta = currentElement() + .getDestinationDBMeta(); + final DBMeta expectedDBMeta = destinationDBMeta; + if (!expectedDBMeta.equals(actualDBMeta)) { + String msg = "The wrong destinationColumnInfo!" + + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The dbmeta of destinationColumnInfo is difference from"; + msg = msg + " the one of Your Local Entity:" + + getLineSeparator(); + msg = msg + "- - - - -" + getLineSeparator(); + msg = msg + "destinationColumnInfo=" + + currentElement.getDestinationColumnInfo() + + getLineSeparator(); + msg = msg + "localEntity=" + + destinationDBMeta.getEntityTypeName() + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new IllegalStateException(msg); + } + } + } + } + + /** + * @param sourceList The list of source. (NotNull) + * @param <SOURCE> The type of source. (NotNull) + * @return Default source iterator. (NotNull) + */ + protected <SOURCE> HierarchySourceIterator createDefaultSourceIterator( + java.util.List<SOURCE> sourceList) { + return new HierarchySourceEntityListIterator<SOURCE>(sourceList); + } + + /** + * @param sourceColumnInfo The column info of source. (NotNull) + * @return Default source column. (NotNull) + */ + protected HierarchySourceColumn createDefaultSourceColumn( + ColumnInfo sourceColumnInfo) { + return new HierarchySourceEntityColumn(sourceColumnInfo); + } + + /** + * Get current element. + * + * @return Current element. (NotNull) + */ + protected HierarchyRequestElement currentElement() { + final int lastIndex = requestElementList.size() - 1; + return (HierarchyRequestElement) requestElementList.get(lastIndex); + } + + // ----------------------------------------------------- + // Internal + // -------- + /** + * @param relationPropertyKey Relation Property key. (NotNull) + * @return The list of request element. (NotNull) + */ + public List<HierarchyRequestElement> findPrimaryKeyElement( + String relationPropertyKey) { + final List<HierarchyRequestElement> resultList = new ArrayList<HierarchyRequestElement>(); + for (HierarchyRequestElement element : requestElementList) { + if (!relationPropertyKey.equals(element.getRelationPropertyKey())) { + continue; + } + final ColumnInfo destinationColumnInfo = element + .getDestinationColumnInfo(); + if (!destinationColumnInfo.isPrimary()) { + continue; + } + resultList.add(element); + } + if (resultList.isEmpty()) { + String msg = "Not found primary key element by relationPropertyKey in requestElementList: "; + msg = msg + " relationPropertyKey=" + relationPropertyKey + + " requestElementList=" + requestElementList; + throw new IllegalStateException(msg); + } + return resultList; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public DBMeta getDestinationDBMeta() { + return destinationDBMeta; + } + + public void setDestinationDBMeta(DBMeta destinationDBMeta) { + this.destinationDBMeta = destinationDBMeta; + } + + public List<HierarchyRequestElement> getRequestElementList() { + return requestElementList; + } + + public void addRequestElementList(HierarchyRequestElement element) { + this.requestElementList.add(element); + } + + public HierarchySourceIterator getSourceIterator() { + return sourceIterator; + } + + public void setSourceIterator(HierarchySourceIterator sourceIterator) { + this.sourceIterator = sourceIterator; + } + + //========================================================================== + // ========= + // Helper + // ====== + /** + * Get the value of line separator. + * + * @return The value of line separator. (NotNull) + */ + protected String getLineSeparator() { + return System.getProperty("line.separator"); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequest.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,132 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.RelationInfo; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class HierarchyRequestElement { + + //========================================================================== + // ========= + // Definition + // ========== + /** Top key. */ + public static final String TOP_KEY = "$top$"; + + //========================================================================== + // ========= + // Attribute + // ========= + /** The column of source. */ + protected HierarchySourceColumn sourceColumn; + + /** The dbmeta of destination. */ + protected DBMeta destinationDBMeta; + + /** The column info of destination. */ + protected ColumnInfo destinationColumnInfo; + + /** The list of relation info. */ + protected java.util.List<RelationInfo> relationInfoList = new java.util.ArrayList<RelationInfo>(); + + /** the list of relation property name. */ + protected java.util.List<String> relationPropertyNameList = new java.util.ArrayList<String>(); + + /** Relation property key. Default value is TOP_KEY. */ + protected String relationPropertyKey = TOP_KEY; + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + // ----------------------------------------------------- + // Internal + // -------- + /** + * Make mapping between the source column and the destination one. + * + * @param sourceColumn The column of source. (NotNull) + * @param destinationColumnInfo The column info of destination. (NotNull) + */ + public void mapping(HierarchySourceColumn sourceColumn, + ColumnInfo destinationColumnInfo) { + this.sourceColumn = sourceColumn; + this.destinationColumnInfo = destinationColumnInfo; + } + + /** + * Make relatetion by relation info. + * + * @param relationInfo Relation info. (NotNull) + */ + public void relation(RelationInfo relationInfo) { + addRelationInfoList(relationInfo); + } + + protected void addRelationInfoList(RelationInfo relationInfo) { + relationInfoList.add(relationInfo); + addRelationPropertyNameList(relationInfo.getRelationPropertyName()); + } + + protected void addRelationPropertyNameList(String relationPropertyName) { + relationPropertyNameList.add(relationPropertyName); + setupRelationPropertyKey(); + } + + protected void setupRelationPropertyKey() { + final StringBuilder sb = new StringBuilder(); + for (String relationPropertyName : relationPropertyNameList) { + if (sb.length() > 0) { + sb.append("_"); + } + sb.append(relationPropertyName); + } + this.relationPropertyKey = sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public HierarchySourceColumn getSourceColumnInfo() { + return sourceColumn; + } + + public void setSourceColumnInfo(HierarchySourceColumn sourceColumn) { + this.sourceColumn = sourceColumn; + } + + public void setDestinationDBMeta(DBMeta destinationDBMeta) { + this.destinationDBMeta = destinationDBMeta; + } + + public DBMeta getDestinationDBMeta() { + return destinationDBMeta; + } + + public ColumnInfo getDestinationColumnInfo() { + return destinationColumnInfo; + } + + public java.util.List<RelationInfo> getRelationInfoList() { + return relationInfoList; + } + + public List<String> getRelationPropertyNameList() { + return relationPropertyNameList; + } + + public String getRelationPropertyKey() { + return relationPropertyKey; + } + + public String toString() { + return sourceColumn + "," + destinationColumnInfo; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchyRequestElement.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,10 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface HierarchySourceColumn { + + public String getColumnName(); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceColumn.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface HierarchySourceIterator { + + public boolean hasNext(); + + public HierarchySourceRow next(); + + public HierarchySourceRow current(); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceIterator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,10 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface HierarchySourceRow { + + public Object extractColumnValue(HierarchySourceColumn columnInfo); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/HierarchySourceRow.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,24 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceColumn; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; + +/** + * @author DBFlute(AutoGenerator) + */ +public class HierarchySourceEntityColumn implements HierarchySourceColumn { + + protected ColumnInfo columnInfo; + + public HierarchySourceEntityColumn(ColumnInfo columnInfo) { + this.columnInfo = columnInfo; + } + + public String getColumnName() { + return columnInfo.getColumnDbName(); + } + + public java.lang.reflect.Method findGetter() { + return columnInfo.findGetter(); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityColumn.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,24 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + * @param <SOURCE_ROW> The type of source. + */ +public class HierarchySourceEntityListIterator<SOURCE_ROW> extends + HierarchySourceListIterator<SOURCE_ROW> { + + /** + * Constructor. + * + * @param sourceRowList The list of source row. (NotNull) + */ + public HierarchySourceEntityListIterator( + java.util.List<SOURCE_ROW> sourceRowList) { + super(sourceRowList, new HierarchySourceRowSetupper<SOURCE_ROW>() { + public jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceRow setup( + SOURCE_ROW source) { + return new HierarchySourceEntityRow(source); + } + }); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityListIterator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,48 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + */ +public class HierarchySourceEntityRow implements + jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceRow { + + protected Object sourceBean; + + public HierarchySourceEntityRow(Object sourceBean) { + this.sourceBean = sourceBean; + } + + public Object extractColumnValue( + jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceColumn columnInfo) { + if (!(columnInfo instanceof HierarchySourceEntityColumn)) { + String msg = "The column info should be HierarchySourceEntityColumn! but: " + + columnInfo; + throw new IllegalStateException(msg); + } + final HierarchySourceEntityColumn sourceEntityColumn = (HierarchySourceEntityColumn) columnInfo; + return invoke(sourceEntityColumn.findGetter(), sourceBean, + new Object[] {}); + } + + private Object invoke(java.lang.reflect.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); + } + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceEntityRow.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,40 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + * @param <SOURCE_ROW> The type of source. + */ +public class HierarchySourceListIterator<SOURCE_ROW> + implements + jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceIterator { + + protected java.util.List<? extends Object> sourceRowList; + + protected HierarchySourceRowSetupper<SOURCE_ROW> sourceRowSetupper; + + protected java.util.Iterator<SOURCE_ROW> sourceBeanListIterator; + + protected jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceRow currentSourceEntity; + + public HierarchySourceListIterator( + java.util.List<SOURCE_ROW> sourceRowList, + HierarchySourceRowSetupper<SOURCE_ROW> sourceRowSetupper) { + this.sourceRowList = sourceRowList; + this.sourceRowSetupper = sourceRowSetupper; + this.sourceBeanListIterator = sourceRowList.iterator(); + } + + public boolean hasNext() { + return this.sourceBeanListIterator.hasNext(); + } + + public jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceRow next() { + this.currentSourceEntity = this.sourceRowSetupper + .setup(this.sourceBeanListIterator.next()); + return this.currentSourceEntity; + } + + public jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceRow current() { + return this.currentSourceEntity; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceListIterator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,11 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.basic; + +/** + * @author DBFlute(AutoGenerator) + * @param <SOURCE_ROW> The type of source. + */ +public interface HierarchySourceRowSetupper<SOURCE_ROW> { + + public jp.sf.pal.scheduler.db.allcommon.dbmeta.hierarchy.HierarchySourceRow setup( + SOURCE_ROW source); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/hierarchy/basic/HierarchySourceRowSetupper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ColumnInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ColumnInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ColumnInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,217 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.info; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta.OptimisticLockType; + +/** + * The information of column. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class ColumnInfo { + + //========================================================================== + // ========= + // Attribute + // ========= + protected DBMeta dbmeta; + + protected String columnDbName; + + protected String propertyName; + + protected Class<?> propertyType; + + protected boolean primary; + + protected Integer columnSize; + + protected Integer columnDecimalDigits; + + protected OptimisticLockType optimisticLockType; + + //========================================================================== + // ========= + // Constructor + // =========== + public ColumnInfo(DBMeta dbmeta, String columnDbName) { + this(dbmeta, columnDbName, null, null, false, null, null); + } + + public ColumnInfo(DBMeta dbmeta, String columnDbName, String propertyName, + Class<?> propertyType, boolean primary, Integer columnSize) { + this(dbmeta, columnDbName, propertyName, propertyType, primary, + columnSize, null); + } + + public ColumnInfo(DBMeta dbmeta, String columnDbName, String propertyName, + Class<?> propertyType, boolean primary, Integer columnSize, + Integer columnDecimalDigits) { + this(dbmeta, columnDbName, propertyName, propertyType, primary, + columnSize, columnDecimalDigits, OptimisticLockType.NONE); + } + + public ColumnInfo(DBMeta dbmeta, String columnDbName, String propertyName, + Class<?> propertyType, boolean primary, Integer columnSize, + Integer columnDecimalDigits, OptimisticLockType optimisticLockType) { + this.dbmeta = dbmeta; + this.columnDbName = columnDbName; + this.propertyName = propertyName; + this.propertyType = propertyType; + this.primary = primary; + this.columnSize = columnSize; + this.columnDecimalDigits = columnDecimalDigits; + this.optimisticLockType = optimisticLockType; + } + + //========================================================================== + // ========= + // Builder + // ======= + public String buildInitCapPropertyName() { + return initCap(this.propertyName); + } + + //========================================================================== + // ========= + // Finder + // ====== + public java.lang.reflect.Method findSetter() { + return findMethod(dbmeta.getEntityType(), "set" + + buildInitCapPropertyName(), + new Class<?>[] { this.propertyType }); + } + + public java.lang.reflect.Method findGetter() { + return findMethod(dbmeta.getEntityType(), "get" + + buildInitCapPropertyName(), new Class<?>[] {}); + } + + //========================================================================== + // ========= + // Optimistic Lock Type + // ==================== + public boolean isOptimisticLock() { + return isVersionNo() || isUpdateDate(); + } + + public boolean isVersionNo() { + return OptimisticLockType.VERSION_NO == optimisticLockType; + } + + public boolean isUpdateDate() { + return OptimisticLockType.UPDATE_DATE == optimisticLockType; + } + + //========================================================================== + // ========= + // Internal Helper + // =============== + protected String initCap(final String name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + + protected java.lang.reflect.Method findMethod(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); + } + } + + //========================================================================== + // ========= + // Basic Override + // ============== + public int hashCode() { + return dbmeta.hashCode() + columnDbName.hashCode(); + } + + public boolean equals(Object obj) { + if (!(obj instanceof ColumnInfo)) { + return false; + } + final ColumnInfo target = (ColumnInfo) obj; + if (this.dbmeta == null || target.getDBMeta() == null) { + return false; + } + if (!this.dbmeta.equals(target.getDBMeta())) { + return false; + } + if (this.columnDbName == null || target.getColumnDbName() == null) { + return false; + } + if (!this.columnDbName.equals(target.getColumnDbName())) { + return false; + } + return true; + } + + public String toString() { + return dbmeta.getTableDbName() + "." + columnDbName; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public DBMeta getDBMeta() { + return dbmeta; + } + + public void setDBMeta(DBMeta dbmeta) { + this.dbmeta = dbmeta; + } + + public String getColumnDbName() { + return this.columnDbName; + } + + public void setColumnDbName(String columnDbName) { + this.columnDbName = columnDbName; + } + + public String getPropertyName() { + return this.propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + } + + public Class<?> getPropertyType() { + return this.propertyType; + } + + public void setPropertyType(Class<?> propertyType) { + this.propertyType = propertyType; + } + + public boolean isPrimary() { + return this.primary; + } + + public void setPrimary(boolean primary) { + this.primary = primary; + } + + public Integer getColumnSize() { + return this.columnSize; + } + + public void setColumnSize(Integer columnSize) { + this.columnSize = columnSize; + } + + public Integer getColumnDecimalDigits() { + return this.columnDecimalDigits; + } + + public void setColumnDecimalDigits(Integer columnDecimalDigits) { + this.columnDecimalDigits = columnDecimalDigits; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ColumnInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ForeignInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ForeignInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ForeignInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,175 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.info; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +/** + * The class of foreign information. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class ForeignInfo implements RelationInfo { + + //========================================================================== + // ========= + // Attribute + // ========= + protected String foreignPropertyName; + + protected DBMeta localDBMeta; + + protected DBMeta foreignDBMeta; + + protected java.util.Map<ColumnInfo, ColumnInfo> localForeignColumnInfoMap; + + protected java.util.Map<ColumnInfo, ColumnInfo> foreignLocalColumnInfoMap; + + protected int relationNo; + + protected boolean oneToOne; + + //========================================================================== + // ========= + // Finder + // ====== + public ColumnInfo findLocalByForeign(String foreignColumnDbName) { + final ColumnInfo keyColumnInfo = new ColumnInfo(foreignDBMeta, + foreignColumnDbName); + final ColumnInfo resultColumnInfo = (ColumnInfo) foreignLocalColumnInfoMap + .get(keyColumnInfo); + if (resultColumnInfo == null) { + String msg = "Not found by foreignColumnDbName in foreignLocalColumnInfoMap:"; + msg = msg + " foreignColumnDbName=" + foreignColumnDbName + + " foreignLocalColumnInfoMap=" + foreignLocalColumnInfoMap; + throw new IllegalArgumentException(msg); + } + return resultColumnInfo; + } + + //========================================================================== + // ========= + // Builder + // ======= + public String buildInitCapPropertyName() { + return initCap(this.foreignPropertyName); + } + + //========================================================================== + // ========= + // Finder + // ====== + public java.lang.reflect.Method findSetter() { + return findMethod(localDBMeta.getEntityType(), "set" + + buildInitCapPropertyName(), + new Class[] { java.util.List.class }); + } + + public java.lang.reflect.Method findGetter() { + return findMethod(localDBMeta.getEntityType(), "get" + + buildInitCapPropertyName(), new Class[] {}); + } + + //========================================================================== + // ========= + // Implement + // ========= + public String getRelationPropertyName() { + return getForeignPropertyName(); + } + + public DBMeta getTargetDBMeta() { + return getForeignDBMeta(); + } + + public java.util.Map<ColumnInfo, ColumnInfo> getLocalTargetColumnInfoMap() { + return getLocalForeignColumnInfoMap(); + } + + public boolean isReferrer() { + return false; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getForeignPropertyName() { + return foreignPropertyName; + } + + public void setForeignPropertyName(String foreignPropertyName) { + this.foreignPropertyName = foreignPropertyName; + } + + public DBMeta getLocalDBMeta() { + return localDBMeta; + } + + public void setLocalDBMeta(DBMeta localDBMeta) { + this.localDBMeta = localDBMeta; + } + + public DBMeta getForeignDBMeta() { + return foreignDBMeta; + } + + public void setForeignDBMeta(DBMeta foreignDBMeta) { + this.foreignDBMeta = foreignDBMeta; + } + + public java.util.Map<ColumnInfo, ColumnInfo> getLocalForeignColumnInfoMap() { + return localForeignColumnInfoMap; + } + + public void setLocalForeignColumnInfoMap( + java.util.Map<ColumnInfo, ColumnInfo> localForeignColumnInfoMap) { + this.localForeignColumnInfoMap = localForeignColumnInfoMap; + final java.util.Set keySet = localForeignColumnInfoMap.keySet(); + foreignLocalColumnInfoMap = new java.util.LinkedHashMap<ColumnInfo, ColumnInfo>(); + for (final java.util.Iterator ite = keySet.iterator(); ite.hasNext();) { + final ColumnInfo key = (ColumnInfo) ite.next(); + final ColumnInfo value = (ColumnInfo) localForeignColumnInfoMap + .get(key); + foreignLocalColumnInfoMap.put(value, key); + } + } + + public java.util.Map<ColumnInfo, ColumnInfo> getForeignLocalColumnInfoMap() { + return foreignLocalColumnInfoMap; + } + + public int getRelationNo() { + return relationNo; + } + + public void setRelationNo(int relationNo) { + this.relationNo = relationNo; + } + + public boolean isOneToOne() { + return oneToOne; + } + + public void setOneToOne(boolean oneToOne) { + this.oneToOne = oneToOne; + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected java.lang.reflect.Method findMethod(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 String initCap(final String name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ForeignInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ReferrerInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ReferrerInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ReferrerInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,181 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.info; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +/** + * The class of referrer information. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class ReferrerInfo implements RelationInfo { + + //========================================================================== + // ========= + // Attribute + // ========= + protected String referrerPropertyName; + + protected DBMeta localDBMeta; + + protected DBMeta referrerDBMeta; + + protected java.util.Map<ColumnInfo, ColumnInfo> localReferrerColumnInfoMap; + + protected java.util.Map<ColumnInfo, ColumnInfo> referrerLocalColumnInfoMap; + + protected boolean oneToOne; + + //========================================================================== + // ========= + // Finder + // ====== + public ColumnInfo findLocalByReferrer(String referrerColumnDbName) { + final ColumnInfo keyColumnInfo = new ColumnInfo(referrerDBMeta, + referrerColumnDbName); + final ColumnInfo resultColumnInfo = (ColumnInfo) referrerLocalColumnInfoMap + .get(keyColumnInfo); + if (resultColumnInfo == null) { + String msg = "Not found by referrerColumnDbName in referrerLocalColumnInfoMap:"; + msg = msg + " referrerColumnDbName=" + referrerColumnDbName + + " referrerLocalColumnInfoMap=" + + referrerLocalColumnInfoMap; + throw new IllegalArgumentException(msg); + } + return resultColumnInfo; + } + + public ColumnInfo findReferrerByLocal(String localColumnDbName) { + final ColumnInfo keyColumnInfo = new ColumnInfo(localDBMeta, + localColumnDbName); + final ColumnInfo resultColumnInfo = (ColumnInfo) localReferrerColumnInfoMap + .get(keyColumnInfo); + if (resultColumnInfo == null) { + String msg = "Not found by localColumnDbName in localReferrerColumnInfoMap:"; + msg = msg + " localColumnDbName=" + localColumnDbName + + " localReferrerColumnInfoMap=" + + localReferrerColumnInfoMap; + throw new IllegalArgumentException(msg); + } + return resultColumnInfo; + } + + //========================================================================== + // ========= + // Builder + // ======= + public String buildInitCapPropertyName() { + return initCap(this.referrerPropertyName); + } + + //========================================================================== + // ========= + // Finder + // ====== + public java.lang.reflect.Method findSetter() { + return findMethod(localDBMeta.getEntityType(), "set" + + buildInitCapPropertyName(), + new Class[] { java.util.List.class }); + } + + public java.lang.reflect.Method findGetter() { + return findMethod(localDBMeta.getEntityType(), "get" + + buildInitCapPropertyName(), new Class[] {}); + } + + //========================================================================== + // ========= + // Implement + // ========= + public String getRelationPropertyName() { + return getReferrerPropertyName(); + } + + public DBMeta getTargetDBMeta() { + return getReferrerDBMeta(); + } + + public java.util.Map<ColumnInfo, ColumnInfo> getLocalTargetColumnInfoMap() { + return getLocalReferrerColumnInfoMap(); + } + + public boolean isReferrer() { + return true; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getReferrerPropertyName() { + return referrerPropertyName; + } + + public void setReferrerPropertyName(String referrerPropertyName) { + this.referrerPropertyName = referrerPropertyName; + } + + public DBMeta getLocalDBMeta() { + return localDBMeta; + } + + public void setLocalDBMeta(DBMeta localDBMeta) { + this.localDBMeta = localDBMeta; + } + + public DBMeta getReferrerDBMeta() { + return referrerDBMeta; + } + + public void setReferrerDBMeta(DBMeta referrerDBMeta) { + this.referrerDBMeta = referrerDBMeta; + } + + public java.util.Map<ColumnInfo, ColumnInfo> getLocalReferrerColumnInfoMap() { + return localReferrerColumnInfoMap; + } + + public void setLocalReferrerColumnInfoMap( + java.util.Map<ColumnInfo, ColumnInfo> localReferrerColumnInfoMap) { + this.localReferrerColumnInfoMap = localReferrerColumnInfoMap; + final java.util.Set keySet = localReferrerColumnInfoMap.keySet(); + referrerLocalColumnInfoMap = new java.util.LinkedHashMap<ColumnInfo, ColumnInfo>(); + for (final java.util.Iterator ite = keySet.iterator(); ite.hasNext();) { + final ColumnInfo key = (ColumnInfo) ite.next(); + final ColumnInfo value = (ColumnInfo) localReferrerColumnInfoMap + .get(key); + referrerLocalColumnInfoMap.put(value, key); + } + } + + public java.util.Map<ColumnInfo, ColumnInfo> getReferrerLocalColumnInfoMap() { + return referrerLocalColumnInfoMap; + } + + public boolean isOneToOne() { + return oneToOne; + } + + public void setOneToOne(boolean oneToOne) { + this.oneToOne = oneToOne; + } + + //========================================================================== + // ========= + // Internal Helper + // =============== + protected String initCap(final String name) { + return name.substring(0, 1).toUpperCase() + name.substring(1); + } + + protected java.lang.reflect.Method findMethod(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); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/ReferrerInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/RelationInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/RelationInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/RelationInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,24 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.info; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +/** + * The class of referer information. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RelationInfo { + + public String getRelationPropertyName(); + + public DBMeta getLocalDBMeta(); + + public DBMeta getTargetDBMeta(); + + public java.util.Map<ColumnInfo, ColumnInfo> getLocalTargetColumnInfoMap(); + + public boolean isOneToOne(); + + public boolean isReferrer(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/RelationInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/UniqueInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/UniqueInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/UniqueInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,77 @@ +package jp.sf.pal.scheduler.db.allcommon.dbmeta.info; + +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +/** + * The class of unique info. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UniqueInfo { + + //========================================================================== + // ========= + // Attribute + // ========= + protected DBMeta dbmeta; + + protected java.util.List<ColumnInfo> uniqueColumnList = new java.util.ArrayList<ColumnInfo>(); + + protected boolean primary; + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + public boolean containsColumn(String columnName) { + for (final java.util.Iterator ite = uniqueColumnList.iterator(); ite + .hasNext();) { + final ColumnInfo columnInfo = (ColumnInfo) ite.next(); + if (columnInfo.getColumnDbName().equals(columnName)) { + return true; + } + } + return false; + } + + public boolean containsColumn(ColumnInfo column) { + return containsColumn(column.getColumnDbName()); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public DBMeta getDBMeta() { + return dbmeta; + } + + public void setDBMeta(DBMeta dbmeta) { + this.dbmeta = dbmeta; + } + + public java.util.List<ColumnInfo> getUniqueColumnList() { + return uniqueColumnList; + } + + public void addUniqueColumnList(ColumnInfo uniqueColumn) { + this.uniqueColumnList.add(uniqueColumn); + } + + public ColumnInfo getFirstColumn() { + return (ColumnInfo) this.uniqueColumnList.get(0); + } + + public boolean isTwoOrMore() { + return this.uniqueColumnList.size() > 1; + } + + public boolean isPrimary() { + return this.primary; + } + + public void setPrimary(boolean primary) { + this.primary = primary; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/dbmeta/info/UniqueInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BatchEntityAlreadyUpdatedException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BatchEntityAlreadyUpdatedException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BatchEntityAlreadyUpdatedException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the entity has already been updated by other thread in + * batch update. + * + * @author DBFlute(AutoGenerator) + */ +public class BatchEntityAlreadyUpdatedException extends + EntityAlreadyUpdatedException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Attribute + // ========= + protected Integer _batchUpdateCount; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param bean Bean. (NotNull) + * @param rows Rows(Update count per One entity). + * @param batchUpdateCount Batch update count(Total). + */ + public BatchEntityAlreadyUpdatedException(Object bean, int rows, + Integer batchUpdateCount) { + super(bean, rows); + _batchUpdateCount = batchUpdateCount; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public Integer getBatchUpdateCount() { + return _batchUpdateCount; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BatchEntityAlreadyUpdatedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,34 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the property on bind variable comment is not found + * about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class BindVariableCommentNotFoundPropertyException extends + RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public BindVariableCommentNotFoundPropertyException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public BindVariableCommentNotFoundPropertyException(String msg, + Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableCommentNotFoundPropertyException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableParameterNullValueException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableParameterNullValueException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableParameterNullValueException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the value of bind variable is null about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class BindVariableParameterNullValueException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public BindVariableParameterNullValueException(String msg) { + super(msg); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/BindVariableParameterNullValueException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/DangerousResultSizeException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/DangerousResultSizeException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/DangerousResultSizeException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,36 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the result size is dangerous. + * + * @author DBFlute(AutoGenerator) + */ +public class DangerousResultSizeException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** Safety max result size. */ + protected int _safetyMaxResultSize; + + /** + * Constructor. + * + * @param msg Exception message. + * @param safetyMaxResultSize Safety max result size. + * @param selectedCount Selected count. + */ + public DangerousResultSizeException(String msg, int safetyMaxResultSize) { + super(msg); + this._safetyMaxResultSize = safetyMaxResultSize; + } + + /** + * Get safety max result size. + * + * @return Safety max result size. + */ + public int getSafetyMaxResultSize() { + return _safetyMaxResultSize; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/DangerousResultSizeException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,34 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the property on embedded value comment is not found + * about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class EmbeddedValueCommentNotFoundPropertyException extends + RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public EmbeddedValueCommentNotFoundPropertyException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public EmbeddedValueCommentNotFoundPropertyException(String msg, + Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueCommentNotFoundPropertyException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueParameterNullValueException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueParameterNullValueException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueParameterNullValueException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the value of embedded value is null about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class EmbeddedValueParameterNullValueException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public EmbeddedValueParameterNullValueException(String msg) { + super(msg); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EmbeddedValueParameterNullValueException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EndCommentNotFoundException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EndCommentNotFoundException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EndCommentNotFoundException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the end comment is not found about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class EndCommentNotFoundException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public EndCommentNotFoundException(String msg) { + super(msg); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EndCommentNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyDeletedException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyDeletedException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyDeletedException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,22 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the entity has already been deleted by other thread. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityAlreadyDeletedException extends + RecordHasAlreadyBeenDeletedException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public EntityAlreadyDeletedException(String msg) { + super(msg); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyDeletedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyExistsException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyExistsException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyExistsException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,25 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +import java.sql.SQLException; + +/** + * The exception of when the entity already exists on the database. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityAlreadyExistsException extends SQLFailureException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause SQLException. (NotNull) + */ + public EntityAlreadyExistsException(String msg, SQLException cause) { + super(msg, cause); + sqlEx = cause; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyExistsException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyUpdatedException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyUpdatedException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyUpdatedException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,38 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +import org.seasar.dao.NotSingleRowUpdatedRuntimeException; + +/** + * The exception of when the entity has already been updated by other thread. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityAlreadyUpdatedException extends + NotSingleRowUpdatedRuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param bean Bean. (NotNull) + * @param rows Rows. + */ + public EntityAlreadyUpdatedException(Object bean, int rows) { + super(bean, rows); + } + + /** + * Constructor. + * + * @param e NotSingleRowUpdatedRuntimeException. (NotNull) + */ + public EntityAlreadyUpdatedException(NotSingleRowUpdatedRuntimeException e) { + super(e.getBean(), e.getRows()); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityAlreadyUpdatedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityDuplicatedException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityDuplicatedException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityDuplicatedException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the entity has been duplicated. + * + * @author DBFlute(AutoGenerator) + */ +public class EntityDuplicatedException extends RecordHasOverlappedException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public EntityDuplicatedException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public EntityDuplicatedException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/EntityDuplicatedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentConditionNotFoundException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentConditionNotFoundException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentConditionNotFoundException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,23 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the condition of IF comment is not found about + * outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class IfCommentConditionNotFoundException extends + IfCommentWrongExpressionException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public IfCommentConditionNotFoundException(String msg) { + super(msg); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentConditionNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentNotBooleanResultException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentNotBooleanResultException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentNotBooleanResultException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,33 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the result of IF comment is not boolean about + * outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class IfCommentNotBooleanResultException extends + IfCommentWrongExpressionException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public IfCommentNotBooleanResultException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public IfCommentNotBooleanResultException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentNotBooleanResultException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentWrongExpressionException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentWrongExpressionException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentWrongExpressionException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the IF comment has a wrong expression about outsideSql. + * + * @author DBFlute(AutoGenerator) + */ +public class IfCommentWrongExpressionException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + */ + public IfCommentWrongExpressionException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause Throwable. + */ + public IfCommentWrongExpressionException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/IfCommentWrongExpressionException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/OutsideSqlNotFoundException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/OutsideSqlNotFoundException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/OutsideSqlNotFoundException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the outside-sql is not found. + * + * @author DBFlute(AutoGenerator) + */ +public class OutsideSqlNotFoundException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public OutsideSqlNotFoundException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public OutsideSqlNotFoundException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/OutsideSqlNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,22 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception when the record has already been deleted (by other thread). <br + * /> This class is old. + * + * @author DBFlute(AutoGenerator) + */ +public class RecordHasAlreadyBeenDeletedException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public RecordHasAlreadyBeenDeletedException(String msg) { + super(msg); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasAlreadyBeenDeletedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasOverlappedException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasOverlappedException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasOverlappedException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception when the record has overlapped. This class is old. + * + * @author DBFlute(AutoGenerator) + */ +public class RecordHasOverlappedException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public RecordHasOverlappedException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public RecordHasOverlappedException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RecordHasOverlappedException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RequiredOptionNotFoundException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RequiredOptionNotFoundException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RequiredOptionNotFoundException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +/** + * The exception of when the required option is not found. + * + * @author DBFlute(AutoGenerator) + */ +public class RequiredOptionNotFoundException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** + * Constructor. + * + * @param msg Exception message. + */ + public RequiredOptionNotFoundException(String msg) { + super(msg); + } + + /** + * Constructor. + * + * @param msg Exception message. + * @param cause Throwable. + */ + public RequiredOptionNotFoundException(String msg, Throwable cause) { + super(msg, cause); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/RequiredOptionNotFoundException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/SQLFailureException.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/SQLFailureException.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/SQLFailureException.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,31 @@ +package jp.sf.pal.scheduler.db.allcommon.exception; + +import java.sql.SQLException; + +/** + * The exception of when the SQL failed to execute. + * + * @author DBFlute(AutoGenerator) + */ +public class SQLFailureException extends RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + protected SQLException sqlEx; + + /** + * Constructor. + * + * @param msg Exception message. (NotNull) + * @param cause SQLException. (NotNull) + */ + public SQLFailureException(String msg, SQLException cause) { + super(msg, cause); + sqlEx = cause; + } + + public SQLException getSQLException() { + return sqlEx; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/exception/SQLFailureException.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListString.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListString.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListString.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,105 @@ +package jp.sf.pal.scheduler.db.allcommon.helper; + +import java.util.List; +import java.util.Map; + +/** + * MapList-String. + * <p> + * + * <pre> + * # Interface that offers generation of map and list from the following character strings (map list string). + * # + * # ex) map:{key1=value1,key2=list:{value21,value22,value23},key3=map:{key31=value31}} + * # ex) list:{key1=value1,key2=list:{value21,value22,value23},key3=map:{key31=value31}} + * # + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public interface MapListString { + + /** Default of map-mark. */ + public static final String DEFAULT_MAP_MARK = "map:"; + + /** Default of list-mark. */ + public static final String DEFAULT_LIST_MARK = "list:"; + + /** Default of start-brace. */ + public static final String DEFAULT_START_BRACE = "{"; + + /** Default of end-brace. */ + public static final String DEFAULT_END_BRACE = "}"; + + /** Default of delimter. */ + public static final String DEFAULT_DELIMITER = ";"; + + /** Default of equal. */ + public static final String DEFAULT_EQUAL = "="; + + //========================================================================== + // ================ + // Setter + // ====== + /** + * Set map-mark. + * + * @param mapMark Map-mark. (NotNull) + */ + public void setMapMark(String mapMark); + + /** + * Set list-mark. + * + * @param listMark List-mark. (NotNull) + */ + public void setListMark(String listMark); + + /** + * Set start brace. + * + * @param startBrace Start brace. (NotNull) + */ + public void setStartBrace(String startBrace); + + /** + * Set end brace. + * + * @param endBrace End brace. (NotNull) + */ + public void setEndBrace(String endBrace); + + /** + * Set delimiter. + * + * @param delimiter Delimiter. (NotNull) + */ + public void setDelimiter(String delimiter); + + /** + * Set equal. + * + * @param equal Equal. (NotNull) + */ + public void setEqual(String equal); + + //========================================================================== + // ================ + // Generate + // ======== + /** + * Generate map from map-string. + * + * @param mapString Map-string (NotNull) + * @return Generated map. (NotNull) + */ + public Map<String, Object> generateMap(String mapString); + + /** + * Generate map from list-string. {Implement} + * + * @param listString List-string (NotNull) + * @return Generated list. (NotNull) + */ + public List<Object> generateList(String listString); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListString.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListStringImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListStringImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListStringImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1079 @@ +package jp.sf.pal.scheduler.db.allcommon.helper; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * The implementation of MapList-String. + * + * @author DBFlute(AutoGenerator) + */ +public class MapListStringImpl implements MapListString { + + /** Line separator. */ + public static final String NEW_LINE = System.getProperty("line.separator"); + + /** Map-mark. */ + protected String _mapMark; + + /** List-mark. */ + protected String _listMark; + + /** Start-brace. */ + protected String _startBrace; + + /** End-brace. */ + protected String _endBrace; + + /** Delimiter. */ + protected String _delimiter; + + /** Equal. */ + protected String _equal; + + /** Top string. */ + protected String _topString; + + /** Remainder string. */ + protected String _remainderString; + + /** + * Constructor. + */ + public MapListStringImpl() { + _mapMark = DEFAULT_MAP_MARK; + _listMark = DEFAULT_LIST_MARK; + _startBrace = DEFAULT_START_BRACE; + _endBrace = DEFAULT_END_BRACE; + _delimiter = DEFAULT_DELIMITER; + _equal = DEFAULT_EQUAL; + } + + //========================================================================== + // ================ + // Setter + // ====== + /** + * Set map-mark. + * + * @param mapMark Map mark. (NotNull) + */ + public void setMapMark(String mapMark) { + _mapMark = mapMark; + } + + /** + * Set list-mark. + * + * @param listMark List mark. (NotNull) + */ + public void setListMark(String listMark) { + _listMark = listMark; + } + + /** + * Set start-brace. + * + * @param startBrace Start-brace. (NotNull) + */ + public synchronized void setStartBrace(String startBrace) { + _startBrace = startBrace; + } + + /** + * Set end-brace. + * + * @param endBrace End-brace. (NotNull) + */ + public synchronized void setEndBrace(String endBrace) { + _endBrace = endBrace; + } + + /** + * Set delimiter. + * + * @param delimiter Delimiter. (NotNull) + */ + public synchronized void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + /** + * Set equal. + * + * @param equal Equal. (NotNull) + */ + public void setEqual(String equal) { + _equal = equal; + } + + //************************************************************************** + // ************************** + // Main Method + // *********** + + //========================================================================== + // ================ + // Generate + // ======== + /** + * Generate map from map-string. {Implement} + * + * @param mapString Map-string (NotNull) + * @return Generated map. (NotNull) + */ + public synchronized Map<String, Object> generateMap(String mapString) { + assertMapString(mapString); + + _topString = mapString; + _remainderString = mapString; + + removeBothSideSpaceAndTabAndNewLine(); + removePrefixMapMarkAndStartBrace(); + + final Map<String, Object> generatedMap = newStringObjectMap(); + parseRemainderMapString(generatedMap); + if (!"".equals(_remainderString)) { + String msg = "Final remainderString must be empty string:"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # mapString --> " + mapString; + msg = msg + getNewLineAndIndent() + " # generatedMap --> " + + generatedMap; + throw new IllegalStateException(msg); + } + return generatedMap; + } + + /** + * Generate map from list-string. {Implement} + * + * @param listString List-string (NotNull) + * @return Generated list. (NotNull) + */ + public synchronized List<Object> generateList(String listString) { + assertListString(listString); + + _topString = listString; + _remainderString = listString; + + removeBothSideSpaceAndTabAndNewLine(); + removePrefixListMarkAndStartBrace(); + + final List<Object> generatedList = newObjectList(); + parseRemainderListString(generatedList); + if (!"".equals(_remainderString)) { + String msg = "Final remainderString must be empty string:"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString; + msg = msg + getNewLineAndIndent() + " # generatedList --> " + + generatedList; + throw new IllegalStateException(msg); + } + return generatedList; + } + + //========================================================================== + // ================ + // Parse + // ===== + /** + * Parse remainder map string. + * + * @param currentMap current map. + */ + protected void parseRemainderMapString(final Map<String, Object> currentMap) { + while (true) { + if (initializeAtLoopBeginning()) { + return; + } + + // *** Now, _remainderString should starts with the key of the map. + // *** + + final int equalIndex = _remainderString.indexOf(_equal); + assertEqualIndex(_remainderString, equalIndex, _topString, + currentMap); + final String mapKey = _remainderString.substring(0, equalIndex) + .trim(); + removePrefixTargetIndexPlus(equalIndex, _equal.length()); + removeBothSideSpaceAndTabAndNewLine(); + + // *** Now, _remainderString should starts with the value of the + // map. *** + + if (isStartsWithMapPrefix(_remainderString)) { + removePrefixMapMarkAndStartBrace(); + parseRemainderMapString(setupNestMap(currentMap, mapKey)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + if (isStartsWithListPrefix(_remainderString)) { + removePrefixListMarkAndStartBrace(); + parseRemainderListString(setupNestList(currentMap, mapKey)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + final int delimiterIndex = _remainderString.indexOf(_delimiter); + final int endBraceIndex = _remainderString.indexOf(_endBrace); + assertEndBracekIndex(_remainderString, endBraceIndex, _topString, + currentMap); + + // If delimiter exists and delimiter is closer than end brace, + // Everything from the head of the present remainder string to the + // delimiter becomes map value. + // ex) value1,key2=value2} + if (delimiterIndex >= 0 && delimiterIndex < endBraceIndex) { + final String mapValue = _remainderString.substring(0, + delimiterIndex); + currentMap.put(mapKey, filterMapListValue(mapValue)); + + // Because the map element continues since the delimiter, skip + // the delimiter and continue the loop. + removePrefixTargetIndexPlus(delimiterIndex, _delimiter.length()); + continue; + } + + // Everything from the head of the present remainder string to the + // delimiter becomes map value. + // ex) value1}, key2=value2} + final String mapValue = _remainderString + .substring(0, endBraceIndex); + currentMap.put(mapKey, filterMapListValue(mapValue)); + + // Analyzing map is over. So closing and return. + closingByEndBraceIndex(endBraceIndex); + return; + } + } + + /** + * Parse remainder list string. + * + * @param currentList current list. + */ + protected void parseRemainderListString(final List<Object> currentList) { + while (true) { + if (initializeAtLoopBeginning()) { + return; + } + + // *** Now, _remainderString should starts with the value of the + // list. *** + + if (isStartsWithMapPrefix(_remainderString)) { + removePrefixMapMarkAndStartBrace(); + parseRemainderMapString(setupNestMap(currentList)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + if (isStartsWithListPrefix(_remainderString)) { + removePrefixListMarkAndStartBrace(); + parseRemainderListString(setupNestList(currentList)); + if (closingAfterParseNestMapList()) { + return; + } + continue; + } + + final int delimiterIndex = _remainderString.indexOf(_delimiter); + final int endBraceIndex = _remainderString.indexOf(_endBrace); + assertEndBraceIndex(_remainderString, endBraceIndex, _topString, + currentList); + + // If delimiter exists and delimiter is closer than end brace, + // Everything from the head of the present remainder string to the + // delimiter becomes list value. + // ex) value1,value2,value3} + if (delimiterIndex >= 0 && delimiterIndex < endBraceIndex) { + final String listValue = _remainderString.substring(0, + delimiterIndex); + currentList.add(filterMapListValue(listValue)); + + // Because the list element continues since the delimiter, skip + // the delimiter and continue the loop. + removePrefixTargetIndexPlus(delimiterIndex, _delimiter.length()); + continue; + } + + // Everything from the head of the present remainder string to the + // delimiter becomes list value. + // ex) value1}, value2, } + final String listValue = _remainderString.substring(0, + endBraceIndex); + currentList.add(filterMapListValue(listValue)); + + // Analyzing list is over. So closing and return. + closingByEndBraceIndex(endBraceIndex); + return; + } + } + + /** + * Initialize at loop beginning. + * + * @return Is return? + */ + protected boolean initializeAtLoopBeginning() { + // Remove prefix delimiter. (Result string is always trimmed.) + removePrefixAllDelimiter(); + + // If the remainder string is empty-string, Analyzing is over! + if (_remainderString.equals("")) { + return true; + } + + // If the remainder string starts with end-brace, Analyzing current map + // is over! + // And then remove the end-brace. + if (isStartsWithEndBrace(_remainderString)) { + removePrefixEndBrace(); + return true; + } + return false; + } + + /** + * Close after parse nest map list. + * + * @return Is return? + */ + protected boolean closingAfterParseNestMapList() { + // If the remainder string starts with end-brace, remove it and return + // true. + if (isStartsWithEndBrace(_remainderString)) { + removePrefixEndBrace(); + return true; + } + return false; + } + + /** + * Close by end-brace index. + * + * @param endBraceIndex End-brace index. + */ + protected void closingByEndBraceIndex(int endBraceIndex) { + // Remove the value that was finished analyzing and end-brace. + _remainderString = _remainderString.substring(endBraceIndex); + removePrefixEndBrace(); + } + + //************************************************************************** + // ************************** + // StateFul Method + // *************** + + //========================================================================== + // ================ + // Remove + // ====== + /** + * Remove prefix map-mark and start-brace. + */ + protected void removePrefixMapMarkAndStartBrace() { + removePrefix(_mapMark + _startBrace); + } + + /** + * Remove prefix list-mark and start-brace. + */ + protected void removePrefixListMarkAndStartBrace() { + removePrefix(_listMark + _startBrace); + } + + /** + * Remove prefix delimiter. + */ + protected void removePrefixDelimiter() { + removePrefix(_delimiter); + } + + /** + * Remove prefix end-brace. + */ + protected void removePrefixEndBrace() { + removePrefix(_endBrace); + } + + /** + * Remove prefix. + * + * @param prefixString Prefix string. (NotNull) + */ + protected void removePrefix(String prefixString) { + if (_remainderString == null) { + String msg = "Argument[remainderString] must not be null: " + + _remainderString; + throw new IllegalArgumentException(msg); + } + if (prefixString == null) { + String msg = "Argument[prefixString] must not be null: " + + prefixString; + throw new IllegalArgumentException(msg); + } + + removeBothSideSpaceAndTabAndNewLine(); + + if (_remainderString.length() < prefixString.length()) { + String msg = "Argument[remainderString] length must be larger than Argument[prefixString] length:"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # prefixString=" + + prefixString; + throw new IllegalArgumentException(msg); + } + if (!_remainderString.startsWith(prefixString)) { + String msg = "Argument[remainderString] must start with Argument[prefixString:]"; + msg = msg + getNewLineAndIndent() + " # remainderString --> " + + _remainderString; + msg = msg + getNewLineAndIndent() + " # prefixString --> " + + prefixString; + throw new IllegalArgumentException(msg); + } + + _remainderString = _remainderString.substring(prefixString.length()); + removeBothSideSpaceAndTabAndNewLine(); + } + + /** + * Remove prefix and delimiter. + */ + protected void removePrefixAllDelimiter() { + removeBothSideSpaceAndTabAndNewLine(); + + while (true) { + if (!isStartsWithDelimiter(_remainderString)) { + break; + } + + if (isStartsWithDelimiter(_remainderString)) { + removePrefixDelimiter(); + removeBothSideSpaceAndTabAndNewLine(); + } + } + } + + /** + * Remove both side space and tab and new-line. + */ + protected void removeBothSideSpaceAndTabAndNewLine() { + _remainderString = _remainderString.trim(); + } + + /** + * Remove prefix (target index plus one). + * + * @param index Index. + * @param plusCount Plus count. + */ + protected void removePrefixTargetIndexPlus(int index, int plusCount) { + _remainderString = _remainderString.substring(index + plusCount); + } + + //************************************************************************** + // ************************** + // StateLess Method + // **************** + + //========================================================================== + // ================ + // Assert + // ====== + /** + * Assert map-string. + * + * @param mapString Map-string. (NotNull) + */ + protected void assertMapString(String mapString) { + if (mapString == null) { + String msg = "Argument[mapString] must not be null: "; + throw new IllegalArgumentException(msg + "mapString=" + mapString); + } + mapString = mapString.trim(); + if (!isStartsWithMapPrefix(mapString)) { + String msg = "Argument[mapString] must start with '" + _mapMark + + _startBrace + "': "; + throw new IllegalArgumentException(msg + "mapString=" + mapString); + } + if (!isEndsWithEndBrace(mapString)) { + String msg = "Argument[mapString] must end with '" + _endBrace + + "': "; + throw new IllegalArgumentException(msg + "mapString=" + mapString); + } + + final int startBraceCount = getDelimiterCount(mapString, _startBrace); + final int endBraceCount = getDelimiterCount(mapString, _endBrace); + if (startBraceCount != endBraceCount) { + String msg = "It is necessary to have braces of the same number on start and end:"; + msg = msg + getNewLineAndIndent() + " # mapString --> " + mapString; + msg = msg + getNewLineAndIndent() + " # startBraceCount --> " + + startBraceCount; + msg = msg + getNewLineAndIndent() + " # endBraceCount --> " + + endBraceCount; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert list-string. + * + * @param listString List-string. (NotNull) + */ + protected void assertListString(String listString) { + if (listString == null) { + String msg = "Argument[listString] must not be null: "; + throw new IllegalArgumentException(msg + "listString=" + listString); + } + listString = listString.trim(); + if (!isStartsWithListPrefix(listString)) { + String msg = "Argument[listString] must start with '" + _mapMark + + "': "; + throw new IllegalArgumentException(msg + "listString=" + listString); + } + if (!isEndsWithEndBrace(listString)) { + String msg = "Argument[listString] must end with '" + _endBrace + + "': "; + throw new IllegalArgumentException(msg + "listString=" + listString); + } + + final int startBraceCount = getDelimiterCount(listString, _startBrace); + final int endBraceCount = getDelimiterCount(listString, _endBrace); + if (startBraceCount != endBraceCount) { + String msg = "It is necessary to have braces of the same number on start and end:"; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString; + msg = msg + getNewLineAndIndent() + " # startBraceCount --> " + + startBraceCount; + msg = msg + getNewLineAndIndent() + " # endBraceCount --> " + + endBraceCount; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert equal-index. + * + * @param remainderMapString Remainder map-string. (NotNull) + * @param equalIndex Equal-index. + * @param mapString4Log Map-string for log. (NotNull) + * @param currentMap4Log Current-map for log. (NotNull) + */ + protected void assertEqualIndex(String remainderMapString, int equalIndex, + String mapString4Log, Map<String, Object> currentMap4Log) { + if (remainderMapString == null) { + String msg = "Argument[remainderMapString] must not be null:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # mapString4Log --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap4Log --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (equalIndex < 0) { + String msg = "Argument[equalIndex] must be plus or zero:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # mapString4Log --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap4Log --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (remainderMapString.length() < equalIndex) { + String msg = "Argument[remainderMapString] length must be larger than equalIndex value:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # mapString4Log --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap4Log --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + final String expectedAsEndMark = remainderMapString.substring( + equalIndex, equalIndex + _equal.length()); + if (!expectedAsEndMark.equals(_equal)) { + String msg = "Argument[remainderMapString] must have '" + _equal + + "' at Argument[equalIndex]:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # equalIndex --> " + + equalIndex; + msg = msg + getNewLineAndIndent() + " # expectedAsEndMark --> " + + expectedAsEndMark; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert end-brace-index. + * + * @param remainderMapString Remainder map-string. (NotNull) + * @param endBraceIndex End-brace-index. + * @param mapString4Log Map-string for log. (NotNull) + * @param currentMap4Log Current-map for log. (NotNull) + */ + protected void assertEndBracekIndex(String remainderMapString, + int endBraceIndex, String mapString4Log, + Map<String, Object> currentMap4Log) { + if (remainderMapString == null) { + String msg = "Argument[remainderMapString] must not be null:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (endBraceIndex < 0) { + String msg = "Argument[endMarkIndex] must be plus or zero:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # mapString --> =" + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (remainderMapString.length() < endBraceIndex) { + String msg = "Argument[remainderMapString] length must be larger than endMarkIndex value:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + final String expectedAsEndMark = remainderMapString.substring( + endBraceIndex, endBraceIndex + _endBrace.length()); + if (!expectedAsEndMark.equals(_endBrace)) { + String msg = "Argument[remainderMapString] must have '" + _endBrace + + "' at Argument[endBraceIndex]:"; + msg = msg + getNewLineAndIndent() + " # remainderMapString --> " + + remainderMapString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # expectedAsEndMark --> " + + expectedAsEndMark; + msg = msg + getNewLineAndIndent() + " # mapString --> " + + mapString4Log; + msg = msg + getNewLineAndIndent() + " # currentMap --> " + + currentMap4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + } + + /** + * Assert end-brace-index. + * + * @param remainderListString Remainder list-string. (NotNull) + * @param endBraceIndex End-brace-index. + * @param listString4Log List-string for log. (NotNull) + * @param currentList4Log Current-list for log. (NotNull) + */ + protected void assertEndBraceIndex(String remainderListString, + int endBraceIndex, String listString4Log, List<?> currentList4Log) { + if (remainderListString == null) { + String msg = "Argument[remainderListString] must not be null:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (endBraceIndex < 0) { + String msg = "Argument[endMarkIndex] must be plus or zero:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + if (remainderListString.length() < endBraceIndex) { + String msg = "Argument[remainderListString] length must be larger than endMarkIndex value:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + + final String expectedAsEndBrace = remainderListString.substring( + endBraceIndex, endBraceIndex + _endBrace.length()); + if (!expectedAsEndBrace.equals(_endBrace)) { + String msg = "Argument[remainderListString] must have '" + + _endBrace + "' at Argument[endBraceIndex]:"; + msg = msg + getNewLineAndIndent() + " # remainderListString --> " + + remainderListString; + msg = msg + getNewLineAndIndent() + " # endBraceIndex --> " + + endBraceIndex; + msg = msg + getNewLineAndIndent() + " # expectedAsEndBrace --> " + + expectedAsEndBrace; + msg = msg + getNewLineAndIndent() + " # listString --> " + + listString4Log; + msg = msg + getNewLineAndIndent() + " # currentList --> " + + currentList4Log; + msg = msg + getNewLineAndIndent() + " # _startBrace --> " + + _startBrace; + msg = msg + getNewLineAndIndent() + " # _endBrace --> " + _endBrace; + msg = msg + getNewLineAndIndent() + " # _delimiter --> " + + _delimiter; + msg = msg + getNewLineAndIndent() + " # _equal --> " + _equal; + throw new IllegalArgumentException(msg); + } + } + + //========================================================================== + // ================ + // Filter + // ====== + /** + * Filter map or list value. + * <p> + * + * <pre> + * # The value is trimmed. + * # If the value is null, this returns null. + * # If the value is 'null', this returns null. + * # If the trimmed value is empty string, this returns null. + * </pre> + * + * @param value value. (Nullable) + * @return Filtered value. (Nullable) + */ + protected String filterMapListValue(String value) { + if (value == null) { + return null; + } + value = value.trim(); + return (("".equals(value) || "null".equals(value)) ? null : value); + } + + //========================================================================== + // ================ + // Judgement + // ========= + /** + * Does it start with map-prefix? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithMapPrefix(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_mapMark + _startBrace)) { + return true; + } else { + return false; + } + } + + /** + * Does it start with list-prefix? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithListPrefix(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_listMark + _startBrace)) { + return true; + } else { + return false; + } + } + + /** + * Does it start with delimiter? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithDelimiter(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_delimiter)) { + return true; + } else { + return false; + } + } + + /** + * Does it start with end-brace? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isStartsWithEndBrace(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.startsWith(_endBrace)) { + return true; + } else { + return false; + } + } + + /** + * Does it end with end-brace? + * + * @param targetString Target-string. (NotNull) + * @return Determination. + */ + protected boolean isEndsWithEndBrace(String targetString) { + if (targetString == null) { + String msg = "Argument[targetString] must not be null: " + + targetString; + throw new IllegalArgumentException(msg); + } + targetString = targetString.trim(); + if (targetString.endsWith(_endBrace)) { + return true; + } else { + return false; + } + } + + //========================================================================== + // ================ + // Other + // ===== + /** + * Setup nest map. + * + * @param currentMap Current-map. (NotNull) + * @param mapKey Map-key. (NotNull) + * @return Nest map. (NotNull) + */ + protected Map<String, Object> setupNestMap(Map<String, Object> currentMap, + String mapKey) { + final Map<String, Object> nestMap = newStringObjectMap(); + currentMap.put(mapKey, nestMap); + return nestMap; + } + + /** + * Setup nest map. + * + * @param currentList Current-list. (NotNull) + * @return Nest map. (NotNull) + */ + protected Map<String, Object> setupNestMap(List<Object> currentList) { + final Map<String, Object> nestMap = newStringObjectMap(); + currentList.add(nestMap); + return nestMap; + } + + /** + * Setup nest list. + * + * @param currentMap Current-map. (NotNull) + * @param mapKey Map-key. (NotNull) + * @return Nest list. (NotNull) + */ + protected List<Object> setupNestList(Map<String, Object> currentMap, + String mapKey) { + final List<Object> nestList = newObjectList(); + currentMap.put(mapKey, nestList); + return nestList; + } + + /** + * Setup nest list. + * + * @param currentList Current-list. (NotNull) + * @return Nest list. (NotNull) + */ + protected List<Object> setupNestList(List<Object> currentList) { + final List<Object> nestList = newObjectList(); + currentList.add(nestList); + return nestList; + } + + /** + * New string-object-map. + * + * @return String-object-map. (NotNull) + */ + protected Map<String, Object> newStringObjectMap() { + return new LinkedHashMap<String, Object>(); + } + + /** + * New object-list. + * + * @return String-object-list. (NotNull) + */ + protected List<Object> newObjectList() { + return new ArrayList<Object>(); + } + + /** + * Get new-line and indent. + * + * @return New-line and indent. (NotNull) + */ + protected String getNewLineAndIndent() { + return NEW_LINE + " "; + } + + /** + * Get count that target string exist in the base string. + * + * @param targetString Target string. + * @param delimiter Delimiter + * @return Delimiter count that _remainderString contains. + */ + protected int getDelimiterCount(String targetString, String delimiter) { + int result = 0; + for (int i = 0;;) { + if (targetString.indexOf(delimiter, i) != -1) { + result++; + i = targetString.indexOf(delimiter, i) + 1; + } else { + break; + } + } + if (result == 0) { + result = -1; + } + return result; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapListStringImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilder.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilder.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilder.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,78 @@ +package jp.sf.pal.scheduler.db.allcommon.helper; + +/** + * The interface of map-string-builder. + * + * @author DBFlute(AutoGenerator) + */ +public interface MapStringBuilder { + + //========================================================================== + // =========== + // Setter + // ====== + public void setColumnNames(String[] columnNames); + + public void setColumnNameList(java.util.List<String> columnNameList); + + public void setMsMapMark(String value); + + public void setMsStartBrace(String value); + + public void setMsEndBrace(String value); + + public void setMsDelimiter(String value); + + public void setMsEqual(String value); + + //========================================================================== + // =========== + // Main + // ==== + public String buildByDelimiter(String values, String delimiter); + + public String buildFromList(java.util.List<String> valueList); + + //========================================================================== + // =========== + // Exception Static Class + // ====================== + public static class DifferentDelimiterCountException extends + RuntimeException { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + //====================================================================== + // =============== + // Attribute + // ========= + protected java.util.List<String> _columnNameList; + + protected java.util.List<String> _valueList; + + //====================================================================== + // =============== + // Constructor + // =========== + public DifferentDelimiterCountException(String msg, + java.util.List<String> columnNameList, + java.util.List<String> valueList) { + super(msg); + _columnNameList = columnNameList; + _valueList = valueList; + } + + //====================================================================== + // =============== + // Accessor + // ======== + public java.util.List<String> getColumnNameList() { + return _columnNameList; + } + + public java.util.List<String> getValueList() { + return _valueList; + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilder.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilderImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilderImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilderImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,183 @@ +package jp.sf.pal.scheduler.db.allcommon.helper; + +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineToken; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineTokenizingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.impl.LineTokenImpl; + +/** + * The implementation of map-string-builder. + * + * @author DBFlute(AutoGenerator) + */ +public class MapStringBuilderImpl implements MapStringBuilder { + + protected java.util.List<String> _columnNameList; + + protected String _msMapMark; + + protected String _msStartBrace; + + protected String _msEndBrace; + + protected String _msDelimiter; + + protected String _msEqual; + + protected boolean _trimDoubleQuotation; + + public void setColumnNames(String[] columnNames) { + _columnNameList = java.util.Arrays.asList(columnNames); + } + + public void setColumnNameList(java.util.List<String> columnNameList) { + _columnNameList = columnNameList; + } + + public void setMsMapMark(String value) { + _msMapMark = value; + } + + public void setMsStartBrace(String value) { + _msStartBrace = value; + } + + public void setMsEndBrace(String value) { + _msEndBrace = value; + } + + public void setMsDelimiter(String value) { + _msDelimiter = value; + } + + public void setMsEqual(String value) { + _msEqual = value; + } + + public void trimDoubleQuotation() { + _trimDoubleQuotation = true; + } + + public String buildByDelimiter(String values, String delimiter) { + if (values == null) { + String msg = "The argument[values] should not be null."; + throw new IllegalArgumentException(msg); + } + if (delimiter == null) { + String msg = "The argument[delimiter] should not be null."; + throw new IllegalArgumentException(msg); + } + assertStringComponent(); + + final java.util.List<String> valueList = tokenize(values, delimiter); + assertColumnValueList(_columnNameList, valueList); + + final StringBuffer sb = new StringBuffer(); + sb.append(_msMapMark).append(_msStartBrace); + for (int i = 0; i < _columnNameList.size(); i++) { + sb.append(_columnNameList.get(i)).append(_msEqual).append( + valueList.get(i)).append(_msDelimiter); + } + + sb.delete(sb.length() - _msDelimiter.length(), sb.length()); + sb.append(_msEndBrace); + return sb.toString(); + } + + public String buildFromList(java.util.List<String> valueList) { + if (valueList == null) { + String msg = "The argument[valueList] should not be null."; + throw new IllegalArgumentException(msg); + } + assertStringComponent(); + assertColumnValueList(_columnNameList, valueList); + + final StringBuffer sb = new StringBuffer(); + sb.append(_msMapMark).append(_msStartBrace); + for (int i = 0; i < _columnNameList.size(); i++) { + sb.append(_columnNameList.get(i)).append(_msEqual).append( + valueList.get(i)).append(_msDelimiter); + } + + sb.delete(sb.length() - _msDelimiter.length(), sb.length()); + sb.append(_msEndBrace); + return sb.toString(); + } + + protected java.util.List<String> tokenize(String value, String delimiter) { + final LineToken lineToken = new LineTokenImpl(); + final LineTokenizingOption lineTokenizingOption = new LineTokenizingOption(); + lineTokenizingOption.setDelimiter(delimiter); + if (_trimDoubleQuotation) { + lineTokenizingOption.trimDoubleQuotation(); + } + return lineToken.tokenize(value, lineTokenizingOption); + } + + protected void assertStringComponent() { + if (_columnNameList == null) { + String msg = "The columnNameList should not be null."; + throw new IllegalStateException(msg); + } + if (_columnNameList.isEmpty()) { + String msg = "The columnNameList should not be empty."; + throw new IllegalStateException(msg); + } + if (_msMapMark == null) { + String msg = "The msMapMark should not be null."; + throw new IllegalStateException(msg); + } + if (_msStartBrace == null) { + String msg = "The msStartBrace should not be null."; + throw new IllegalStateException(msg); + } + if (_msEndBrace == null) { + String msg = "The msEndBrace should not be null."; + throw new IllegalStateException(msg); + } + if (_msDelimiter == null) { + String msg = "The msDelimiter should not be null."; + throw new IllegalStateException(msg); + } + if (_msEqual == null) { + String msg = "The msEqual should not be null."; + throw new IllegalStateException(msg); + } + } + + protected void assertColumnValueList(java.util.List<String> columnNameList, + java.util.List<String> valueList) { + if (columnNameList.size() != valueList.size()) { + String msg = "The length of columnNameList and valueList are difference. (" + + columnNameList.size() + ", " + valueList.size() + ")"; + msg = msg + " columnNameList=" + columnNameList; + msg = msg + " valueList=" + valueList; + throw new DifferentDelimiterCountException(msg, columnNameList, + valueList); + } + } + + protected static final String replace(String text, String fromText, + String toText) { + if (text == null || fromText == null || toText == null) { + return null; + } + final 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(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/MapStringBuilderImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/GeneralCharacter.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/GeneralCharacter.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/GeneralCharacter.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.character; + +/** + * The interface of general character. + * + * @author DBFlute(AutoGenerator) + */ +public interface GeneralCharacter { + + public String toSingleByteAlphabet(String s); + + public String toSingleByteNumber(String s); + + public String toSingleByteAlphabetNumber(String target); + + public String toSingleByteAlphabetNumberMark(String target); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/GeneralCharacter.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/JapaneseCharacter.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/JapaneseCharacter.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/JapaneseCharacter.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,11 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.character; + +/** + * The interface of Japanese character. + * + * @author DBFlute(AutoGenerator) + */ +public interface JapaneseCharacter { + + public String toDoubleByteKatakana(String target); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/JapaneseCharacter.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/GeneralCharacterImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/GeneralCharacterImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/GeneralCharacterImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,101 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.character.impl; + +import jp.sf.pal.scheduler.db.allcommon.helper.character.GeneralCharacter; + +/** + * The implementation of general character. + * + * @author DBFlute(AutoGenerator) + */ +public class GeneralCharacterImpl implements GeneralCharacter { + + public String toSingleByteAlphabet(String target) { + if (target == null) { + return target; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + + if (currentChar >= 0xff21 && currentChar <= 0xff3a) { + sb.append(toSingleByteCharacter(currentChar)); + } else if (currentChar >= 0xff41 && currentChar <= 0xff5a) { + sb.append(toSingleByteCharacter(currentChar)); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + public String toSingleByteNumber(String target) { + if (target == null) { + return target; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + if (currentChar >= 0xff10 && currentChar <= 0xff19) { + sb.append(toSingleByteCharacter(currentChar)); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + public String toSingleByteAlphabetNumber(String target) { + if (target == null) { + return target; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + + if (currentChar >= 0xff10 && currentChar <= 0xff19) { + sb.append(toSingleByteCharacter(currentChar)); + } else if (currentChar >= 0xff21 && currentChar <= 0xff3a) { + sb.append(toSingleByteCharacter(currentChar)); + } else if (currentChar >= 0xff41 && currentChar <= 0xff5a) { + sb.append(toSingleByteCharacter(currentChar)); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + public String toSingleByteAlphabetNumberMark(String target) { + if (target == null) { + return target; + } + final StringBuffer sb = new StringBuffer(target.length()); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + if (currentChar >= 0xff01 && currentChar <= 0xff5e) { + sb.append(toSingleByteCharacter(currentChar)); + + // It needs to append more mark... + } else if (currentChar == '\u2019' || currentChar == '\u2018' + || currentChar == '\u2032') { + sb.append('\''); + } else if (currentChar == '\u201d' || currentChar == '\u201c' + || currentChar == '\u2033') { + sb.append('\"'); + } else if (currentChar == '\uffe5') { + sb.append('\\'); + } else if (currentChar == '\u2010') { + sb.append('-'); + } else if (currentChar == '\uff5e') { + sb.append('~'); + } else { + sb.append(currentChar); + } + } + return sb.toString(); + } + + protected char toSingleByteCharacter(final char currentChar) { + return (char) (currentChar - 0xfee0); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/GeneralCharacterImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,96 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.character.impl; + +import jp.sf.pal.scheduler.db.allcommon.helper.character.JapaneseCharacter; + +/** + * The implementation of Japanese character. + * + * @author DBFlute(AutoGenerator) + */ +public class JapaneseCharacterImpl implements JapaneseCharacter { + + // Double-byte Katakana + protected static final String TABLE_ZENKANA = "\u3002\u300c\u300d\u3001\u30fb\u30f2\u30a1\u30a3\u30a5" + + "\u30a7\u30a9\u30e3\u30e5\u30e7\u30c3\u30fc\u30a2\u30a4" + + "\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5" + + "\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8" + + "\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8" + + "\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8" + + "\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f3\u309b\u309c"; + + // (uff71 - uff9d) + protected static final String DEF_DOUBLE_BYTE_VOICED_SOUND_NORMAL_KATAKANA = "\u30a2\u30a4\u30f4\u30a8\u30aa" + + "\u30ac\u30ae\u30b0\u30b2\u30b4" + + "\u30b6\u30b8\u30ba\u30bc\u30be" + + "\u30c0\u30c2\u30c5\u30c7\u30c9" + + "\u30ca\u30cb\u30cc\u30cd\u30ce" + + "\u30d0\u30d3\u30d6\u30d9\u30dc" + + "\u30de\u30df\u30e0\u30e1\u30e2" + + "\u30e4\u30e6\u30e8" + + "\u30e9\u30ea\u30eb\u30ec\u30ed" + "\u30ef\u30f3"; + + // (uff66 - uff6f) + protected static final String DEF_DOUBLE_BYTE_VOICED_SOUND_SPECIAL_KATAKANA = "\u30fa\u30a1\u30a3\u30a5\u30a7\u30a9\u30e3\u30e5\u30e7"; + + // (u30cf - u30dd) + protected static final String DEF_DOUBLE_BYTE_SEMI_VOICED_SOUND_KATAKANA = "\u30d1\u30d4\u30d7\u30da\u30dd"; + + public String toDoubleByteKatakana(String target) { + if (target == null) { + return target; + } + + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < target.length(); i++) { + final char currentChar = target.charAt(i); + final char nextChar; + if (i < target.length() - 1) { + nextChar = target.charAt(i + 1); + } else { + nextChar = ' '; + } + + if (isVoicedSoundKatakana(currentChar, nextChar)) { + if (currentChar >= 0xff66 && currentChar <= 0xff6f) {// Voiced + // sound + // special + // Katakana + sb.append(DEF_DOUBLE_BYTE_VOICED_SOUND_SPECIAL_KATAKANA + .charAt(currentChar - 0xff66)); + i++; + } else if (currentChar >= 0xff71 && currentChar <= 0xff9d) {// Voiced + // sound + // normal + // Katakana + sb.append(DEF_DOUBLE_BYTE_VOICED_SOUND_NORMAL_KATAKANA + .charAt(currentChar - 0xff71)); + i++; + } + + } else if (isSemiVoicedSoundKatakana(currentChar, nextChar)) { + sb.append(DEF_DOUBLE_BYTE_SEMI_VOICED_SOUND_KATAKANA + .charAt(currentChar - 0xff8a)); + i++; + } else if (currentChar != 0xff9e && currentChar != 0xff9f) { + if (currentChar >= 0xff61 && currentChar <= 0xff9f) { + sb.append(TABLE_ZENKANA.charAt(currentChar - 0xff61)); + } else { + sb.append(currentChar); + } + } + } + return sb.toString(); + } + + protected boolean isVoicedSoundKatakana(final char currentChar, + final char nextChar) { + return ((currentChar >= 0xff66 && currentChar <= 0xff6f) || (currentChar >= 0xff71 && (currentChar <= 0xff9d))) + && (nextChar == 0xff9e); + } + + protected boolean isSemiVoicedSoundKatakana(final char currentChar, + final char nextChar) { + return (currentChar >= 0xff8a && currentChar <= 0xff8e) + && (nextChar == 0xff9f); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/character/impl/JapaneseCharacterImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrder.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrder.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrder.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,20 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.collection.order; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface AccordingToOrder { + + /** + * Order the unordered list. + * + * @param option The option of according-to-order. (NotNull) + * @param unorderedList The unordered list. (NotNull) + * @param <ELEMENT_TYPE> The type of element. + * @param <ID_TYPE> The type of ID. + */ + <ELEMENT_TYPE, ID_TYPE> void order(List<ELEMENT_TYPE> unorderedList, + AccordingToOrderOption<ELEMENT_TYPE, ID_TYPE> option); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrder.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.collection.order; + +/** + * @author DBFlute(AutoGenerator) + * @param <ELEMENT_TYPE> The type of element. + * @param <ID_TYPE> The type of ID. + */ +public interface AccordingToOrderIdExtractor<ELEMENT_TYPE, ID_TYPE> { + + /** + * Extract ID from the element instance. + * + * @param element Element instance. (NotNull) + * @return Extracted ID. (NotNull) + */ + ID_TYPE extractId(ELEMENT_TYPE element); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderIdExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.collection.order; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + * @param <ELEMENT_TYPE> The type of element. + * @param <ID_TYPE> The type of ID. + */ +public class AccordingToOrderOption<ELEMENT_TYPE, ID_TYPE> { + + //========================================================================== + // ========= + // Attribute + // ========= + protected List<ID_TYPE> _orderedUniqueIdList; + + protected AccordingToOrderIdExtractor<ELEMENT_TYPE, ID_TYPE> _idExtractor; + + //========================================================================== + // ========= + // Easy-to-Use + // =========== + public void setupOrderedResource(List<ID_TYPE> orderedUniqueIdList, + AccordingToOrderIdExtractor<ELEMENT_TYPE, ID_TYPE> idExtractor) { + setOrderedUniqueIdList(orderedUniqueIdList); + setIdExtractor(idExtractor); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public List<ID_TYPE> getOrderedUniqueIdList() { + return _orderedUniqueIdList; + } + + public void setOrderedUniqueIdList(List<ID_TYPE> orderedUniqueIdList) { + this._orderedUniqueIdList = orderedUniqueIdList; + } + + public AccordingToOrderIdExtractor<ELEMENT_TYPE, ID_TYPE> getIdExtractor() { + return _idExtractor; + } + + public void setIdExtractor( + AccordingToOrderIdExtractor<ELEMENT_TYPE, ID_TYPE> idExtractor) { + _idExtractor = idExtractor; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/AccordingToOrderOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,103 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.collection.order.impl; + +import java.util.Collections; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.helper.collection.order.AccordingToOrder; +import jp.sf.pal.scheduler.db.allcommon.helper.collection.order.AccordingToOrderIdExtractor; +import jp.sf.pal.scheduler.db.allcommon.helper.collection.order.AccordingToOrderOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class AccordingToOrderImpl implements AccordingToOrder { + + //========================================================================== + // ========= + // Main + // ==== + /** + * The implementation. + * + * @param unorderedList The unordered list. (NotNull) + * @param option The option of according-to-order. (NotNull) + * @param <ELEMENT_TYPE> The type of element. + * @param <ID_TYPE> The type of ID. + */ + public <ELEMENT_TYPE, ID_TYPE> void order( + final List<ELEMENT_TYPE> unorderedList, + final AccordingToOrderOption<ELEMENT_TYPE, ID_TYPE> option) { + assertObjectNotNull("unorderedList", unorderedList); + if (unorderedList.isEmpty()) { + return; + } + assertObjectNotNull("option", option); + final List<ID_TYPE> orderedUniqueIdList = option + .getOrderedUniqueIdList(); + assertObjectNotNull("option.getOrderedUniqueIdList()", + orderedUniqueIdList); + if (orderedUniqueIdList.isEmpty()) { + return; + } + final AccordingToOrderIdExtractor<ELEMENT_TYPE, ID_TYPE> idExtractor = option + .getIdExtractor(); + assertObjectNotNull("option.getIdExtractor()", idExtractor); + + final Map<ID_TYPE, Integer> idIndexMap = new LinkedHashMap<ID_TYPE, Integer>(); + int index = 0; + for (ID_TYPE id : orderedUniqueIdList) { + if (idIndexMap.containsKey(id)) { + String msg = "The id was duplicated: id=" + id + + " orderedUniqueIdList=" + orderedUniqueIdList; + throw new IllegalStateException(msg); + } + idIndexMap.put(id, index); + ++index; + } + final Comparator<ELEMENT_TYPE> comp = new Comparator<ELEMENT_TYPE>() { + public int compare(ELEMENT_TYPE o1, ELEMENT_TYPE o2) { + final ID_TYPE id1 = idExtractor.extractId(o1); + final ID_TYPE id2 = idExtractor.extractId(o2); + assertObjectNotNull("id1 of " + o1, id1); + assertObjectNotNull("id2 of " + o2, id2); + final Integer index1 = idIndexMap.get(id1); + final Integer index2 = idIndexMap.get(id2); + if (index1 != null && index2 != null) { + return index1.compareTo(index2); + } + if (index1 == null && index2 == null) { + return 0; + } + return index1 == null ? 1 : -1; + } + }; + Collections.sort(unorderedList, comp); + } + + //========================================================================== + // ========= + // Assert Helper + // ============= + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/collection/order/impl/AccordingToOrderImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractingResource.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractingResource.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractingResource.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.stacktrace; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface InvokeNameExtractingResource { + + public boolean isTargetElement(String className, String methodName); + + public String filterSimpleClassName(String simpleClassName); + + public boolean isUseAdditionalInfo(); + + public int getStartIndex(); + + public int getLoopSize(); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractingResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,16 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.stacktrace; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface InvokeNameExtractor { + + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @return The result of invoke name. (NotNull: If not found, returns empty + * string.) + */ + public InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameExtractor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameResult.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameResult.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameResult.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,86 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.stacktrace; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InvokeNameResult { + + //========================================================================== + // ================ + // Attribute + // ========= + protected String _simpleClassName; + + protected String _methodName; + + protected String _invokeName; + + protected int _foundIndex; + + protected int _foundFirstIndex; + + //========================================================================== + // ================ + // Manipulation + // ============ + public int getNextStartIndex() { + return _foundIndex + 1; + } + + public void beEmptyResult() { + _simpleClassName = null; + _invokeName = ""; // As Default + } + + //========================================================================== + // ================ + // Determination + // ============= + public boolean isEmptyResult() { + return _simpleClassName == null; + } + + //========================================================================== + // ================ + // Accessor + // ======== + public String getSimpleClassName() { + return _simpleClassName; + } + + public void setSimpleClassName(String simpleClassName) { + _simpleClassName = simpleClassName; + } + + public String getMethodName() { + return _methodName; + } + + public void setMethodName(String methodName) { + _methodName = methodName; + } + + public String getInvokeName() { + return _invokeName; + } + + public void setInvokeName(String invokeName) { + _invokeName = invokeName; + } + + public int getFoundIndex() { + return _foundIndex; + } + + public void setFoundIndex(int foundIndex) { + _foundIndex = foundIndex; + } + + public int getFoundFirstIndex() { + return _foundFirstIndex; + } + + public void setFoundFirstIndex(int foundFirstIndex) { + _foundFirstIndex = foundFirstIndex; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/InvokeNameResult.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/impl/InvokeNameExtractorImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/impl/InvokeNameExtractorImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/impl/InvokeNameExtractorImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,103 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.impl; + +import jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.InvokeNameExtractor; +import jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.InvokeNameResult; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InvokeNameExtractorImpl implements InvokeNameExtractor { + + //========================================================================== + // ================ + // Attribute + // ========= + protected StackTraceElement[] _stackTrace; + + //========================================================================== + // ================ + // Main + // ==== + /** + * @param resource the call-back resource for invoke-name-extracting. + * (NotNull) + * @return Invoke name. (NotNull: If not found, returns empty string.) + */ + public InvokeNameResult extractInvokeName( + InvokeNameExtractingResource resource) { + if (_stackTrace == null) { + String msg = "The attribute 'stackTrace' should not be null: resource=" + + resource; + throw new IllegalStateException(msg); + } + String targetSimpleClassName = null; + String targetMethodName = null; + int lineNumber = 0; + int foundIndex = -1; // The minus one means 'Not Found'. + int foundFirstIndex = -1; // The minus one means 'Not Found'. + boolean onTarget = false; + for (int i = resource.getStartIndex(); i < _stackTrace.length; i++) { + final StackTraceElement element = _stackTrace[i]; + if (i > resource.getStartIndex() + resource.getLoopSize()) { + break; + } + final String className = element.getClassName(); + if (className.startsWith("sun.") || className.startsWith("java.")) { + if (onTarget) { + break; + } + continue; + } + final String methodName = element.getMethodName(); + if (resource.isTargetElement(className, methodName)) { + if (methodName.equals("invoke")) { + continue; + } + targetSimpleClassName = className.substring(className + .lastIndexOf(".") + 1); + targetMethodName = methodName; + if (resource.isUseAdditionalInfo()) { + lineNumber = element.getLineNumber(); + } + foundIndex = i; + if (foundFirstIndex == -1) { + foundFirstIndex = i; + } + onTarget = true; + continue; + } + if (onTarget) { + break; + } + } + final InvokeNameResult result = new InvokeNameResult(); + if (targetSimpleClassName == null) { + result.beEmptyResult(); // Not Found! It sets empty result. + return result; + } + final String filteredClassName = resource + .filterSimpleClassName(targetSimpleClassName); + result.setSimpleClassName(resource + .filterSimpleClassName(targetSimpleClassName)); + result.setMethodName(targetMethodName); + if (lineNumber > 0) { + result.setInvokeName(filteredClassName + "." + targetMethodName + + "():" + lineNumber + " --> "); + } else { + result.setInvokeName(filteredClassName + "." + targetMethodName + + "() --> "); + } + result.setFoundIndex(foundIndex); + result.setFoundFirstIndex(foundFirstIndex); + return result; + } + + //========================================================================== + // ================ + // Accessor + // ======== + public void setStackTrace(StackTraceElement[] stackTrace) { + _stackTrace = stackTrace; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/stacktrace/impl/InvokeNameExtractorImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingCallback.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingCallback.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingCallback.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface FileMakingCallback { + + /** + * Get file-making header information. + * + * <pre> + * You should return your row resource for file-making. + * It continues invoking until this method returns null. + * </pre> + * + * @return File-making header information. (Nullable) + */ + public FileMakingRowResource getRowResource(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingCallback.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingHeaderInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingHeaderInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingHeaderInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,23 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingHeaderInfo { + + protected List<String> columnNameList = new java.util.ArrayList<String>(); + + public List<String> getColumnNameList() { + return columnNameList; + } + + public void setColumnNameList(List<String> columnNameList) { + this.columnNameList = columnNameList; + } + + public boolean isEmpty() { + return this.columnNameList.isEmpty(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingHeaderInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,107 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingOption { + + //========================================================================== + // =========== + // Attribute + // ========= + /** Encoding. (Required) */ + protected String _encoding; + + /** Delimiter. (Required) */ + protected String _delimiter; + + /** Line separator. (NotRequired) */ + protected String _lineSeparator; + + /** Good bye double quotation. (NotRequired) */ + protected boolean _goodByeDoubleQuotation; + + /** File-making header information. (NotRequired) */ + protected FileMakingHeaderInfo _fileMakingHeaderInfo; + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + public FileMakingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public FileMakingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public FileMakingOption encodeAsUTF8() { + _encoding = "UTF-8"; + return this; + } + + public FileMakingOption encodeAsWindows31J() { + _encoding = "Windows-31J"; + return this; + } + + public FileMakingOption separateCrLf() { + _lineSeparator = "\r\n"; + return this; + } + + public FileMakingOption separateLf() { + _lineSeparator = "\n"; + return this; + } + + public FileMakingOption goodByeDoubleQuotation() { + _goodByeDoubleQuotation = true; + return this; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public String getEncoding() { + return _encoding; + } + + public void setEncoding(String encoding) { + _encoding = encoding; + } + + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public String getLineSeparator() { + return _lineSeparator; + } + + public void setLineSeparator(String lineSeparator) { + _lineSeparator = lineSeparator; + } + + public boolean isGoodByeDoubleQuotation() { + return _goodByeDoubleQuotation; + } + + public FileMakingHeaderInfo getFileMakingHeaderInfo() { + return _fileMakingHeaderInfo; + } + + public void setFileMakingHeaderInfo( + FileMakingHeaderInfo fileMakingHeaderInfo) { + _fileMakingHeaderInfo = fileMakingHeaderInfo; + } + +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingRowResource.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingRowResource.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingRowResource.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,47 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingRowResource { + + //========================================================================== + // =========== + // Attribute + // ========= + protected java.util.List<String> _valueList; + + protected java.util.LinkedHashMap<String, String> _nameValueMap; + + //========================================================================== + // =========== + // Accessor + // ======== + public java.util.List<String> getValueList() { + return _valueList; + } + + /** + * Set the list of value. {Priority One} + * + * @param valueList The list of value. (NotNull and NotEmpty) + */ + public void setValueList(java.util.List<String> valueList) { + this._valueList = valueList; + } + + public java.util.LinkedHashMap<String, String> getNameValueMap() { + return _nameValueMap; + } + + /** + * Set the map of name and value. {Priority Two} <br /> If valueList is set, + * This nameValueMap is ignored. + * + * @param nameValueMap The map of name and value. (NotNull and NotEmpty) + */ + public void setNameValueMap( + java.util.LinkedHashMap<String, String> nameValueMap) { + this._nameValueMap = nameValueMap; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingRowResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingSimpleFacade.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingSimpleFacade.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingSimpleFacade.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface FileMakingSimpleFacade { + + /** + * Make token-file from row-list. + * + * @param filename Output target file name. (NotNull) + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void makeFromRowList(final String filename, + final java.util.List<java.util.List<String>> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Make bytes from row-list. + * + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @return Result byte array. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public byte[] makeFromRowList( + final java.util.List<java.util.List<String>> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileMakingSimpleFacade.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileToken.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileToken.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileToken.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,78 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * File-Token. + * + * @author DBFlute(AutoGenerator) + */ +public interface FileToken { + + /** + * Tokenize token-file data of a specified file. + * + * @param filename Input target file name. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(String filename, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Tokenize token-file data of a specified file. + * + * <pre> + * This method uses java.io.InputStreamReader and java.io.BufferedReader that wrap the argument[inputStream]. + * These objects are closed. (Invoking close() at finally) + * </pre> + * + * @param inputStream Input target stream. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(java.io.InputStream inputStream, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Make token-file from specified row resources. + * + * @param filename Output target file name. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(String filename, FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; + + /** + * Make token-file from specified row resources. + * + * <pre> + * This method uses java.io.BufferedOutputStream and java.io.OutputStreamWriter that wrap the argument[outputStream]. + * These objects are closed. (Invoking close() at finally) + * </pre> + * + * @param outputStream Output target stream. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(java.io.OutputStream outputStream, + FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException; +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileToken.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingCallback.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingCallback.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingCallback.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,9 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface FileTokenizingCallback { + public void handleRowResource( + FileTokenizingRowResource fileTokenizingRowResource); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingCallback.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +import java.util.List; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenizingHeaderInfo { + + //========================================================================== + // =========== + // Attribute + // ========= + protected List<String> _columnNameList = new java.util.ArrayList<String>(); + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + protected String _columnNameRowString; + + public boolean isEmpty() { + return this._columnNameList.isEmpty(); + } + + //========================================================================== + // =========== + // Accessor + // ======== + public List<String> getColumnNameList() { + return _columnNameList; + } + + public void setColumnNameList(List<String> columnNameList) { + this._columnNameList = columnNameList; + } + + public String getColumnNameRowString() { + return _columnNameRowString; + } + + public void setColumnNameRowString(String columnNameRowString) { + _columnNameRowString = columnNameRowString; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingHeaderInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,81 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenizingOption { + + //========================================================================== + // =========== + // Attribute + // ========= + protected String _encoding; + + protected String _delimiter; + + protected boolean _beginFirstLine; + + protected boolean _handleEmptyAsNull; + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + public FileTokenizingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public FileTokenizingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public FileTokenizingOption encodeAsUTF8() { + _encoding = "UTF-8"; + return this; + } + + public FileTokenizingOption encodeAsWindows31J() { + _encoding = "Windows-31J"; + return this; + } + + public FileTokenizingOption beginFirstLine() { + _beginFirstLine = true; + return this; + } + + public FileTokenizingOption handleEmptyAsNull() { + _handleEmptyAsNull = true; + return this; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public String getEncoding() { + return _encoding; + } + + public void setEncoding(String encoding) { + _encoding = encoding; + } + + public boolean isBeginFirstLine() { + return _beginFirstLine; + } + + public boolean isHandleEmptyAsNull() { + return _handleEmptyAsNull; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingRowResource.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingRowResource.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingRowResource.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,68 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenizingRowResource { + + //========================================================================== + // =========== + // Attribute + // ========= + protected FileTokenizingHeaderInfo fileTokenizingHeaderInfo; + + protected java.util.List<String> valueList; + + protected String rowString; + + /** The row number. */ + protected int _rowNumber; + + /** The line number. */ + protected int _lineNumber; + + //========================================================================== + // =========== + // Accessor + // ======== + public FileTokenizingHeaderInfo getFileTokenizingHeaderInfo() { + return fileTokenizingHeaderInfo; + } + + public void setFirstLineInfo( + FileTokenizingHeaderInfo fileTokenizingHeaderInfo) { + this.fileTokenizingHeaderInfo = fileTokenizingHeaderInfo; + } + + public java.util.List<String> getValueList() { + return valueList; + } + + public void setValueList(java.util.List<String> valueList) { + this.valueList = valueList; + } + + public String getRowString() { + return rowString; + } + + public void setRowString(String rowString) { + this.rowString = rowString; + } + + public int getRowNumber() { + return _rowNumber; + } + + public void setRowNumber(int rowNumber) { + _rowNumber = rowNumber; + } + + public int getLineNumber() { + return _lineNumber; + } + + public void setLineNumber(int lineNumber) { + _lineNumber = lineNumber; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/FileTokenizingRowResource.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,85 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file.impl; + +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingCallback; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingRowResource; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingSimpleFacade; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileToken; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileMakingSimpleFacadeImpl implements FileMakingSimpleFacade { + + protected FileToken _fileToken = new FileTokenImpl(); + + public void setFileToken(FileToken fileToken) { + this._fileToken = fileToken; + } + + /** + * Make token-file from row-list. + * + * @param filename Output target file name. (NotNull) + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void makeFromRowList(final String filename, + final java.util.List<java.util.List<String>> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + final FileMakingCallback fileMakingCallback = new FileMakingCallback() { + protected int rowCount = 0; + + public FileMakingRowResource getRowResource() { + ++rowCount; + if (rowList.size() < rowCount) { + return null;// The End! + } + final java.util.List<String> valueList = (java.util.List<String>) rowList + .get(rowCount - 1); + final FileMakingRowResource fileMakingRowResource = new FileMakingRowResource(); + fileMakingRowResource.setValueList(valueList); + return fileMakingRowResource; + } + }; + _fileToken.make(filename, fileMakingCallback, fileMakingOption); + } + + /** + * Make bytes from row-list. + * + * @param rowList Row-list composed of value-list. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @return Result byte array. (NotNull) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public byte[] makeFromRowList( + final java.util.List<java.util.List<String>> rowList, + final FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + final FileMakingCallback fileMakingCallback = new FileMakingCallback() { + protected int rowCount = 0; + + public FileMakingRowResource getRowResource() { + ++rowCount; + if (rowList.size() < rowCount) { + return null;// The End! + } + final java.util.List<String> valueList = (java.util.List<String>) rowList + .get(rowCount - 1); + final FileMakingRowResource fileMakingRowResource = new FileMakingRowResource(); + fileMakingRowResource.setValueList(valueList); + return fileMakingRowResource; + } + }; + final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(); + _fileToken.make(baos, fileMakingCallback, fileMakingOption); + return baos.toByteArray(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileMakingSimpleFacadeImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileTokenImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileTokenImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileTokenImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,565 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.file.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingCallback; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingHeaderInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileMakingRowResource; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileToken; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingCallback; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingHeaderInfo; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.file.FileTokenizingRowResource; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineMakingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineToken; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineTokenizingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.impl.LineTokenImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class FileTokenImpl implements FileToken { + + //========================================================================== + // =========== + // Attribute + // ========= + /** Line-token for help. */ + protected final LineToken _lineToken = new LineTokenImpl(); + + //========================================================================== + // =========== + // Main + // ==== + /** + * Tokenize token-file data of a specified file. + * + * @param filename File name. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(String filename, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + + java.io.FileInputStream fis = null; + try { + fis = new java.io.FileInputStream(filename); + tokenize(fis, fileTokenizingCallback, fileTokenizingOption); + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + try { + if (fis != null) { + fis.close(); + } + } catch (java.io.IOException ignored) { + } + } + } + + /** + * Tokenize token-file data of a specified file. + * + * <pre> + * This method uses java.io.InputStreamReader and java.io.BufferedReader that wrap the argument[inputStream]. + * These objects are closed. (Invoking close() at finally) + * </pre> + * + * @param inputStream Input target stream. (NotNull) + * @param fileTokenizingCallback File-tokenizing callback. (NotNull) + * @param fileTokenizingOption File-tokenizing option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void tokenize(java.io.InputStream inputStream, + FileTokenizingCallback fileTokenizingCallback, + FileTokenizingOption fileTokenizingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("inputStream", inputStream); + assertObjectNotNull("fileTokenizingCallback", fileTokenizingCallback); + assertObjectNotNull("fileTokenizingOption", fileTokenizingOption); + final String delimiter = fileTokenizingOption.getDelimiter(); + final String encoding = fileTokenizingOption.getEncoding(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + + java.io.InputStreamReader ir = null; + java.io.BufferedReader br = null; + + String lineString = null; + String preContinueString = ""; + final List<String> temporaryValueList = new ArrayList<String>(); + final List<String> filteredValueList = new ArrayList<String>(); + + try { + ir = new java.io.InputStreamReader(inputStream, encoding); + br = new java.io.BufferedReader(ir); + + FileTokenizingHeaderInfo fileTokenizingHeaderInfo = null; + int count = -1; + int rowNumber = 1; + int lineNumber = 0; + while (true) { + ++count; + if ("".equals(preContinueString)) { + lineNumber = count + 1; + } + + lineString = br.readLine(); + if (lineString == null) { + break; + } + if (count == 0) { + if (fileTokenizingOption.isBeginFirstLine()) { + fileTokenizingHeaderInfo = new FileTokenizingHeaderInfo();// As + // empty + } else { + fileTokenizingHeaderInfo = analyzeHeaderInfo(delimiter, + lineString); + continue; + } + } + final String rowString; + if (preContinueString.equals("")) { + rowString = lineString; + } else { + final String lineSeparator = System + .getProperty("line.separator"); + rowString = preContinueString + lineSeparator + lineString; + } + final ValueLineInfo valueLineInfo = arrangeValueList(rowString, + delimiter); + final List<String> ls = valueLineInfo.getValueList(); + if (valueLineInfo.isContinueNextLine()) { + preContinueString = (String) ls.remove(ls.size() - 1); + temporaryValueList.addAll(ls); + continue; + } + temporaryValueList.addAll(ls); + + try { + final FileTokenizingRowResource fileTokenizingRowResource = new FileTokenizingRowResource(); + fileTokenizingRowResource + .setFirstLineInfo(fileTokenizingHeaderInfo); + + if (fileTokenizingOption.isHandleEmptyAsNull()) { + for (final Iterator<String> ite = temporaryValueList + .iterator(); ite.hasNext();) { + final String value = (String) ite.next(); + if ("".equals(value)) { + filteredValueList.add(null); + } else { + filteredValueList.add(value); + } + } + fileTokenizingRowResource + .setValueList(filteredValueList); + } else { + fileTokenizingRowResource + .setValueList(temporaryValueList); + } + + fileTokenizingRowResource.setRowString(rowString); + fileTokenizingRowResource.setRowNumber(rowNumber); + fileTokenizingRowResource.setLineNumber(lineNumber); + fileTokenizingCallback + .handleRowResource(fileTokenizingRowResource); + } finally { + ++rowNumber; + temporaryValueList.clear(); + filteredValueList.clear(); + preContinueString = ""; + } + } + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + try { + if (ir != null) { + ir.close(); + } + if (br != null) { + br.close(); + } + } catch (java.io.IOException ignored) { + } + } + } + + protected ValueLineInfo arrangeValueList(final String lineString, + String delimiter) { + final List<String> valueList = new ArrayList<String>(); + + // Don't use split! + // final String[] values = lineString.split(delimiter); + final LineTokenizingOption tokenizingOption = new LineTokenizingOption(); + tokenizingOption.setDelimiter(delimiter); + final List<String> list = _lineToken.tokenize(lineString, + tokenizingOption); + final String[] values = (String[]) list + .toArray(new String[list.size()]); + for (int i = 0; i < values.length; i++) { + valueList.add(values[i]); + } + return arrangeValueList(valueList, delimiter); + } + + protected ValueLineInfo arrangeValueList(List<String> valueList, + String delimiter) { + final ValueLineInfo valueLineInfo = new ValueLineInfo(); + final ArrayList<String> resultList = new ArrayList<String>(); + String preString = ""; + for (int i = 0; i < valueList.size(); i++) { + final String value = (String) valueList.get(i); + if (value == null) { + continue; + } + if (i == valueList.size() - 1) {// The last loop + if (preString.equals("")) { + if (isFrontQOnly(value)) { + valueLineInfo.setContinueNextLine(true); + resultList.add(value); + break; + } else if (isRearQOnly(value)) { + resultList.add(value); + break; + } else if (isNotBothQ(value)) { + resultList.add(value); + break; + } else { + resultList.add(removeDoubleQuotation(value)); + break; + } + } else { + if (isFrontQOnly(value)) { + valueLineInfo.setContinueNextLine(true); + resultList.add(connectPreString(preString, delimiter, + value)); + break; + } else if (isRearQOnly(value)) { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + break; + } else if (isNotBothQ(value)) { + valueLineInfo.setContinueNextLine(true); + resultList.add(connectPreString(preString, delimiter, + value)); + break; + } else { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + break; + } + } + } + + if (preString.equals("")) { + if (isFrontQOnly(value)) { + preString = value; + continue; + } else if (isRearQOnly(value)) { + preString = value; + continue; + } else if (isNotBothQ(value)) { + resultList.add(value); + } else { + resultList.add(removeDoubleQuotation(value)); + } + } else { + if (isFrontQOnly(value)) { + preString = connectPreString(preString, delimiter, value); + continue; + } else if (isRearQOnly(value)) { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + } else if (isNotBothQ(value)) { + preString = connectPreString(preString, delimiter, value); + continue; + } else { + resultList.add(removeDoubleQuotation(connectPreString( + preString, delimiter, value))); + } + } + preString = ""; + } + valueLineInfo.setValueList(resultList); + return valueLineInfo; + } + + protected String connectPreString(String preString, String delimiter, + String value) { + if (preString.equals("")) { + return value; + } else { + return preString + delimiter + value; + } + } + + protected boolean isNotBothQ(final String value) { + return !value.startsWith("\"") && !value.endsWith("\""); + } + + protected boolean isRearQOnly(final String value) { + return !value.startsWith("\"") && value.endsWith("\""); + } + + protected boolean isFrontQOnly(final String value) { + return value.startsWith("\"") && !value.endsWith("\""); + } + + protected String removeDoubleQuotation(String value) { + if (!value.startsWith("\"") && !value.endsWith("\"")) { + return value; + } + if (value.startsWith("\"")) { + value = value.substring(1); + } + if (value.endsWith("\"")) { + value = value.substring(0, value.length() - 1); + } + return value; + } + + protected String removeRightDoubleQuotation(String value) { + if (value.endsWith("\"")) { + value = value.substring(0, value.length() - 1); + } + return value; + } + + protected FileTokenizingHeaderInfo analyzeHeaderInfo(String delimiter, + final String lineString) { + final java.util.List<String> columnNameList = new ArrayList<String>(); + final String[] values = lineString.split(delimiter); + for (int i = 0; i < values.length; i++) { + final String value = values[i].trim();// Trimming is Header Only!; + if (value.startsWith("\"") && value.endsWith("\"")) { + columnNameList.add(value.substring(1, value.length() - 1)); + } else { + columnNameList.add(value); + } + } + final FileTokenizingHeaderInfo fileTokenizingHeaderInfo = new FileTokenizingHeaderInfo(); + fileTokenizingHeaderInfo.setColumnNameList(columnNameList); + fileTokenizingHeaderInfo.setColumnNameRowString(lineString); + return fileTokenizingHeaderInfo; + } + + public static class ValueLineInfo { + protected java.util.List<String> valueList; + + protected boolean continueNextLine; + + public java.util.List<String> getValueList() { + return valueList; + } + + public void setValueList(List<String> valueList) { + this.valueList = valueList; + } + + public boolean isContinueNextLine() { + return continueNextLine; + } + + public void setContinueNextLine(boolean continueNextLine) { + this.continueNextLine = continueNextLine; + } + } + + /** + * Make token-file from specified row resources. + * + * @param filename File name. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(String filename, FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertStringNotNullAndNotTrimmedEmpty("filename", filename); + + java.io.FileOutputStream fos = null; + try { + fos = new java.io.FileOutputStream(filename); + make(fos, fileMakingCallback, fileMakingOption); + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + if (fos != null) { + fos.close(); + } + } + } + + /** + * Make token-file from specified row resources. + * + * <pre> + * This method uses java.io.BufferedOutputStream and java.io.OutputStreamWriter that wrap the argument[outputStream]. + * These objects are closed. (Invoking close() at finally) + * </pre> + * + * @param outputStream Output target stream. (NotNull) + * @param fileMakingCallback File-making callback. (NotNull) + * @param fileMakingOption File-making option. (NotNull and + * Required{encoding and delimiter}) + * @throws java.io.FileNotFoundException + * @throws java.io.IOException + */ + public void make(java.io.OutputStream outputStream, + FileMakingCallback fileMakingCallback, + FileMakingOption fileMakingOption) + throws java.io.FileNotFoundException, java.io.IOException { + assertObjectNotNull("outputStream", outputStream); + assertObjectNotNull("fileMakingCallback", fileMakingCallback); + assertObjectNotNull("fileMakingOption", fileMakingOption); + final String encoding = fileMakingOption.getEncoding(); + final String delimiter = fileMakingOption.getDelimiter(); + assertStringNotNullAndNotTrimmedEmpty("encoding", encoding); + assertObjectNotNull("delimiter", delimiter); + final String lineSeparator; + if (fileMakingOption.getLineSeparator() != null + && !fileMakingOption.getLineSeparator().equals("")) { + lineSeparator = fileMakingOption.getLineSeparator(); + } else { + lineSeparator = System.getProperty("line.separator");// Default! + } + + java.io.BufferedOutputStream bos = null; + java.io.Writer writer = null; + try { + bos = new java.io.BufferedOutputStream(outputStream); + writer = new java.io.OutputStreamWriter(bos, encoding); + + boolean headerDone = false; + + // Make header. + final FileMakingHeaderInfo fileMakingHeaderInfo = fileMakingOption + .getFileMakingHeaderInfo(); + if (fileMakingHeaderInfo != null) { + final List<String> columnNameList = fileMakingHeaderInfo + .getColumnNameList(); + if (columnNameList != null && !columnNameList.isEmpty()) { + final LineMakingOption lineMakingOption = new LineMakingOption(); + lineMakingOption.setDelimiter(delimiter); + lineMakingOption.trimSpace();// Trimming is Header Only! + final String columnHeaderString = _lineToken.make( + columnNameList, lineMakingOption); + writer.write(columnHeaderString + lineSeparator); + headerDone = true; + } + } + + // Make row. + FileMakingRowResource rowResource = null; + while (true) { + rowResource = fileMakingCallback.getRowResource(); + if (rowResource == null) { + break;// The End! + } + final java.util.List<String> valueList; + if (rowResource.getValueList() != null) { + valueList = rowResource.getValueList(); + } else { + final java.util.LinkedHashMap<String, String> nameValueMap = rowResource + .getNameValueMap(); + if (!headerDone) { + final java.util.List<String> columnNameList = new java.util.ArrayList<String>( + nameValueMap.keySet()); + final LineMakingOption lineMakingOption = new LineMakingOption(); + lineMakingOption.setDelimiter(delimiter); + lineMakingOption.trimSpace();// Trimming is Header Only! + final String columnHeaderString = _lineToken.make( + columnNameList, lineMakingOption); + writer.write(columnHeaderString + lineSeparator); + headerDone = true; + } + valueList = new ArrayList<String>(nameValueMap.values()); + } + final LineMakingOption lineMakingOption = new LineMakingOption(); + lineMakingOption.setDelimiter(delimiter); + if (!fileMakingOption.isGoodByeDoubleQuotation()) { + lineMakingOption.quoteByDoubleQuotation(); + } + final String lineString = _lineToken.make(valueList, + lineMakingOption); + writer.write(lineString + lineSeparator); + } + writer.flush(); + } catch (java.io.FileNotFoundException e) { + throw e; + } catch (java.io.IOException e) { + throw e; + } finally { + if (bos != null) { + bos.close(); + } + if (writer != null) { + writer.close(); + } + } + } + + // ---------------------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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(variableName, value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/file/impl/FileTokenImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineMakingOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineMakingOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineMakingOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,49 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.line; + +/** + * @author DBFlute(AutoGenerator) + */ +public class LineMakingOption { + + protected String _delimiter; + + protected boolean _quoteByDoubleQuotation; + + protected boolean _trimSpace; + + public LineMakingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public LineMakingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public LineMakingOption quoteByDoubleQuotation() { + _quoteByDoubleQuotation = true; + return this; + } + + public boolean isQuoteByDoubleQuotation() { + return _quoteByDoubleQuotation; + } + + public LineMakingOption trimSpace() { + _trimSpace = true; + return this; + } + + public boolean isTrimSpace() { + return _trimSpace; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineMakingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineToken.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineToken.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineToken.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,13 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.line; + +/** + * @author DBFlute(AutoGenerator) + */ +public interface LineToken { + + public java.util.List<String> tokenize(String lineString, + LineTokenizingOption lineTokenizingOption); + + public String make(java.util.List<String> valueList, + LineMakingOption lineMakingOption); +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineToken.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineTokenizingOption.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineTokenizingOption.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineTokenizingOption.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,61 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.line; + +/** + * @author DBFlute(AutoGenerator) + */ +public class LineTokenizingOption { + + //========================================================================== + // =========== + // Attribute + // ========= + protected String _delimiter; + + protected boolean _trimDoubleQuotation; + + protected boolean _handleEmtpyAsNull; + + //========================================================================== + // =========== + // Easy-to-Use + // =========== + public LineTokenizingOption delimitateByComma() { + _delimiter = ","; + return this; + } + + public LineTokenizingOption delimitateByTab() { + _delimiter = "\t"; + return this; + } + + public LineTokenizingOption trimDoubleQuotation() { + _trimDoubleQuotation = true; + return this; + } + + public LineTokenizingOption handleEmtpyAsNull() { + _handleEmtpyAsNull = true; + return this; + } + + //========================================================================== + // =========== + // Accessor + // ======== + public String getDelimiter() { + return _delimiter; + } + + public void setDelimiter(String delimiter) { + _delimiter = delimiter; + } + + public boolean isTrimDoubleQuotation() { + return _trimDoubleQuotation; + } + + public boolean isHandleEmtpyAsNull() { + return _handleEmtpyAsNull; + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/LineTokenizingOption.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/impl/LineTokenImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/impl/LineTokenImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/impl/LineTokenImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,136 @@ +package jp.sf.pal.scheduler.db.allcommon.helper.token.line.impl; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineMakingOption; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineToken; +import jp.sf.pal.scheduler.db.allcommon.helper.token.line.LineTokenizingOption; + +/** + * @author DBFlute(AutoGenerator) + */ +public class LineTokenImpl implements LineToken { + + //========================================================================== + // ========= + // Tokenize Line + // ============= + public List<String> tokenize(String lineString, + LineTokenizingOption lineTokenizingOption) { + final String delimiter = lineTokenizingOption.getDelimiter(); + final List<String> list = new ArrayList<String>(); + int i = 0; + int j = lineString.indexOf(delimiter); + for (int h = 0; j >= 0; h++) { + final String pureValue = lineString.substring(i, j); + if (lineTokenizingOption.isTrimDoubleQuotation()) { + final String before = pureValue; + if (before.length() > 1 && before.startsWith("\"") + && before.endsWith("\"")) { + final String after = before.substring(1, + before.length() - 1); + list.add(filterHandlingEmptyAsNull(after, + lineTokenizingOption)); + } else { + list.add(filterHandlingEmptyAsNull(before, + lineTokenizingOption)); + } + } else { + list.add(filterHandlingEmptyAsNull(pureValue, + lineTokenizingOption)); + } + i = j + delimiter.length(); + j = lineString.indexOf(delimiter, i); + } + list.add(filterHandlingEmptyAsNull(lineString.substring(i), + lineTokenizingOption)); + return list; + } + + protected String filterHandlingEmptyAsNull(String target, + LineTokenizingOption lineTokenizingOption) { + if (target == null) { + return null; + } + if (lineTokenizingOption.isHandleEmtpyAsNull() && "".equals(target)) { + return null; + } + return target; + } + + //========================================================================== + // ========= + // Make Line + // ========= + public String make(java.util.List<String> valueList, + LineMakingOption lineMakingOption) { + assertObjectNotNull("valueList", valueList); + assertObjectNotNull("lineMakingOption", lineMakingOption); + final String delimiter = lineMakingOption.getDelimiter(); + assertObjectNotNull("lineMakingOption.getDelimiter()", delimiter); + return createLineString(valueList, delimiter, lineMakingOption + .isQuoteByDoubleQuotation(), lineMakingOption.isTrimSpace()); + } + + protected String createLineString(List<String> valueList, String delimiter, + boolean quoteByDoubleQuotation, boolean trimSpace) { + final StringBuffer sb = new StringBuffer(); + for (final Iterator<String> ite = valueList.iterator(); ite.hasNext();) { + String value = (String) ite.next(); + value = (value != null ? value : ""); + if (trimSpace) { + value = value.trim(); + } + if (quoteByDoubleQuotation) { + sb.append(delimiter).append("\"").append(value).append("\""); + } else { + sb.append(delimiter).append(value); + } + } + sb.delete(0, delimiter.length()); + return sb.toString(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + protected 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 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(variableName, value); + if (value.trim().length() == 0) { + String msg = "The value should not be empty: variableName=" + + variableName + " value=" + value; + throw new IllegalArgumentException(msg); + } + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/helper/token/line/impl/LineTokenImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/CursorHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/CursorHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/CursorHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,19 @@ +package jp.sf.pal.scheduler.db.allcommon.jdbc; + +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * The handler of cursor. + * + * @author DBFlute(AutoGenerator) + */ +public interface CursorHandler { + + /** + * @param resultSet Result set. (NotNull) + * @return Result + * @throws java.sql.SQLException + */ + Object handle(ResultSet resultSet) throws SQLException; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/CursorHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/LatestSqlProvider.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/LatestSqlProvider.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/LatestSqlProvider.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon.jdbc; + +/** + * The provider of latest SQL. + * + * @author DBFlute(AutoGenerator) + */ +public interface LatestSqlProvider { + + /** + * Get display SQL. + * + * @return Display SQL. (Nullable: If it was not found, returns null.) + */ + public String getDisplaySql(); + + /** + * Clear the cache of SQL. + */ + public void clearSqlCache(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/LatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/SqlLogHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/SqlLogHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/SqlLogHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +package jp.sf.pal.scheduler.db.allcommon.jdbc; + +/** + * The handler of SQL log. + * + * @author DBFlute(AutoGenerator) + */ +public interface SqlLogHandler { + + /** + * @param executedSql The executed SQL. (NotNull) + * @param displaySql The SQL for display. (NotNull) + * @param args The arguments of the SQL. (Nullable) + * @param argTypes The argument types of the SQL. (Nullable) + */ + void handle(String executedSql, String displaySql, Object[] args, + Class<?>[] argTypes); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/SqlLogHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/StatementConfig.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/StatementConfig.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/StatementConfig.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,135 @@ +package jp.sf.pal.scheduler.db.allcommon.jdbc; + +import java.sql.ResultSet; + +/** + * The config of statement. + * + * @author DBFlute(AutoGenerator) + */ +public class StatementConfig { + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + protected Integer _resultSetType; + + // ----------------------------------------------------- + // Statement Option + // ---------------- + protected Integer _queryTimeout; + + protected Integer _fetchSize; + + protected Integer _maxRows; + + //========================================================================== + // ========= + // Setting Interface + // ================= + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + public StatementConfig typeForwardOnly() { + _resultSetType = ResultSet.TYPE_FORWARD_ONLY; + return this; + } + + public StatementConfig typeScrollInsensitive() { + _resultSetType = ResultSet.TYPE_SCROLL_INSENSITIVE; + return this; + } + + public StatementConfig typeScrollSensitive() { + _resultSetType = ResultSet.TYPE_SCROLL_SENSITIVE; + return this; + } + + // ----------------------------------------------------- + // Statement Option + // ---------------- + public StatementConfig queryTimeout(int queryTimeout) { + this._queryTimeout = queryTimeout; + return this; + } + + public StatementConfig fetchSize(int fetchSize) { + this._fetchSize = fetchSize; + return this; + } + + public StatementConfig maxRows(int maxRows) { + this._maxRows = maxRows; + return this; + } + + //========================================================================== + // ========= + // Determination + // ============= + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + public boolean hasResultSetType() { + return _resultSetType != null; + } + + // ----------------------------------------------------- + // Statement Option + // ---------------- + public boolean hasStatementOptions() { + return hasQueryTimeout() || hasFetchSize() || hasMaxRows(); + } + + public boolean hasQueryTimeout() { + return _queryTimeout != null; + } + + public boolean hasFetchSize() { + return _fetchSize != null; + } + + public boolean hasMaxRows() { + return _maxRows != null; + } + + //========================================================================== + // ========= + // Basic Override + // ============== + @Override + public String toString() { + return "{" + _resultSetType + ", " + _queryTimeout + ", " + _fetchSize + + ", " + _maxRows + "}"; + } + + //========================================================================== + // ========= + // Accessor + // ======== + // ----------------------------------------------------- + // ResultSet TYPE + // -------------- + public Integer getResultSetType() { + return _resultSetType; + } + + // ----------------------------------------------------- + // Statement Option + // ---------------- + public Integer getQueryTimeout() { + return _queryTimeout; + } + + public Integer getFetchSize() { + return _fetchSize; + } + + public Integer getMaxRows() { + return _maxRows; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/jdbc/StatementConfig.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,125 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.scheduler.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); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,237 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import jp.sf.pal.scheduler.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; + +import org.seasar.extension.jdbc.impl.ResultSetWrapper; + +/** + * The wrapper of fetch narrowing result set. + * + * @author DBFlute(AutoGenerator) + */ +public class FetchNarrowingResultSetWrapper extends ResultSetWrapper { + + //========================================================================== + // ========= + // Attribute + // ========= + /** The real result set. (NotNull) */ + protected ResultSet _resultSet; + + /** The bean of fetch narrowing. (NotNull) */ + protected FetchNarrowingBean _fetchNarrowingBean; + + /** The counter of fetch. */ + protected long _fetchCounter; + + /** the counter of request. */ + protected long _requestCounter; + + /** Does it offset by cursor forcedly? */ + protected boolean _offsetByCursorForcedly; + + /** Does it limit by cursor forcedly? */ + protected boolean _limitByCursorForcedly; + + /** Does it skip to cursor end? */ + protected boolean _skipToCursorEnd; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param resultSet Original result set. (NotNull) + * @param fetchNarrowingBean Fetch-narrowing-bean. (NotNull) + * @param offsetByCursorForcedly Offset by cursor forcedly. + * @param limitByCursorForcedly Limit by cursor forcedly. + */ + public FetchNarrowingResultSetWrapper(ResultSet resultSet, + FetchNarrowingBean fetchNarrowingBean, + boolean offsetByCursorForcedly, boolean limitByCursorForcedly) { + super(resultSet); + + _resultSet = resultSet; + _fetchNarrowingBean = fetchNarrowingBean; + _offsetByCursorForcedly = offsetByCursorForcedly; + _limitByCursorForcedly = limitByCursorForcedly; + + skip(); + } + + //========================================================================== + // ========= + // Skip + // ==== + /** + * Skip to start-index. + */ + protected void skip() { + if (!isAvailableSkipRecord()) { + return; + } + final int skipStartIndex = getFetchNarrowingSkipStartIndex(); + if (isScrollableCursor()) { + try { + if (0 == skipStartIndex) { + _resultSet.beforeFirst(); + } else { + _resultSet.absolute(skipStartIndex); + } + _fetchCounter = _resultSet.getRow(); + } catch (SQLException e) { + handleSQLException(e, null); + } + } else { + try { + while (true) { + if (_fetchCounter >= skipStartIndex) { + break; + } + if (!_resultSet.next()) { + _skipToCursorEnd = true;// [DBFLUTE-243] + break; + } + ++_fetchCounter; + } + } catch (SQLException e) { + handleSQLException(e, null); + } + } + } + + protected boolean isAvailableSkipRecord() { + if (!isFetchNarrowingEffective()) { + return false; + } + if (isOffsetByCursorForcedly()) { + return true; + } + if (isFetchNarrowingSkipStartIndexEffective()) { + return true; + } + return false; + } + + //========================================================================== + // ========= + // Next + // ==== + /** + * Next. + * + * @return Does the result set have next record? + * @throws SQLException + */ + public boolean next() throws SQLException { + final boolean hasNext = super.next(); + ++_requestCounter; + if (!isAvailableLimitLoopCount()) { + checkSafetyResult(hasNext); + return hasNext; + } + + if (hasNext + && _fetchCounter < getFetchNarrowingSkipStartIndex() + + getFetchNarrowingLoopCount()) { + ++_fetchCounter; + checkSafetyResult(true); + return true; + } else { + return false; + } + } + + protected boolean isAvailableLimitLoopCount() { + if (!isFetchNarrowingEffective()) { + return false; + } + if (isLimitByCursorForcedly()) { + return true; + } + if (isFetchNarrowingLoopCountEffective()) { + return true; + } + return false; + } + + protected void checkSafetyResult(boolean hasNext) { + if (hasNext && getSafetyMaxResultSize() > 0 + && _requestCounter > (getSafetyMaxResultSize() + 1)) { + String msg = "You have already been in Danger Zone!"; + msg = msg + + " Please confirm your query or data of table: safetyMaxResultSize=" + + getSafetyMaxResultSize(); + throw new jp.sf.pal.scheduler.db.allcommon.exception.DangerousResultSizeException( + msg, getSafetyMaxResultSize()); + } + } + + //========================================================================== + // ========= + // Fetch Option + // ============ + protected boolean isFetchNarrowingEffective() { + return _fetchNarrowingBean.isFetchNarrowingEffective(); + } + + protected boolean isFetchNarrowingSkipStartIndexEffective() { + return _fetchNarrowingBean.isFetchNarrowingSkipStartIndexEffective(); + } + + protected boolean isFetchNarrowingLoopCountEffective() { + return _fetchNarrowingBean.isFetchNarrowingLoopCountEffective(); + } + + protected int getFetchNarrowingSkipStartIndex() { + return _fetchNarrowingBean.getFetchNarrowingSkipStartIndex(); + } + + protected int getFetchNarrowingLoopCount() { + return _fetchNarrowingBean.getFetchNarrowingLoopCount(); + } + + public int getSafetyMaxResultSize() { + return _fetchNarrowingBean.getSafetyMaxResultSize(); + } + + protected boolean isScrollableCursor() { + try { + return !(_resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY); + } catch (SQLException e) { + handleSQLException(e, null); + return false;// Unreachable! + } + } + + //========================================================================== + // ========= + // Exception Handler + // ================= + protected void handleSQLException(SQLException e, Statement statement) { + new SQLExceptionHandler().handleSQLException(e, statement); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public boolean isOffsetByCursorForcedly() { + return _offsetByCursorForcedly; + } + + public boolean isLimitByCursorForcedly() { + return _limitByCursorForcedly; + } + + public boolean isSkipToCursorEnd() { + return _skipToCursorEnd; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/FetchNarrowingResultSetWrapper.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,116 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import jp.sf.pal.scheduler.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 Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2BeanMetaDataFactoryImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoInterceptor.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoInterceptor.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoInterceptor.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1027 @@ +package jp.sf.pal.scheduler.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.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.InternalMapContext; +import jp.sf.pal.scheduler.db.allcommon.XLog; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlOption; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.InvokeNameExtractingResource; +import jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.InvokeNameResult; +import jp.sf.pal.scheduler.db.allcommon.helper.stacktrace.impl.InvokeNameExtractorImpl; +import jp.sf.pal.scheduler.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.scheduler.db.allcommon.annotation.OutsideSql> outsideSqlType = jp.sf.pal.scheduler.db.allcommon.annotation.OutsideSql.class; + final jp.sf.pal.scheduler.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 Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoInterceptor.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoLatestSqlProvider.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoLatestSqlProvider.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoLatestSqlProvider.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,20 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import jp.sf.pal.scheduler.db.allcommon.jdbc.LatestSqlProvider; +import jp.sf.pal.scheduler.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(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoLatestSqlProvider.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataExtension.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataExtension.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataExtension.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1460 @@ +package jp.sf.pal.scheduler.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.scheduler.db.allcommon.BehaviorSelector; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.annotation.OutsideSql; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException; +import jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException; +import jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException; +import jp.sf.pal.scheduler.db.allcommon.jdbc.CursorHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler.InternalBeanArrayMetaDataResultSetHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler.InternalBeanListMetaDataResultSetHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteAutoStaticCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteBatchAutoStaticCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalDeleteQueryAutoDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalInsertAutoDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalInsertBatchAutoStaticCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalProcedureCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateAutoDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateBatchAutoStaticCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateModifiedOnlyCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalUpdateQueryAutoDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaDataFactory; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalRelationRowCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalRowCreator; +import jp.sf.pal.scheduler.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; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataExtension.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,655 @@ +package jp.sf.pal.scheduler.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.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.jdbc.StatementConfig; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicHandler.SQLExceptionHandler; +import jp.sf.pal.scheduler.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 Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoMetaDataFactoryImpl.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,215 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.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; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoPropertyTypeFactoryBuilderExtension.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,491 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand.InternalAbstractDynamicCommand; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicSelectHandler; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.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.scheduler.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.scheduler.db.allcommon.jdbc.CursorHandler) { + final jp.sf.pal.scheduler.db.allcommon.jdbc.CursorHandler cursorHandler = (jp.sf.pal.scheduler.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 Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/S2DaoSelectDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractBeanMetaDataResultSetHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractBeanMetaDataResultSetHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractBeanMetaDataResultSetHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,130 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.RelationPropertyType; +import org.seasar.dao.RelationRowCreator; +import org.seasar.dao.RowCreator; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class InternalAbstractBeanMetaDataResultSetHandler extends + InternalAbstractDtoMetaDataResultSetHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + private BeanMetaData beanMetaData; + + protected RelationRowCreator relationRowCreator; + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param beanMetaData Bean meta data. (NotNull) + * @param rowCreator Row creator. (NotNull) + * @param relationRowCreator Relation row creator. (NotNul) + */ + public InternalAbstractBeanMetaDataResultSetHandler( + BeanMetaData beanMetaData, RowCreator rowCreator, + RelationRowCreator relationRowCreator) { + super(beanMetaData, rowCreator); + this.beanMetaData = beanMetaData; + this.relationRowCreator = relationRowCreator; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + /** + * @param columnNames The set of column name. (NotNull) + * @return The map of row property cache. Map{String(columnName), + * PropertyType} (NotNull) + * @throws SQLException + */ + protected Map createPropertyCache(Set columnNames) throws SQLException { + // - - - - - - - - - + // Override for Bean + // - - - - - - - - - + return rowCreator.createPropertyCache(columnNames, beanMetaData); + } + + /** + * @param rs Result set. (NotNull) + * @param propertyCache The map of property cache. Map{String(columnName), + * PropertyType} (NotNull) + * @return Created row. (NotNull) + * @throws SQLException + */ + protected Object createRow(ResultSet rs, Map propertyCache) + throws SQLException { + // - - - - - - - - - + // Override for Bean + // - - - - - - - - - + final Class beanClass = beanMetaData.getBeanClass(); + return rowCreator.createRow(rs, propertyCache, beanClass); + } + + /** + * @param columnNames The set of column name. (NotNull) + * @return The map of relation property cache. Map{String(relationNoSuffix), + * Map{String(columnName), PropertyType}} (NotNull) + * @throws SQLException + */ + protected Map createRelationPropertyCache(Set columnNames) + throws SQLException { + return relationRowCreator + .createPropertyCache(columnNames, beanMetaData); + } + + /** + * @param rs Result set. (NotNull) + * @param rpt The type of relation property. (NotNull) + * @param columnNames The set of column name. (NotNull) + * @param relKeyValues The map of rel key values. (Nullable) + * @param relationPropertyCache The map of relation property cache. + * Map{String(relationNoSuffix), Map{String(columnName), + * PropertyType}} (NotNull) + * @return Created relation row. (Nullable) + * @throws SQLException + */ + protected Object createRelationRow(ResultSet rs, RelationPropertyType rpt, + Set columnNames, Map relKeyValues, Map relationPropertyCache) + throws SQLException { + return relationRowCreator.createRelationRow(rs, rpt, columnNames, + relKeyValues, relationPropertyCache); + } + + /** + * @param row The row of result list. (NotNull) + */ + protected void postCreateRow(final Object row) { + if (row instanceof Entity) { // DBFlute Target + ((Entity) row).clearModifiedPropertyNames(); + } else { // Basically Unreachable + final BeanMetaData bmd = getBeanMetaData(); + final Set names = bmd.getModifiedPropertyNames(row); + names.clear(); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractBeanMetaDataResultSetHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,89 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler; + +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.util.Map; +import java.util.Set; + +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) + */ + @ SuppressWarnings("unchecked") +public abstract class InternalAbstractDtoMetaDataResultSetHandler implements + ResultSetHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + private DtoMetaData dtoMetaData; + + protected RowCreator rowCreator; // [DAO-118] (2007/08/25) + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param dtoMetaData Dto meta data. (NotNull) + * @param rowCreator Row creator. (NotNull) + */ + public InternalAbstractDtoMetaDataResultSetHandler(DtoMetaData dtoMetaData, + RowCreator rowCreator) { + this.dtoMetaData = dtoMetaData; + this.rowCreator = rowCreator; + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + /** + * @param columnNames The set of column name. (NotNull) + * @return The map of row property cache. Map{String(columnName), + * PropertyType} (NotNull) + * @throws SQLException + */ + protected Map createPropertyCache(Set columnNames) throws SQLException { + return rowCreator.createPropertyCache(columnNames, dtoMetaData); + } + + /** + * @param rs Result set. (NotNull) + * @param propertyCache The map of property cache. Map{String(columnName), + * PropertyType} (NotNull) + * @return Created row. (NotNull) + * @throws SQLException + */ + protected Object createRow(ResultSet rs, Map propertyCache) + throws SQLException { + final Class beanClass = dtoMetaData.getBeanClass(); + return rowCreator.createRow(rs, propertyCache, beanClass); + } + + protected Set createColumnNames(final ResultSetMetaData rsmd) + throws SQLException { + final int count = rsmd.getColumnCount(); + final Set columnNames = new CaseInsensitiveSet(); + for (int i = 0; i < count; ++i) { + final String columnName = rsmd.getColumnLabel(i + 1); + final int pos = columnName.lastIndexOf('.'); // [DAO-41] + if (-1 < pos) { + columnNames.add(columnName.substring(pos + 1)); + } else { + columnNames.add(columnName); + } + } + return columnNames; + } + + public DtoMetaData getDtoMetaData() { + return dtoMetaData; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalAbstractDtoMetaDataResultSetHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,42 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler; + +import java.lang.reflect.Array; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.RelationRowCreator; +import org.seasar.dao.RowCreator; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class InternalBeanArrayMetaDataResultSetHandler extends + InternalBeanListMetaDataResultSetHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param beanMetaData Bean meta data. (NotNull) + * @param rowCreator Row creator. (NotNull) + * @param relationRowCreator Relation row creator. (NotNul) + */ + public InternalBeanArrayMetaDataResultSetHandler(BeanMetaData beanMetaData, + RowCreator rowCreator, RelationRowCreator relationRowCreator) { + super(beanMetaData, rowCreator, relationRowCreator); + } + + //========================================================================== + // ========= + // Handle + // ====== + public Object handle(ResultSet rs) throws SQLException { + List list = (List) super.handle(rs); + return list.toArray((Object[]) Array.newInstance(getBeanMetaData() + .getBeanClass(), list.size())); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanArrayMetaDataResultSetHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,236 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.rshandler; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.RelationPropertyType; +import org.seasar.dao.RelationRowCreator; +import org.seasar.dao.RowCreator; +import org.seasar.dao.impl.RelationKey; +import org.seasar.dao.impl.RelationRowCache; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class InternalBeanListMetaDataResultSetHandler extends + InternalAbstractBeanMetaDataResultSetHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * @param beanMetaData Bean meta data. (NotNull) + * @param rowCreator Row creator. (NotNull) + * @param relationRowCreator Relation row creator. (NotNul) + */ + public InternalBeanListMetaDataResultSetHandler(BeanMetaData beanMetaData, + RowCreator rowCreator, RelationRowCreator relationRowCreator) { + super(beanMetaData, rowCreator, relationRowCreator); + } + + //========================================================================== + // ========= + // Handle + // ====== + public Object handle(ResultSet rs) throws SQLException { + // Lazy initialization because if the result is zero, the resources are + // unused. + Set columnNames = null; // Set<String(columnName)> + Map propertyCache = null; // Map<String(columnName), PropertyType> + Map relationPropertyCache = null; // Map<String(relationNoSuffix), + // Map<String(columnName), + // PropertyType>> + RelationRowCache relRowCache = null; + + final List list = new ArrayList(); + final int relSize = getBeanMetaData().getRelationPropertyTypeSize(); + final boolean hasCB = hasConditionBean(); + final boolean skipRelationLoop; + { + final boolean emptyRelation = isSelectedForeignInfoEmpty(); + final boolean hasOSC = hasOutsideSqlContext(); + final boolean specifiedOutsideSql = isSpecifiedOutsideSql(); + + // If it has condition-bean that has no relation to get + // or it has outside-sql context that is specified-outside-sql, + // they are unnecessary to do relation loop! + skipRelationLoop = (hasCB && emptyRelation) + || (hasOSC && specifiedOutsideSql); + } + + while (rs.next()) { + if (columnNames == null) { + columnNames = createColumnNames(rs.getMetaData()); + } + if (propertyCache == null) { + propertyCache = createPropertyCache(columnNames); + } + + // Create row instance of base table by row property cache. + final Object row = createRow(rs, propertyCache); + + // If it has condition-bean that has no relation to get + // or it has outside-sql context that is specified-outside-sql, + // they are unnecessary to do relation loop! + if (skipRelationLoop) { + postCreateRow(row); + list.add(row); + continue; + } + + if (relationPropertyCache == null) { + relationPropertyCache = createRelationPropertyCache(columnNames); + } + if (relRowCache == null) { + relRowCache = new RelationRowCache(relSize); + } + for (int i = 0; i < relSize; ++i) { + final RelationPropertyType rpt = getBeanMetaData() + .getRelationPropertyType(i); + if (rpt == null) { + continue; + } + + // Do only selected foreign property for performance if + // condition-bean exists. + if (hasCB + && !hasSelectedForeignInfo(buildRelationNoSuffix(rpt))) { + continue; + } + + final Map relKeyValues = new HashMap(); + final RelationKey relKey = createRelationKey(rs, rpt, + columnNames, relKeyValues); + Object relationRow = null; + if (relKey != null) { + relationRow = relRowCache.getRelationRow(i, relKey); + if (relationRow == null) { // when no cache + relationRow = createRelationRow(rs, rpt, columnNames, + relKeyValues, relationPropertyCache); + if (relationRow != null) { + relRowCache.addRelationRow(i, relKey, relationRow); + postCreateRow(relationRow); + } + } + } + if (relationRow != null) { + final PropertyDesc pd = rpt.getPropertyDesc(); + pd.setValue(row, relationRow); + } + } + postCreateRow(row); + list.add(row); + } + return list; + } + + protected RelationKey createRelationKey(ResultSet rs, + RelationPropertyType rpt, Set columnNames, Map relKeyValues) + throws SQLException { + final List keyList = new ArrayList(); + final BeanMetaData bmd = rpt.getBeanMetaData(); + for (int i = 0; i < rpt.getKeySize(); ++i) { + final ValueType valueType; + String columnName = rpt.getMyKey(i); + if (columnNames.contains(columnName)) { + final PropertyType pt = getBeanMetaData() + .getPropertyTypeByColumnName(columnName); + valueType = pt.getValueType(); + } else { + final PropertyType pt = bmd.getPropertyTypeByColumnName(rpt + .getYourKey(i)); + columnName = pt.getColumnName() + buildRelationNoSuffix(rpt); + if (columnNames.contains(columnName)) { + valueType = pt.getValueType(); + } else { + return null; + } + } + final Object value = valueType.getValue(rs, columnName); + if (value == null) { + return null; + } + relKeyValues.put(columnName, value); + keyList.add(value); + } + if (keyList.size() > 0) { + Object[] keys = keyList.toArray(); + return new RelationKey(keys); + } else { + return null; + } + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + protected boolean hasConditionBean() { + return ConditionBeanContext.isExistConditionBeanOnThread(); + } + + protected boolean isSelectedForeignInfoEmpty() { + if (!hasConditionBean()) { + return true; + } + ConditionBean cb = ConditionBeanContext.getConditionBeanOnThread(); + if (cb.getSqlClause().isSelectedForeignInfoEmpty()) { + return true; + } + return false; + } + + /** + * Has it selected foreign information? You should call hasConditionBean() + * before calling this! + * + * @param relationNoSuffix The suffix of relation NO. (NotNull) + * @return Determination. + */ + protected boolean hasSelectedForeignInfo(String relationNoSuffix) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + if (cb.getSqlClause().hasSelectedForeignInfo(relationNoSuffix)) { + return true; + } + return false; + } + + /** + * Build the string of relation No suffix. + * + * @param rpt The property type of relation. (NotNull) + * @return The string of relation No suffix. (NotNull) + */ + protected String buildRelationNoSuffix(RelationPropertyType rpt) { + return "_" + rpt.getRelationNo(); + } + + protected boolean hasOutsideSqlContext() { + return OutsideSqlContext.isExistOutsideSqlContextOnThread(); + } + + protected boolean isSpecifiedOutsideSql() { + if (!hasOutsideSqlContext()) { + return false; + } + final OutsideSqlContext context = OutsideSqlContext + .getOutsideSqlContextOnThread(); + return context.isSpecifiedOutsideSql(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/rshandler/InternalBeanListMetaDataResultSetHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,227 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; + +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; +import org.seasar.framework.exception.SRuntimeException; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractAutoStaticCommand extends + InternalAbstractStaticCommand { + + //========================================================================== + // ========= + // Definition + // ========== + protected static final boolean DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY = true; + + //========================================================================== + // ========= + // Attribute + // ========= + private PropertyType[] propertyTypes; + + private boolean checkSingleRowUpdate = true; + + protected boolean versionNoAutoIncrementOnMemory = DEFAULT_VERSION_NO_AUTO_INCREMENT_ON_MEMORY; + + //========================================================================== + // ========= + // Constructor + // =========== + 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) { + super(dataSource, statementFactory, beanMetaData); + this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; + setupPropertyTypes(propertyNames); + setupSql(); + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + InternalAbstractAutoHandler handler = createAutoHandler(); + 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( + Object bean, int rows) { + return new EntityAlreadyUpdatedException(bean, rows); + } + + protected PropertyType[] getPropertyTypes() { + return propertyTypes; + } + + protected void setPropertyTypes(PropertyType[] propertyTypes) { + this.propertyTypes = propertyTypes; + } + + protected abstract InternalAbstractAutoHandler createAutoHandler(); + + protected abstract void setupPropertyTypes(String[] propertyNames); + + protected void setupInsertPropertyTypes(String[] propertyNames) { + List<PropertyType> types = new ArrayList<PropertyType>(); + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = getBeanMetaData().getPropertyType( + propertyNames[i]); + if (isInsertTarget(pt)) { + types.add(pt); + } + } + propertyTypes = (PropertyType[]) types.toArray(new PropertyType[types + .size()]); + } + + protected boolean isInsertTarget(PropertyType propertyType) { + if (propertyType.isPrimaryKey()) { + String name = propertyType.getPropertyName(); + final IdentifierGenerator generator = getBeanMetaData() + .getIdentifierGenerator(name); + return generator.isSelfGenerate(); + } + return true; + } + + protected void setupUpdatePropertyTypes(String[] propertyNames) { + List<PropertyType> types = new ArrayList<PropertyType>(); + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = getBeanMetaData().getPropertyType( + propertyNames[i]); + if (pt.isPrimaryKey()) { + continue; + } + types.add(pt); + } + if (types.size() == 0) { + throw new SRuntimeException("EDAO0020"); + } + propertyTypes = (PropertyType[]) types.toArray(new PropertyType[types + .size()]); + } + + protected void setupDeletePropertyTypes(String[] propertyNames) { + } + + protected abstract void setupSql(); + + protected void setupInsertSql() { + BeanMetaData bmd = getBeanMetaData(); + StringBuilder sb = new StringBuilder(100); + sb.append("insert into "); + sb.append(bmd.getTableName()); + sb.append(" ("); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (isInsertTarget(pt)) { + sb.append(pt.getColumnName()); + sb.append(", "); + } + } + sb.setLength(sb.length() - 2); + sb.append(") values ("); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (isInsertTarget(pt)) { + sb.append("?, "); + } + } + sb.setLength(sb.length() - 2); + sb.append(")"); + setSql(sb.toString()); + } + + protected void setupUpdateSql() { + checkPrimaryKey(); + StringBuilder sb = new StringBuilder(100); + sb.append("update "); + sb.append(getBeanMetaData().getTableName()); + sb.append(" set "); + String versionNoPropertyName = getBeanMetaData() + .getVersionNoPropertyName(); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (pt.getPropertyName().equalsIgnoreCase(versionNoPropertyName) + && !versionNoAutoIncrementOnMemory) { + sb.append(pt.getColumnName()).append(" = ").append( + pt.getColumnName()).append(" + 1, "); + continue; + } + sb.append(pt.getColumnName()).append(" = ?, "); + } + sb.setLength(sb.length() - 2); + setupUpdateWhere(sb); + setSql(sb.toString()); + } + + protected void setupDeleteSql() { + checkPrimaryKey(); + StringBuilder sb = new StringBuilder(100); + sb.append("delete from "); + sb.append(getBeanMetaData().getTableName()); + setupUpdateWhere(sb); + setSql(sb.toString()); + } + + protected void checkPrimaryKey() { + BeanMetaData bmd = getBeanMetaData(); + if (bmd.getPrimaryKeySize() == 0) { + throw new PrimaryKeyNotFoundRuntimeException(bmd.getBeanClass()); + } + } + + protected void setupUpdateWhere(StringBuilder sb) { + BeanMetaData bmd = getBeanMetaData(); + sb.append(" where "); + for (int i = 0; i < bmd.getPrimaryKeySize(); ++i) { + sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); + } + sb.setLength(sb.length() - 5); + if (bmd.hasVersionNoPropertyType()) { + PropertyType pt = bmd.getVersionNoPropertyType(); + sb.append(" and ").append(pt.getColumnName()).append(" = ?"); + } + if (bmd.hasTimestampPropertyType()) { + PropertyType pt = bmd.getTimestampPropertyType(); + sb.append(" and ").append(pt.getColumnName()).append(" = ?"); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,64 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractBatchAutoStaticCommand extends + InternalAbstractAutoStaticCommand { + + //========================================================================== + // ========= + // 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, + boolean versionNoAutoIncrementOnMemory) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + versionNoAutoIncrementOnMemory); + this.returningRows = returningRows; + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + final InternalAbstractBatchAutoHandler handler = createBatchAutoHandler(); + + // It is unnecessary! + // injectDaoClass(handler); + + 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); + } + } + + protected abstract InternalAbstractBatchAutoHandler createBatchAutoHandler(); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,83 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractDynamicCommand extends + InternalAbstractSqlCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + protected Node rootNode; + + protected String[] argNames = new String[0]; + + protected Class<?>[] argTypes = new Class[0]; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalAbstractDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + //========================================================================== + // ========= + // Sql Handling + // ============ + public void setSql(String sql) { + super.setSql(sql); + this.rootNode = createInternalSqlParser(sql).parse(); + } + + protected InternalSqlParser createInternalSqlParser(String sql) { + return new InternalSqlParser(sql); + } + + public CommandContext apply(Object[] args) {// It is necessary to be public! + final CommandContext ctx = createCommandContext(args); + rootNode.accept(ctx); + return ctx; + } + + protected CommandContext createCommandContext(Object[] args) { + return createCommandContextCreator().createCommandContext(args); + } + + protected InternalCommandContextCreator createCommandContextCreator() { + return new InternalCommandContextCreator(argNames, argTypes); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String[] getArgNames() { + return argNames; + } + + public void setArgNames(String[] argNames) { + this.argNames = argNames; + } + + public Class<?>[] getArgTypes() { + return argTypes; + } + + public void setArgTypes(Class<?>[] argTypes) { + this.argTypes = argTypes; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,52 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractSqlCommand implements SqlCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + private DataSource dataSource; + + private StatementFactory statementFactory; + + private String sql; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalAbstractSqlCommand(DataSource dataSource, + StatementFactory statementFactory) { + this.dataSource = dataSource; + this.statementFactory = statementFactory; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public DataSource getDataSource() { + return dataSource; + } + + public StatementFactory getStatementFactory() { + return statementFactory; + } + + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractSqlCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractStaticCommand extends + InternalAbstractSqlCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + private BeanMetaData beanMetaData; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalAbstractStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData) { + super(dataSource, statementFactory); + this.beanMetaData = beanMetaData; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalAbstractStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,46 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteAutoStaticCommand extends + InternalAbstractAutoStaticCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalDeleteAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames) { + super(dataSource, statementFactory, beanMetaData, propertyNames); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return new InternalDeleteAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupDeleteSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupDeletePropertyTypes(propertyNames); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,57 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalDeleteBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteBatchAutoStaticCommand extends + InternalAbstractBatchAutoStaticCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalDeleteBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + returningRows); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return createBatchAutoHandler(); + } + + @Override + protected InternalAbstractBatchAutoHandler createBatchAutoHandler() { + return newInternalBatchAutoHandler(); + } + + protected InternalDeleteBatchAutoHandler newInternalBatchAutoHandler() { + return new InternalDeleteBatchAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupDeleteSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupDeletePropertyTypes(propertyNames); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,103 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteQueryAutoDynamicCommand implements SqlCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + protected DataSource dataSource; + + protected StatementFactory statementFactory; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalDeleteQueryAutoDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + this.dataSource = dataSource; + this.statementFactory = statementFactory; + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + ConditionBean cb = extractConditionBeanWithCheck(args); + String[] argNames = new String[] { "dto" }; + Class<?>[] argTypes = new Class<?>[] { cb.getClass() }; + String twoWaySql = buildQueryDeleteTwoWaySql(cb); + CommandContext context = createCommandContext(twoWaySql, argNames, + argTypes, args); + InternalCommandContextHandler handler = createCommandContextHandler(context); + handler.setLoggingMessageSqlArgs(context.getBindVariables()); + int rows = handler.execute(args); + return new Integer(rows); + } + + protected ConditionBean extractConditionBeanWithCheck(Object[] args) { + if (args == null || args.length == 0) { + String msg = "The arguments should have one argument! But:"; + msg = msg + " args=" + (args != null ? args.length : null); + throw new IllegalArgumentException(msg); + } + Object fisrtArg = args[0]; + if (!(fisrtArg instanceof ConditionBean)) { + String msg = "The type of argument should be " + + ConditionBean.class + "! But:"; + msg = msg + " type=" + fisrtArg.getClass(); + throw new IllegalArgumentException(msg); + } + return (ConditionBean) fisrtArg; + } + + protected InternalCommandContextHandler createCommandContextHandler( + CommandContext context) { + return new InternalCommandContextHandler(dataSource, statementFactory, + context); + } + + protected String buildQueryDeleteTwoWaySql(ConditionBean cb) { + return cb.getSqlClause().getClauseQueryDelete(); + } + + protected CommandContext createCommandContext(String twoWaySql, + String[] argNames, Class<?>[] argTypes, Object[] args) { + CommandContext context; + { + InternalSqlParser parser = new InternalSqlParser(twoWaySql); + Node node = parser.parse(); + InternalCommandContextCreator creator = new InternalCommandContextCreator( + argNames, argTypes); + context = creator.createCommandContext(args); + node.accept(context); + } + return context; + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalDeleteQueryAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,172 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.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; +import org.seasar.framework.exception.SRuntimeException; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertAutoDynamicCommand implements SqlCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + protected DataSource dataSource; + + protected StatementFactory statementFactory; + + protected BeanMetaData beanMetaData; + + protected String[] propertyNames; + + protected boolean checkSingleRowUpdate = true; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalInsertAutoDynamicCommand() { + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + final Object bean = args[0]; + final BeanMetaData bmd = getBeanMetaData(); + final PropertyType[] propertyTypes = createInsertPropertyTypes(bmd, + bean, getPropertyNames()); + final String sql = createInsertSql(bmd, propertyTypes); + final InternalInsertAutoHandler handler = new InternalInsertAutoHandler( + getDataSource(), getStatementFactory(), bmd, propertyTypes); + 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); + } + + protected String createInsertSql(BeanMetaData bmd, + PropertyType[] propertyTypes) { + StringBuffer buf = new StringBuffer(100); + buf.append("insert into "); + buf.append(bmd.getTableName()); + buf.append(" ("); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + final String columnName = pt.getColumnName(); + if (i > 0) { + buf.append(", "); + } + buf.append(columnName); + } + buf.append(") values ("); + for (int i = 0; i < propertyTypes.length; ++i) { + if (i > 0) { + buf.append(", "); + } + buf.append("?"); + } + buf.append(")"); + return buf.toString(); + } + + protected PropertyType[] createInsertPropertyTypes(BeanMetaData bmd, + Object bean, String[] propertyNames) { + + if (0 == propertyNames.length) { + throw new SRuntimeException("EDAO0024", new Object[] { bean + .getClass().getName() }); + } + List<PropertyType> types = new ArrayList<PropertyType>(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = bmd.getPropertyType(propertyNames[i]); + if (pt.isPrimaryKey()) { + final IdentifierGenerator generator = bmd + .getIdentifierGenerator(pt.getPropertyName()); + if (!generator.isSelfGenerate()) { + continue; + } + } else { + if (pt.getPropertyDesc().getValue(bean) == null) { + final String propertyName = pt.getPropertyName(); + if (!propertyName.equalsIgnoreCase(timestampPropertyName) + && !propertyName + .equalsIgnoreCase(versionNoPropertyName)) { + continue; + } + } + } + types.add(pt); + } + if (types.isEmpty()) { + throw new SRuntimeException("EDAO0014"); + } + PropertyType[] propertyTypes = (PropertyType[]) types + .toArray(new PropertyType[types.size()]); + return propertyTypes; + } + + //========================================================================== + // ========= + // Accessor + // ======== + protected DataSource getDataSource() { + return dataSource; + } + + public void setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + } + + protected StatementFactory getStatementFactory() { + return statementFactory; + } + + public void setStatementFactory(StatementFactory statementFactory) { + this.statementFactory = statementFactory; + } + + protected BeanMetaData getBeanMetaData() { + return beanMetaData; + } + + public void setBeanMetaData(BeanMetaData beanMetaData) { + this.beanMetaData = beanMetaData; + } + + protected String[] getPropertyNames() { + return propertyNames; + } + + public void setPropertyNames(String[] propertyNames) { + this.propertyNames = propertyNames; + } + + public boolean isCheckSingleRowUpdate() { + return checkSingleRowUpdate; + } + + public void setCheckSingleRowUpdate(boolean checkSingleRowUpdate) { + this.checkSingleRowUpdate = checkSingleRowUpdate; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,53 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalInsertBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertBatchAutoStaticCommand extends + InternalAbstractBatchAutoStaticCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalInsertBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + returningRows); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return createBatchAutoHandler(); + } + + @Override + protected InternalAbstractBatchAutoHandler createBatchAutoHandler() { + return new InternalInsertBatchAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupInsertSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupInsertPropertyTypes(propertyNames); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalInsertBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,83 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalProcedureHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; + +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalProcedureCommand implements SqlCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + protected DataSource dataSource; + + protected ResultSetHandler resultSetHandler; + + protected StatementFactory statementFactory; + + protected InternalProcedureMetaData procedureMetaData; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalProcedureCommand(DataSource dataSource, + ResultSetHandler resultSetHandler, + StatementFactory statementFactory, + InternalProcedureMetaData procedureMetaData) { + this.dataSource = dataSource; + this.resultSetHandler = resultSetHandler; + this.statementFactory = statementFactory; + this.procedureMetaData = procedureMetaData; + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(final Object[] args) { + final InternalProcedureHandler handler = newArgumentDtoProcedureHandler(); + final OutsideSqlContext outsideSqlContext = OutsideSqlContext + .getOutsideSqlContextOnThread(); + final Object pmb = outsideSqlContext.getParameterBean(); + // The logging message SQL of procedure is unnecessary. + // handler.setLoggingMessageSqlArgs(...); + return handler.execute(new Object[] { pmb }); + } + + protected InternalProcedureHandler newArgumentDtoProcedureHandler() { + return new InternalProcedureHandler(dataSource, + createSql(procedureMetaData), resultSetHandler, + statementFactory, procedureMetaData); + } + + protected String createSql(final InternalProcedureMetaData procedureMetaData) { + final StringBuilder sb = new StringBuilder(); + sb.append("{"); + int size = procedureMetaData.parameterTypes().size(); + if (procedureMetaData.hasReturnParameterType()) { + sb.append("? = "); + size--; + } + sb.append("call ").append(procedureMetaData.getProcedureName()).append( + "("); + for (int i = 0; i < size; i++) { + sb.append("?, "); + } + if (size > 0) { + sb.setLength(sb.length() - 2); + } + sb.append(")}"); + return sb.toString(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalProcedureCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,233 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.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 { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalUpdateAutoDynamicCommand.class); + + private static final Integer NO_UPDATE = new Integer(0); + + //========================================================================== + // ========= + // Attribute + // ========= + private BeanMetaData beanMetaData; + + private String[] propertyNames; + + private boolean checkSingleRowUpdate = true; + + private boolean versionNoAutoIncrementOnMemory = true; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateAutoDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + final Object bean = args[0]; + final BeanMetaData bmd = getBeanMetaData(); + final PropertyType[] propertyTypes = createUpdatePropertyTypes(bmd, + bean, getPropertyNames()); + if (propertyTypes.length == 0) { + if (_log.isDebugEnabled()) { + _log.debug(createNoUpdateLogMessage(bean, bmd)); + } + return NO_UPDATE; + } + InternalUpdateAutoHandler handler = createInternalUpdateAutoHandler( + bmd, propertyTypes); + handler.setSql(createUpdateSql(bmd, propertyTypes, bean)); + handler.setLoggingMessageSqlArgs(args); + int i = handler.execute(args); + + // [Comment Out]: This statement moved to the handler at + // [DBFlute-0.8.0]. + // if (isCheckSingleRowUpdate() && i < 1) { + // throw createNotSingleRowUpdatedRuntimeException(args[0], i); + // } + + return new Integer(i); + } + + protected InternalUpdateAutoHandler createInternalUpdateAutoHandler( + BeanMetaData bmd, PropertyType[] propertyTypes) { + InternalUpdateAutoHandler handler = new InternalUpdateAutoHandler( + getDataSource(), getStatementFactory(), bmd, propertyTypes); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); + handler.setCheckSingleRowUpdate(isCheckSingleRowUpdate()); //[DBFlute-0.8 + // .0] + return handler; + } + + protected PropertyType[] createUpdatePropertyTypes(BeanMetaData bmd, + Object bean, String[] propertyNames) { + final List<PropertyType> types = new ArrayList<PropertyType>(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyNames.length; ++i) { + PropertyType pt = bmd.getPropertyType(propertyNames[i]); + if (pt.isPrimaryKey() == false) { + String propertyName = pt.getPropertyName(); + if (propertyName.equalsIgnoreCase(timestampPropertyName) + || propertyName.equalsIgnoreCase(versionNoPropertyName) + || pt.getPropertyDesc().getValue(bean) != null) { + types.add(pt); + } + } + } + if (types.isEmpty()) { + throw new NoUpdatePropertyTypeRuntimeException(); + } + PropertyType[] propertyTypes = (PropertyType[]) types + .toArray(new PropertyType[types.size()]); + return propertyTypes; + } + + protected String createNoUpdateLogMessage(final Object bean, + final BeanMetaData bmd) { + final StringBuffer sb = new StringBuffer(); + sb.append("skip UPDATE: table=").append(bmd.getTableName()); + final int size = bmd.getPrimaryKeySize(); + for (int i = 0; i < size; i++) { + if (i == 0) { + sb.append(", key{"); + } else { + sb.append(", "); + } + final String keyName = bmd.getPrimaryKey(i); + sb.append(keyName).append("="); + sb.append(bmd.getPropertyTypeByColumnName(keyName) + .getPropertyDesc().getValue(bean)); + if (i == size - 1) { + sb.append("}"); + } + } + final String s = new String(sb); + return s; + } + + /** + * Create update SQL. The update is by the primary keys. + * + * @param bmd The meta data of bean. (NotNull & RequiredPrimaryKeys) + * @param propertyTypes The types of property for update. (NotNull) + * @param bean A bean for update for handling version no and so on. + * (NotNull) + * @return The update SQL. (NotNull) + */ + protected String createUpdateSql(BeanMetaData bmd, + PropertyType[] propertyTypes, Object bean) { + if (bmd.getPrimaryKeySize() == 0) { + String msg = "The table '" + bmd.getTableName() + + "' does not have primary keys!"; + throw new IllegalStateException(msg); + } + final StringBuilder sb = new StringBuilder(100); + sb.append("update "); + sb.append(bmd.getTableName()); + sb.append(" set "); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + final String columnName = pt.getColumnName(); + if (i > 0) { + sb.append(", "); + } + if (pt.getPropertyName().equalsIgnoreCase(versionNoPropertyName)) { + if (!isVersionNoAutoIncrementOnMemory()) { + setupVersionNoAutoIncrementOnQuery(sb, columnName); + continue; + } + final Object versionNo = pt.getPropertyDesc().getValue(bean); + if (versionNo == null) { + setupVersionNoAutoIncrementOnQuery(sb, columnName); + continue; + } + } + sb.append(columnName).append(" = ?"); + } + sb.append(" where "); + for (int i = 0; i < bmd.getPrimaryKeySize(); ++i) { + sb.append(bmd.getPrimaryKey(i)).append(" = ? and "); + } + sb.setLength(sb.length() - 5); + if (bmd.hasVersionNoPropertyType()) { + PropertyType pt = bmd.getVersionNoPropertyType(); + sb.append(" and ").append(pt.getColumnName()).append(" = ?"); + } + if (bmd.hasTimestampPropertyType()) { + PropertyType pt = bmd.getTimestampPropertyType(); + sb.append(" and ").append(pt.getColumnName()).append(" = ?"); + } + return sb.toString(); + } + + protected boolean isVersionNoAutoIncrementOnMemory() { + return versionNoAutoIncrementOnMemory; + } + + public void setVersionNoAutoIncrementOnMemory( + boolean versionNoAutoIncrementOnMemory) { + this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; + } + + protected void setupVersionNoAutoIncrementOnQuery(StringBuilder sb, + String columnName) { + sb.append(columnName).append(" = ").append(columnName).append(" + 1"); + } + + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } + + public void setBeanMetaData(BeanMetaData beanMetaData) { + this.beanMetaData = beanMetaData; + } + + public String[] getPropertyNames() { + return propertyNames; + } + + public void setPropertyNames(String[] propertyNames) { + this.propertyNames = propertyNames; + } + + public boolean isCheckSingleRowUpdate() { + return checkSingleRowUpdate; + } + + public void setCheckSingleRowUpdate(boolean resultCheck) { + this.checkSingleRowUpdate = resultCheck; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,61 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalAbstractBatchAutoHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalUpdateBatchAutoHandler; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateBatchAutoStaticCommand extends + InternalAbstractBatchAutoStaticCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateBatchAutoStaticCommand(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + String[] propertyNames, boolean returningRows, + boolean versionNoAutoIncrementOnMemory) { + super(dataSource, statementFactory, beanMetaData, propertyNames, + returningRows, versionNoAutoIncrementOnMemory); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected InternalAbstractAutoHandler createAutoHandler() { + return createBatchAutoHandler(); + } + + @Override + protected InternalAbstractBatchAutoHandler createBatchAutoHandler() { + InternalUpdateBatchAutoHandler handler = newInternalBatchAutoHandler(); + handler + .setVersionNoAutoIncrementOnMemory(versionNoAutoIncrementOnMemory); + return handler; + } + + protected InternalUpdateBatchAutoHandler newInternalBatchAutoHandler() { + return new InternalUpdateBatchAutoHandler(getDataSource(), + getStatementFactory(), getBeanMetaData(), getPropertyTypes()); + } + + @Override + protected void setupSql() { + setupUpdateSql(); + } + + @Override + protected void setupPropertyTypes(String[] propertyNames) { + setupUpdatePropertyTypes(propertyNames); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateBatchAutoStaticCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,38 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalBasicUpdateHandler; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateDynamicCommand extends + InternalAbstractDynamicCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object args[]) { + final CommandContext ctx = apply(args); + final InternalBasicUpdateHandler updateHandler = new InternalBasicUpdateHandler( + getDataSource(), ctx.getSql(), getStatementFactory()); + Object[] bindVariables = ctx.getBindVariables(); + updateHandler.setLoggingMessageSqlArgs(bindVariables); + return new Integer(updateHandler.execute(bindVariables, ctx + .getBindVariableTypes())); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,55 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateModifiedOnlyCommand extends + InternalUpdateAutoDynamicCommand { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateModifiedOnlyCommand(DataSource dataSource, + StatementFactory statementFactory) { + super(dataSource, statementFactory); + } + + //========================================================================== + // ========= + // No.1 Point Override + // =================== + @Override + protected PropertyType[] createUpdatePropertyTypes(final BeanMetaData bmd, + final Object bean, final String[] propertyNames) { + final Set<?> modifiedPropertyNames = getBeanMetaData() + .getModifiedPropertyNames(bean); + final List<PropertyType> types = new ArrayList<PropertyType>(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyNames.length; ++i) { + final PropertyType pt = bmd.getPropertyType(propertyNames[i]); + if (pt.isPrimaryKey() == false) { + final String propertyName = pt.getPropertyName(); + if (propertyName.equalsIgnoreCase(timestampPropertyName) + || propertyName.equalsIgnoreCase(versionNoPropertyName) + || modifiedPropertyNames.contains(propertyName)) { + types.add(pt); + } + } + } + final PropertyType[] propertyTypes = (PropertyType[]) types + .toArray(new PropertyType[types.size()]); + return propertyTypes; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateModifiedOnlyCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,229 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlcommand; + +import java.lang.reflect.Method; +import java.sql.Timestamp; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler.InternalCommandContextHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalCommandContextCreator; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser.InternalSqlParser; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.dao.SqlCommand; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateQueryAutoDynamicCommand implements SqlCommand { + + //========================================================================== + // ========= + // Attribute + // ========= + protected DataSource dataSource; + + protected StatementFactory statementFactory; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateQueryAutoDynamicCommand(DataSource dataSource, + StatementFactory statementFactory) { + this.dataSource = dataSource; + this.statementFactory = statementFactory; + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + ConditionBean cb = extractConditionBeanWithCheck(args); + Entity entity = extractEntityWithCheck(args); + String[] argNames = new String[] { "dto", "entity" }; + Class<?>[] argTypes = new Class<?>[] { cb.getClass(), entity.getClass() }; + String twoWaySql = buildQueryUpdateTwoWaySql(cb, entity); + if (twoWaySql == null) { + return 0;// No execute! + } + CommandContext context = createCommandContext(twoWaySql, argNames, + argTypes, args); + InternalCommandContextHandler handler = createCommandContextHandler(context); + handler.setLoggingMessageSqlArgs(context.getBindVariables()); + int rows = handler.execute(args); + return new Integer(rows); + } + + protected ConditionBean extractConditionBeanWithCheck(Object[] args) { + assertArgument(args); + Object fisrtArg = args[0]; + if (!(fisrtArg instanceof ConditionBean)) { + String msg = "The type of first argument should be " + + ConditionBean.class + "! But:"; + msg = msg + " type=" + fisrtArg.getClass(); + throw new IllegalArgumentException(msg); + } + return (ConditionBean) fisrtArg; + } + + protected Entity extractEntityWithCheck(Object[] args) { + assertArgument(args); + Object secondArg = args[1]; + if (!(secondArg instanceof Entity)) { + String msg = "The type of second argument should be " + + Entity.class + "! But:"; + msg = msg + " type=" + secondArg.getClass(); + throw new IllegalArgumentException(msg); + } + return (Entity) secondArg; + } + + protected void assertArgument(Object[] args) { + if (args == null || args.length <= 1) { + String msg = "The arguments should have two argument! But:"; + msg = msg + " args=" + (args != null ? args.length : null); + throw new IllegalArgumentException(msg); + } + } + + protected InternalCommandContextHandler createCommandContextHandler( + CommandContext context) { + return new InternalCommandContextHandler(dataSource, statementFactory, + context); + } + + /** + * @param cb Condition-bean. (NotNull) + * @param entity Entity. (NotNull) + * @return The two-way SQL of query update. (Nullable: If the set of + * modified properties is empty, return null.) + */ + protected String buildQueryUpdateTwoWaySql(ConditionBean cb, Entity entity) { + Map<String, String> columnParameterMap = new LinkedHashMap<String, String>(); + DBMeta dbmeta = DBMetaInstanceHandler.findDBMeta(entity + .getTableDbName()); + Set<String> modifiedPropertyNames = entity.getModifiedPropertyNames(); + if (modifiedPropertyNames.isEmpty()) { + return null; + } + String currentPropertyName = null; + try { + for (String propertyName : modifiedPropertyNames) { + currentPropertyName = propertyName; + ColumnInfo columnInfo = dbmeta.findColumnInfo(propertyName); + String columnName = columnInfo.getColumnDbName(); + Method getter = columnInfo.findGetter(); + Object value = getter.invoke(entity, (Object[]) null); + if (value != null) { + columnParameterMap.put(columnName, "/*entity." + + propertyName + "*/null"); + } else { + columnParameterMap.put(columnName, "null"); + } + } + if (dbmeta.hasVersionNo()) { + ColumnInfo columnInfo = dbmeta.getVersionNoColumnInfo(); + String columnName = columnInfo.getColumnDbName(); + columnParameterMap.put(columnName, columnName + " + 1"); + } + if (dbmeta.hasUpdateDate()) { + ColumnInfo columnInfo = dbmeta.getUpdateDateColumnInfo(); + Method setter = columnInfo.findSetter(); + if (Timestamp.class.isAssignableFrom(columnInfo + .getPropertyType())) { + setter.invoke(entity, new Timestamp(System + .currentTimeMillis())); + } else { + setter.invoke(entity, new Date()); + } + String columnName = columnInfo.getColumnDbName(); + columnParameterMap.put(columnName, "/*entity." + + columnInfo.getPropertyName() + "*/null"); + } + } catch (Exception e) { + throwQueryUpdateFailureException(cb, entity, currentPropertyName, e); + } + return cb.getSqlClause().getClauseQueryUpdate(columnParameterMap); + } + + protected void throwQueryUpdateFailureException(ConditionBean cb, + Entity entity, String propertyName, Exception e) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "queryUpdate() failed to execute!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the parameter comment logic." + + getLineSeparator(); + msg = msg + + "It may exist the parameter comment that DOESN'T have an end comment." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + + " before (x) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Doubtful Property Name]" + getLineSeparator() + + propertyName + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean]" + getLineSeparator() + cb + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Entity]" + getLineSeparator() + entity + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Exception Message]" + getLineSeparator() + e.getMessage() + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new QueryUpdateFailureException(msg, e); + } + + public static class QueryUpdateFailureException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public QueryUpdateFailureException(String msg, Exception e) { + super(msg, e); + } + } + + protected CommandContext createCommandContext(String twoWaySql, + String[] argNames, Class<?>[] argTypes, Object[] args) { + CommandContext context; + { + InternalSqlParser parser = new InternalSqlParser(twoWaySql); + Node node = parser.parse(); + InternalCommandContextCreator creator = new InternalCommandContextCreator( + argNames, argTypes); + context = creator.createCommandContext(args); + node.accept(context); + } + return context; + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlcommand/InternalUpdateQueryAutoDynamicCommand.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,271 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.sql.DataSource; + +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) + */ +public abstract class InternalAbstractAutoHandler extends InternalBasicHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BeanMetaData beanMetaData; + + protected Object[] bindVariables; + + protected ValueType[] bindVariableValueTypes; + + protected Timestamp timestamp; + + protected Integer versionNo; + + protected PropertyType[] propertyTypes; + + protected boolean versionNoAutoIncrementOnMemory = true; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalAbstractAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory); + this.beanMetaData = beanMetaData; + this.propertyTypes = propertyTypes; + } + + public int execute(Object[] args) { + Connection connection = getConnection(); + try { + return execute(connection, args[0]); + } finally { + close(connection); + } + } + + public int execute(Object[] args, Class<?>[] argTypes) { + return execute(args); + } + + protected int execute(Connection connection, Object bean) { + preUpdateBean(bean); + setupBindVariables(bean); + logSql(bindVariables, getArgTypes(bindVariables)); + PreparedStatement ps = prepareStatement(connection); + int ret = -1; + try { + bindArgs(ps, bindVariables, bindVariableValueTypes); + ret = executeUpdate(ps); + } finally { + close(ps); + } + postUpdateBean(bean, ret); + return ret; + } + + protected void bindArgs(PreparedStatement ps, Object[] args, + ValueType[] valueTypes) { + if (args == null) { + return; + } + for (int i = 0; i < args.length; ++i) { + ValueType valueType = valueTypes[i]; + try { + valueType.bindValue(ps, i + 1, args[i]); + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + } + + protected void preUpdateBean(Object bean) { + } + + protected void postUpdateBean(Object bean, int ret) { + } + + protected abstract void setupBindVariables(Object bean); + + protected void setupInsertBindVariables(Object bean) { + final List<Object> varList = new ArrayList<Object>(); + final List<ValueType> varValueTypeList = new ArrayList<ValueType>(); + final BeanMetaData bmd = getBeanMetaData(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (pt.getPropertyName().equalsIgnoreCase(timestampPropertyName)) { + setTimestamp(new Timestamp(new Date().getTime())); + varList.add(getTimestamp()); + } else if (pt.getPropertyName().equalsIgnoreCase( + versionNoPropertyName)) { + setVersionNo(new Integer(0)); + varList.add(getVersionNo()); + } else { + varList.add(pt.getPropertyDesc().getValue(bean)); + } + varValueTypeList.add(pt.getValueType()); + } + setBindVariables(varList.toArray()); + setBindVariableValueTypes((ValueType[]) varValueTypeList + .toArray(new ValueType[varValueTypeList.size()])); + } + + protected void setupUpdateBindVariables(Object bean) { + final List<Object> varList = new ArrayList<Object>(); + final List<ValueType> varValueTypeList = new ArrayList<ValueType>(); + final BeanMetaData bmd = getBeanMetaData(); + final String timestampPropertyName = bmd.getTimestampPropertyName(); + final String versionNoPropertyName = bmd.getVersionNoPropertyName(); + for (int i = 0; i < propertyTypes.length; ++i) { + PropertyType pt = propertyTypes[i]; + if (pt.getPropertyName().equalsIgnoreCase(timestampPropertyName)) { + setTimestamp(new Timestamp(new Date().getTime())); + varList.add(getTimestamp()); + } else if (pt.getPropertyName().equalsIgnoreCase( + versionNoPropertyName)) { + if (!isVersionNoAutoIncrementOnMemory()) { + continue;// because of always 'VERSION_NO = VERSION_NO + 1' + } + Object value = pt.getPropertyDesc().getValue(bean); + if (value == null) { + continue;// because of 'VERSION_NO = VERSION_NO + 1' + } + int intValue = IntegerConversionUtil.toPrimitiveInt(value) + 1; + setVersionNo(new Integer(intValue)); + varList.add(getVersionNo()); + } else { + varList.add(pt.getPropertyDesc().getValue(bean)); + } + varValueTypeList.add(pt.getValueType()); + } + addAutoUpdateWhereBindVariables(varList, varValueTypeList, bean); + setBindVariables(varList.toArray()); + setBindVariableValueTypes((ValueType[]) varValueTypeList + .toArray(new ValueType[varValueTypeList.size()])); + } + + protected void setupDeleteBindVariables(Object bean) { + final List<Object> varList = new ArrayList<Object>(); + final List<ValueType> varValueTypeList = new ArrayList<ValueType>(); + addAutoUpdateWhereBindVariables(varList, varValueTypeList, bean); + setBindVariables(varList.toArray()); + setBindVariableValueTypes((ValueType[]) varValueTypeList + .toArray(new ValueType[varValueTypeList.size()])); + } + + protected void addAutoUpdateWhereBindVariables(List<Object> varList, + List<ValueType> varValueTypeList, Object bean) { + BeanMetaData bmd = getBeanMetaData(); + for (int i = 0; i < bmd.getPrimaryKeySize(); ++i) { + PropertyType pt = bmd.getPropertyTypeByColumnName(bmd + .getPrimaryKey(i)); + PropertyDesc pd = pt.getPropertyDesc(); + varList.add(pd.getValue(bean)); + varValueTypeList.add(pt.getValueType()); + } + if (bmd.hasVersionNoPropertyType()) { + PropertyType pt = bmd.getVersionNoPropertyType(); + PropertyDesc pd = pt.getPropertyDesc(); + varList.add(pd.getValue(bean)); + varValueTypeList.add(pt.getValueType()); + } + if (bmd.hasTimestampPropertyType()) { + PropertyType pt = bmd.getTimestampPropertyType(); + PropertyDesc pd = pt.getPropertyDesc(); + varList.add(pd.getValue(bean)); + varValueTypeList.add(pt.getValueType()); + } + } + + protected void updateTimestampIfNeed(Object bean) { + if (getTimestamp() != null) { + PropertyDesc pd = getBeanMetaData().getTimestampPropertyType() + .getPropertyDesc(); + pd.setValue(bean, getTimestamp()); + } + } + + protected void updateVersionNoIfNeed(Object bean) { + if (getVersionNo() != null) { + PropertyDesc pd = getBeanMetaData().getVersionNoPropertyType() + .getPropertyDesc(); + pd.setValue(bean, getVersionNo()); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public BeanMetaData getBeanMetaData() { + return beanMetaData; + } + + protected Object[] getBindVariables() { + return bindVariables; + } + + protected void setBindVariables(Object[] bindVariables) { + this.bindVariables = bindVariables; + } + + protected ValueType[] getBindVariableValueTypes() { + return bindVariableValueTypes; + } + + protected void setBindVariableValueTypes(ValueType[] bindVariableValueTypes) { + this.bindVariableValueTypes = bindVariableValueTypes; + } + + protected Timestamp getTimestamp() { + return timestamp; + } + + protected void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + + protected Integer getVersionNo() { + return versionNo; + } + + protected void setVersionNo(Integer versionNo) { + this.versionNo = versionNo; + } + + protected PropertyType[] getPropertyTypes() { + return propertyTypes; + } + + protected void setPropertyTypes(PropertyType[] propertyTypes) { + this.propertyTypes = propertyTypes; + } + + protected boolean isVersionNoAutoIncrementOnMemory() { + return versionNoAutoIncrementOnMemory; + } + + public void setVersionNoAutoIncrementOnMemory( + boolean versionNoAutoIncrementOnMemory) { + this.versionNoAutoIncrementOnMemory = versionNoAutoIncrementOnMemory; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,137 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public abstract class InternalAbstractBatchAutoHandler extends + InternalAbstractAutoHandler { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalAbstractBatchAutoHandler.class); + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalAbstractBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Execute + // ======= + public int[] execute(List<?> list, Class<?>[] argTypes) { + return execute(list); + } + + public int[] execute(List<?> list) { + if (list == null) { + throw new IllegalArgumentException("list"); + } + if (list.isEmpty()) { + if (_log.isDebugEnabled()) { + _log.debug("Skip executeBatch() bacause of the empty list."); + } + return new int[0]; + } + final Connection connection = getConnection(); + try { + final PreparedStatement ps = prepareStatement(connection); + try { + for (Iterator<?> iter = list.iterator(); iter.hasNext();) { + final Object bean = (Object) iter.next(); + prepareBatchElement(ps, bean); + } + return executeBatch(ps, list); + } finally { + close(ps); + } + } finally { + close(connection); + } + // Reflection to bean is unsupported at batch update. + // 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]; + } + 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); + } + + protected void prepareBatchElement(PreparedStatement ps, Object bean) { + setupBindVariables(bean); + logSql(getBindVariables(), getArgTypes(getBindVariables())); + bindArgs(ps, getBindVariables(), getBindVariableValueTypes()); + addBatch(ps); + } + + //========================================================================== + // ========= + // JDBC Delegator + // ============== + protected int[] executeBatch(PreparedStatement ps, List<?> list) { + try { + return ps.executeBatch(); + } catch (SQLException e) { + handleSQLException(e, ps, true); + return null; // Unreachable! + } + } + + protected void addBatch(PreparedStatement ps) { + try { + ps.addBatch(); + } catch (SQLException e) { + handleSQLException(e, ps); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalAbstractBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,623 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +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.scheduler.db.allcommon.CallbackContext; +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; +import jp.sf.pal.scheduler.db.allcommon.InternalMapContext; +import jp.sf.pal.scheduler.db.allcommon.QLog; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException; +import jp.sf.pal.scheduler.db.allcommon.exception.SQLFailureException; +import jp.sf.pal.scheduler.db.allcommon.jdbc.SqlLogHandler; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqllog.InternalSqlLogRegistry; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.util.InternalBindVariableUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +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) + */ +public class InternalBasicHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + private DataSource dataSource; + + private String sql; + + private StatementFactory statementFactory; + + private Object[] loggingMessageSqlArgs; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalBasicHandler(DataSource ds, StatementFactory statementFactory) { + setDataSource(ds); + setStatementFactory(statementFactory); + } + + public InternalBasicHandler(DataSource ds, String sql, + StatementFactory statementFactory) { + setDataSource(ds); + setSql(sql); + setStatementFactory(statementFactory); + } + + //========================================================================== + // ========= + // Common Logic + // ============ + // ----------------------------------------------------- + // Args Handling + // ------------- + protected void bindArgs(PreparedStatement ps, Object[] args, + Class<?>[] argTypes) { + if (args == null) { + return; + } + for (int i = 0; i < args.length; ++i) { + ValueType valueType = getValueType(argTypes[i]); + try { + valueType.bindValue(ps, i + 1, args[i]); + } catch (SQLException e) { + handleSQLException(e, ps); + } + } + } + + protected Class<?>[] getArgTypes(Object[] args) { + if (args == null) { + return null; + } + Class<?>[] argTypes = new Class[args.length]; + for (int i = 0; i < args.length; ++i) { + Object arg = args[i]; + if (arg != null) { + argTypes[i] = arg.getClass(); + } + } + return argTypes; + } + + // ----------------------------------------------------- + // SQL Logging + // ----------- + protected void logSql(Object[] args, Class<?>[] argTypes) { + final SqlLogHandler sqlLogHandler = getSqlLogHander(); + final boolean existsSqlLogHandler = sqlLogHandler != null; + final Object sqlLogRegistry = InternalSqlLogRegistry + .findContainerSqlLogRegistry(); + final boolean existsSqlLogRegistry = sqlLogRegistry != null; + if (isLogEnabled() || existsSqlLogHandler || existsSqlLogRegistry) { + final String completeSql = getCompleteSql(args); + if (isLogEnabled()) { + log((isContainsLineSeparatorInSql() ? getLineSeparator() : "") + + completeSql); + } + if (existsSqlLogHandler) { // DBFlute provides + sqlLogHandler.handle(getSql(), completeSql, args, argTypes); + } + if (existsSqlLogRegistry) { // S2Container provides + InternalSqlLogRegistry.push(getSql(), completeSql, args, + argTypes, sqlLogRegistry); + } + } + } + + protected boolean isLogEnabled() { + return QLog.isLogEnabled(); + } + + protected void log(String msg) { + QLog.log(msg); + } + + protected String getCompleteSql(Object[] args) { + return InternalBindVariableUtil.getCompleteSql(sql, args); + } + + protected SqlLogHandler getSqlLogHander() { + if (!CallbackContext.isExistCallbackContextOnThread()) { + return null; + } + return CallbackContext.getCallbackContextOnThread().getSqlLogHandler(); + } + + protected boolean isContainsLineSeparatorInSql() { + return sql != null ? sql.contains(getLineSeparator()) : false; + } + + // ----------------------------------------------------- + // Various + // ------- + protected String getBindVariableText(Object bindVariable) { + return InternalBindVariableUtil.getBindVariableText(bindVariable); + } + + protected ValueType getValueType(Class<?> clazz) { + return ValueTypes.getValueType(clazz); + } + + //========================================================================== + // ========= + // Exception Handler + // ================= + protected void handleSQLException(SQLException e, Statement statement) { + handleSQLException(e, statement, false); + } + + protected void handleSQLException(SQLException e, Statement statement, + boolean uniqueConstraintValid) { + String completeSql = buildLoggingMessageSql(); + new SQLExceptionHandler().handleSQLException(e, statement, + uniqueConstraintValid, completeSql); + } + + protected String buildLoggingMessageSql() { + String completeSql = null; + if (sql != null && loggingMessageSqlArgs != null) { + try { + completeSql = getCompleteSql(loggingMessageSqlArgs); + } catch (RuntimeException ignored) { + } + } + return completeSql; + } + + public static class SQLExceptionHandler { + + public void handleSQLException(SQLException e, Statement statement) { + handleSQLException(e, statement, false); + } + + public void handleSQLException(SQLException e, Statement statement, + boolean uniqueConstraintValid) { + handleSQLException(e, statement, uniqueConstraintValid, null); + } + + 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); + } + throwSQLFailureException(e, statement, completeSql); + } + + protected boolean isUniqueConstraintException(SQLException e) { + DBFluteConfig.UniqueConstraintDeterminator determinator = getUniqueConstraintDeterminator(); + if (determinator != null) { + return determinator.isUniqueConstraintException(e); + } + return ConditionBeanContext.isUniqueConstraintException( + extractSQLState(e), e.getErrorCode()); + } + + protected DBFluteConfig.UniqueConstraintDeterminator getUniqueConstraintDeterminator() { + return DBFluteConfig.getInstance() + .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(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The entity already exists on the database!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the primary key whether it already exists on the database." + + getLineSeparator(); + msg = msg + "And confirm the unique constraint for other columns." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[SQLState]" + getLineSeparator() + extractSQLState(e) + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ErrorCode]" + getLineSeparator() + e.getErrorCode() + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[SQLException]" + getLineSeparator() + + e.getClass().getName() + getLineSeparator(); + msg = msg + e.getMessage() + getLineSeparator(); + SQLException nextEx = e.getNextException(); + if (nextEx != null) { + msg = msg + getLineSeparator(); + msg = msg + "[NextException]" + getLineSeparator(); + msg = msg + nextEx.getClass().getName() + getLineSeparator(); + msg = msg + nextEx.getMessage() + getLineSeparator(); + SQLException nextNextEx = nextEx.getNextException(); + if (nextNextEx != null) { + msg = msg + getLineSeparator(); + msg = msg + "[NextNextException]" + getLineSeparator(); + msg = msg + nextNextEx.getClass().getName() + + getLineSeparator(); + msg = msg + nextNextEx.getMessage() + getLineSeparator(); + } + } + Object invokeName = extractBehaviorInvokeName(); + if (invokeName != null) { + msg = msg + getLineSeparator(); + msg = msg + "[Behavior]" + getLineSeparator(); + msg = msg + invokeName + getLineSeparator(); + } + if (hasConditionBean()) { + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean]" + getLineSeparator(); + msg = msg + getConditionBean().getClass().getName() + + getLineSeparator(); + } + if (hasOutsideSqlContext()) { + msg = msg + getLineSeparator(); + msg = msg + "[OutsideSql]" + getLineSeparator(); + msg = msg + getOutsideSqlContext().getOutsideSqlPath() + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ParameterBean]" + getLineSeparator(); + Object pmb = getOutsideSqlContext().getParameterBean(); + if (pmb != null) { + msg = msg + pmb.getClass().getName() + getLineSeparator(); + msg = msg + pmb + getLineSeparator(); + } else { + msg = msg + pmb + getLineSeparator(); + } + } + if (statement != null) { + msg = msg + getLineSeparator(); + msg = msg + "[Statement]" + getLineSeparator(); + msg = msg + statement.getClass().getName() + getLineSeparator(); + } + if (completeSql != null) { + msg = msg + getLineSeparator(); + msg = msg + "[Display SQL]" + getLineSeparator(); + msg = msg + completeSql + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */"; + throw new EntityAlreadyExistsException(msg, e); + } + + protected void throwSQLFailureException(SQLException e, + Statement statement, String completeSql) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The SQL failed to execute!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the SQLException message." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[SQLState]" + getLineSeparator() + extractSQLState(e) + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ErrorCode]" + getLineSeparator() + e.getErrorCode() + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[SQLException]" + getLineSeparator() + + e.getClass().getName() + getLineSeparator(); + msg = msg + e.getMessage() + getLineSeparator(); + SQLException nextEx = e.getNextException(); + if (nextEx != null) { + msg = msg + getLineSeparator(); + msg = msg + "[NextException]" + getLineSeparator(); + msg = msg + nextEx.getClass().getName() + getLineSeparator(); + msg = msg + nextEx.getMessage() + getLineSeparator(); + SQLException nextNextEx = nextEx.getNextException(); + if (nextNextEx != null) { + msg = msg + getLineSeparator(); + msg = msg + "[NextNextException]" + getLineSeparator(); + msg = msg + nextNextEx.getClass().getName() + + getLineSeparator(); + msg = msg + nextNextEx.getMessage() + getLineSeparator(); + } + } + Object invokeName = extractBehaviorInvokeName(); + if (invokeName != null) { + msg = msg + getLineSeparator(); + msg = msg + "[Behavior]" + getLineSeparator(); + msg = msg + invokeName + getLineSeparator(); + } + if (hasConditionBean()) { + msg = msg + getLineSeparator(); + msg = msg + "[ConditionBean]" + getLineSeparator(); + msg = msg + getConditionBean().getClass().getName() + + getLineSeparator(); + } + if (hasOutsideSqlContext()) { + msg = msg + getLineSeparator(); + msg = msg + "[OutsideSql]" + getLineSeparator(); + msg = msg + getOutsideSqlContext().getOutsideSqlPath() + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[ParameterBean]" + getLineSeparator(); + Object pmb = getOutsideSqlContext().getParameterBean(); + if (pmb != null) { + msg = msg + pmb.getClass().getName() + getLineSeparator(); + msg = msg + pmb + getLineSeparator(); + } else { + msg = msg + pmb + getLineSeparator(); + } + } + if (statement != null) { + msg = msg + getLineSeparator(); + msg = msg + "[Statement]" + getLineSeparator(); + msg = msg + statement.getClass().getName() + getLineSeparator(); + } + if (completeSql != null) { + msg = msg + getLineSeparator(); + msg = msg + "[Display SQL]" + getLineSeparator(); + msg = msg + completeSql + getLineSeparator(); + } + msg = msg + "* * * * * * * * * */"; + throw new SQLFailureException(msg, e); + } + + protected String extractSQLState(SQLException e) { + String sqlState = e.getSQLState(); + if (sqlState != null) { + return sqlState; + } + + // Next + SQLException nextEx = e.getNextException(); + if (nextEx == null) { + return null; + } + sqlState = nextEx.getSQLState(); + if (sqlState != null) { + return sqlState; + } + + // Next Next + SQLException nextNextEx = nextEx.getNextException(); + if (nextNextEx == null) { + return null; + } + sqlState = nextNextEx.getSQLState(); + if (sqlState != null) { + return sqlState; + } + + // Next Next Next + SQLException nextNextNextEx = nextNextEx.getNextException(); + if (nextNextNextEx == null) { + return null; + } + sqlState = nextNextNextEx.getSQLState(); + if (sqlState != null) { + return sqlState; + } + + // It doesn't use recursive call by design because JDBC is + // unpredictable fellow. + return null; + } + + protected String extractBehaviorInvokeName() { + final Object behaviorInvokeName = InternalMapContext + .getObject("df:BehaviorInvokeName"); + if (behaviorInvokeName == null) { + return null; + } + final Object clientInvokeName = InternalMapContext + .getObject("df:ClientInvokeName"); + final Object byPassInvokeName = InternalMapContext + .getObject("df:ByPassInvokeName"); + final StringBuilder sb = new StringBuilder(); + boolean existsPath = false; + if (clientInvokeName != null) { + existsPath = true; + sb.append(clientInvokeName); + } + if (byPassInvokeName != null) { + existsPath = true; + sb.append(byPassInvokeName); + } + sb.append(behaviorInvokeName); + if (existsPath) { + sb.append("..."); + } + return sb.toString(); + } + + protected boolean hasConditionBean() { + return ConditionBeanContext.isExistConditionBeanOnThread(); + } + + protected ConditionBean getConditionBean() { + return ConditionBeanContext.getConditionBeanOnThread(); + } + + protected boolean hasOutsideSqlContext() { + return OutsideSqlContext.isExistOutsideSqlContextOnThread(); + } + + protected OutsideSqlContext getOutsideSqlContext() { + return OutsideSqlContext.getOutsideSqlContextOnThread(); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + //========================================================================== + // ========= + // 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 PreparedStatement prepareStatement(Connection conn) { + if (sql == null) { + throw new IllegalStateException("The sql should not be null!"); + } + return statementFactory.createPreparedStatement(conn, sql); + } + + protected int executeUpdate(PreparedStatement ps) { + try { + return ps.executeUpdate(); + } catch (SQLException e) { + handleSQLException(e, ps, true); + return 0;// Unreachable! + } + } + + protected void setFetchSize(Statement statement, int fetchSize) { + if (statement == null) { + return; + } + try { + statement.setFetchSize(fetchSize); + } catch (SQLException e) { + handleSQLException(e, statement); + } + } + + protected void setMaxRows(Statement statement, int maxRows) { + if (statement == null) { + return; + } + try { + statement.setMaxRows(maxRows); + } catch (SQLException e) { + handleSQLException(e, statement); + } + } + + protected void close(Statement statement) { + if (statement == null) { + return; + } + try { + statement.close(); + } catch (SQLException e) { + handleSQLException(e, statement); + } + } + + protected void close(ResultSet resultSet) { + if (resultSet == null) { + return; + } + try { + resultSet.close(); + } catch (SQLException e) { + handleSQLException(e, null); + } + } + + protected void close(Connection conn) { + if (conn == null) { + return; + } + try { + conn.close(); + } catch (SQLException e) { + handleSQLException(e, null); + } + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + // It needs this method if the target database doest not support line + // comment. + protected String removeLineComment(final String sql) { // With removing CR! + if (sql == null || sql.trim().length() == 0) { + return sql; + } + final StringBuilder sb = new StringBuilder(); + final String[] lines = sql.split("\n"); + for (String line : lines) { + if (line == null) { + continue; + } + line = line.replaceAll("\r", ""); // Remove CR! + if (line.startsWith("--")) { + continue; + } + sb.append(line).append("\n"); + } + return sb.toString(); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public DataSource getDataSource() { + return dataSource; + } + + public void setDataSource(DataSource dataSource) { + this.dataSource = dataSource; + } + + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } + + public StatementFactory getStatementFactory() { + return statementFactory; + } + + public void setStatementFactory(StatementFactory statementFactory) { + this.statementFactory = statementFactory; + } + + public void setLoggingMessageSqlArgs(Object[] loggingMessageSqlArgs) { + this.loggingMessageSqlArgs = loggingMessageSqlArgs; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,146 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.cbean.FetchNarrowingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.FetchNarrowingBeanContext; +import jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlContext; +import jp.sf.pal.scheduler.db.allcommon.s2dao.FetchNarrowingResultSetWrapper; + +import org.seasar.extension.jdbc.ResultSetHandler; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBasicSelectHandler extends InternalBasicHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + private ResultSetHandler resultSetHandler; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalBasicSelectHandler(DataSource dataSource, String sql, + ResultSetHandler resultSetHandler, StatementFactory statementFactory) { + super(dataSource, statementFactory); + setSql(sql); + setResultSetHandler(resultSetHandler); + } + + //========================================================================== + // ========= + // Execute + // ======= + public Object execute(Object[] args) { + return execute(args, getArgTypes(args)); + } + + @SuppressWarnings("unchecked") + public Object execute(Object[] args, Class[] argTypes) { + Connection conn = getConnection(); + try { + return execute(conn, args, argTypes); + } finally { + close(conn); + } + } + + @SuppressWarnings("unchecked") + public Object execute(Connection conn, Object[] args, Class[] argTypes) { + logSql(args, argTypes); + PreparedStatement ps = null; + try { + ps = prepareStatement(conn); + bindArgs(ps, args, argTypes); + return execute(ps); + } catch (SQLException e) { + handleSQLException(e, ps); + return null; // Unreachable! + } finally { + close(ps); + } + } + + protected Object execute(PreparedStatement ps) throws SQLException { + if (resultSetHandler == null) { + throw new IllegalStateException( + "The resultSetHandler should not be null!"); + } + ResultSet resultSet = null; + try { + resultSet = createResultSet(ps); + return resultSetHandler.handle(resultSet); + } finally { + close(resultSet); + } + } + + protected ResultSet createResultSet(PreparedStatement ps) + throws SQLException { + final ResultSet resultSet = ps.executeQuery(); + 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; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public ResultSetHandler getResultSetHandler() { + return resultSetHandler; + } + + public void setResultSetHandler(ResultSetHandler resultSetHandler) { + this.resultSetHandler = resultSetHandler; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicSelectHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,53 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; + +import javax.sql.DataSource; + +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBasicUpdateHandler extends InternalBasicHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalBasicUpdateHandler(DataSource dataSource, String sql, + StatementFactory statementFactory) { + super(dataSource, sql, statementFactory); + } + + //========================================================================== + // ========= + // Execute + // ======= + public int execute(Object[] args) { + return execute(args, getArgTypes(args)); + } + + @SuppressWarnings("unchecked") + public int execute(Object[] args, Class[] argTypes) { + Connection connection = getConnection(); + try { + return execute(connection, args, argTypes); + } finally { + close(connection); + } + } + + @SuppressWarnings("unchecked") + public int execute(Connection connection, Object[] args, Class[] argTypes) { + logSql(args, argTypes); + PreparedStatement ps = prepareStatement(connection); + try { + bindArgs(ps, args, argTypes); + return executeUpdate(ps); + } finally { + close(ps); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalBasicUpdateHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,60 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.Connection; +import java.sql.PreparedStatement; + +import javax.sql.DataSource; + +import org.seasar.dao.CommandContext; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalCommandContextHandler extends InternalBasicHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + protected CommandContext commandContext; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalCommandContextHandler(DataSource dataSource, + StatementFactory statementFactory, CommandContext commandContext) { + super(dataSource, statementFactory); + this.commandContext = commandContext; + setSql(commandContext.getSql()); + } + + //========================================================================== + // ========= + // Execute + // ======= + public int execute(Object[] args) { + final Connection connection = getConnection(); + try { + return execute(connection, commandContext); + } finally { + close(connection); + } + } + + protected int execute(Connection connection, CommandContext context) { + logSql(context.getBindVariables(), getArgTypes(context + .getBindVariables())); + PreparedStatement ps = prepareStatement(connection); + int ret = -1; + try { + bindArgs(ps, context.getBindVariables(), context + .getBindVariableTypes()); + ret = executeUpdate(ps); + } finally { + close(ps); + } + return ret; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalCommandContextHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,33 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteAutoHandler extends InternalAbstractAutoHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalDeleteAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupDeleteBindVariables(bean); + setLoggingMessageSqlArgs(bindVariables); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,34 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalDeleteBatchAutoHandler extends + InternalAbstractBatchAutoHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalDeleteBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupDeleteBindVariables(bean); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalDeleteBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,58 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.IdentifierGenerator; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertAutoHandler extends InternalAbstractAutoHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalInsertAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupInsertBindVariables(bean); + setLoggingMessageSqlArgs(bindVariables); + } + + @Override + protected void preUpdateBean(Object bean) { + BeanMetaData bmd = getBeanMetaData(); + for (int i = 0; i < bmd.getIdentifierGeneratorSize(); i++) { + IdentifierGenerator generator = bmd.getIdentifierGenerator(i); + if (generator.isSelfGenerate()) { + generator.setIdentifier(bean, getDataSource()); + } + } + } + + @Override + protected void postUpdateBean(Object bean, int ret) { + BeanMetaData bmd = getBeanMetaData(); + for (int i = 0; i < bmd.getIdentifierGeneratorSize(); i++) { + IdentifierGenerator generator = bmd.getIdentifierGenerator(i); + if (!generator.isSelfGenerate()) { + generator.setIdentifier(bean, getDataSource()); + } + } + updateVersionNoIfNeed(bean); + updateTimestampIfNeed(bean); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,34 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalInsertBatchAutoHandler extends + InternalAbstractBatchAutoHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalInsertBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupInsertBindVariables(bean); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalInsertBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,262 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureMetaData; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various.InternalProcedureParameterType; + +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.extension.jdbc.impl.PropertyTypeImpl; +import org.seasar.extension.jdbc.types.ValueTypes; +import org.seasar.framework.util.CaseInsensitiveMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalProcedureHandler extends InternalBasicSelectHandler { + + //========================================================================== + // ========= + // Attribute + // ========= + private InternalProcedureMetaData procedureMetaData; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalProcedureHandler(final DataSource dataSource, + final String sql, final ResultSetHandler resultSetHandler, + final StatementFactory statementFactory, + final InternalProcedureMetaData procedureMetaData) { + super(dataSource, sql, resultSetHandler, statementFactory); + this.procedureMetaData = procedureMetaData; + } + + //========================================================================== + // ========= + // Execute + // ======= + @SuppressWarnings("unchecked") + public Object execute(final Connection connection, final Object[] args, + final Class[] argTypes) { + final Object dto = getArgumentDto(args); + logSql(args, argTypes); + CallableStatement cs = null; + try { + cs = prepareCallableStatement(connection); + bindArgs(cs, dto); + Object returnValue = null; + if (cs.execute()) { + final ResultSet resultSet = cs.getResultSet(); + if (resultSet != null) { + final ResultSetHandler handler = createReturnResultSetHandler(resultSet); + try { + returnValue = handler.handle(resultSet); + } finally { + if (resultSet != null) { + resultSet.close(); + } + } + } + } + return handleOutParameters(cs, dto, returnValue); + } catch (SQLException e) { + handleSQLException(e, cs); + return null;// Unreachable! + } finally { + close(cs); + } + } + + protected ResultSetHandler createReturnResultSetHandler(ResultSet resultSet) { + return new InternalMapListResultSetHandler(); + } + + @Override + protected String getCompleteSql(final Object[] args) {// for Procedure Call + String sql = getSql(); + Object dto = getArgumentDto(args); + if (args == null || dto == null) { + return sql; + } + StringBuilder sb = new StringBuilder(100); + int pos = 0; + int pos2 = 0; + for (InternalProcedureParameterType ppt : procedureMetaData + .parameterTypes()) { + if ((pos2 = sql.indexOf('?', pos)) < 0) { + break; + } + sb.append(sql.substring(pos, pos2)); + pos = pos2 + 1; + if (ppt.isInType()) { + sb.append(getBindVariableText(ppt.getValue(dto))); + } else { + sb.append(sql.substring(pos2, pos)); + } + } + sb.append(sql.substring(pos)); + return sb.toString(); + } + + protected CallableStatement prepareCallableStatement( + final Connection connection) { + if (getSql() == null) { + throw new IllegalStateException("The SQL should not be null!"); + } + return getStatementFactory().createCallableStatement(connection, + getSql()); + } + + protected void bindArgs(final CallableStatement cs, final Object dto) + throws SQLException { + if (dto == null) { + return; + } + int i = 0; + for (InternalProcedureParameterType ppt : procedureMetaData + .parameterTypes()) { + final ValueType valueType = ppt.getValueType(); + if (ppt.isOutType()) { + valueType.registerOutParameter(cs, i + 1); + } + if (ppt.isInType()) { + final Object value = ppt.getValue(dto); + valueType.bindValue(cs, i + 1, value); + } + ++i; + } + } + + protected Object handleResultSet(final CallableStatement cs) + throws SQLException { + ResultSet rs = null; + try { + rs = getResultSet(cs); + return getResultSetHandler().handle(rs); + } finally { + close(rs); + } + } + + protected ResultSet getResultSet(Statement statement) { + try { + return statement.getResultSet(); + } catch (SQLException e) { + handleSQLException(e, statement); + return null;// Unreachable! + } + } + + protected Object handleOutParameters(final CallableStatement cs, + final Object dto, Object returnValue) throws SQLException { + if (dto == null) { + return null; + } + int i = 0; + for (InternalProcedureParameterType ppt : procedureMetaData + .parameterTypes()) { + final ValueType valueType = ppt.getValueType(); + if (ppt.isOutType()) { + Object value = valueType.getValue(cs, i + 1); + if (value instanceof ResultSet) { + final ResultSet resultSet = (ResultSet) value; + final ResultSetHandler handler = createOutParameterResultSetHandler( + ppt, resultSet); + try { + value = handler.handle(resultSet); + } finally { + if (resultSet != null) { + resultSet.close(); + } + } + } + ppt.setValue(dto, value); + } else if (ppt.isReturnType()) { + ppt.setValue(dto, returnValue); + } + ++i; + } + return dto; + } + + protected Object getArgumentDto(Object[] args) { + if (args.length == 0) { + return null; + } + if (args.length == 1) { + if (args[0] == null) { + throw new IllegalArgumentException( + "args[0] should not be null!"); + } + return args[0]; + } + throw new IllegalArgumentException("args"); + } + + protected ResultSetHandler createOutParameterResultSetHandler( + InternalProcedureParameterType ppt, ResultSet resultSet) { + return new InternalMapListResultSetHandler(); + } + + //========================================================================== + // ========= + // Map Result Set Handler + // ====================== + 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(); + for (int i = 0; i < propertyTypes.length; ++i) { + Object value = propertyTypes[i].getValueType().getValue(rs, + i + 1); + row.put(propertyTypes[i].getPropertyName(), value); + } + return row; + } + + protected PropertyType[] createPropertyTypes(ResultSetMetaData rsmd) + throws SQLException { + int count = rsmd.getColumnCount(); + PropertyType[] propertyTypes = new PropertyType[count]; + for (int i = 0; i < count; ++i) { + String propertyName = rsmd.getColumnLabel(i + 1); + ValueType valueType = ValueTypes.getValueType(rsmd + .getColumnType(i + 1)); + propertyTypes[i] = new PropertyTypeImpl(propertyName, valueType); + } + return propertyTypes; + } + } + + protected static class InternalMapListResultSetHandler extends + InternalAbstractMapResultSetHandler { + + public Object handle(ResultSet resultSet) throws SQLException { + PropertyType[] propertyTypes = createPropertyTypes(resultSet + .getMetaData()); + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); + while (resultSet.next()) { + list.add(createRow(resultSet, propertyTypes)); + } + return list; + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalProcedureHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,67 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateAutoHandler extends InternalAbstractAutoHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + private boolean checkSingleRowUpdate = true; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupUpdateBindVariables(bean); + setLoggingMessageSqlArgs(bindVariables); + } + + @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; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,34 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlhandler; + +import javax.sql.DataSource; + +import org.seasar.dao.BeanMetaData; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.StatementFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalUpdateBatchAutoHandler extends + InternalAbstractBatchAutoHandler { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalUpdateBatchAutoHandler(DataSource dataSource, + StatementFactory statementFactory, BeanMetaData beanMetaData, + PropertyType[] propertyTypes) { + + super(dataSource, statementFactory, beanMetaData, propertyTypes); + } + + //========================================================================== + // ========= + // Override + // ======== + @Override + protected void setupBindVariables(Object bean) { + setupUpdateBindVariables(bean); + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlhandler/InternalUpdateBatchAutoHandler.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,55 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqllog; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlLog { + + //========================================================================== + // ========= + // Attribute + // ========= + private String rawSql; + + private String completeSql; + + private Object[] bindArgs; + + private Class<?>[] bindArgTypes; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalSqlLog(String rawSql, String completeSql, Object[] bindArgs, + Class<?>[] bindArgTypes) { + this.rawSql = rawSql; + this.completeSql = completeSql; + this.bindArgs = bindArgs; + this.bindArgTypes = bindArgTypes; + } + + //========================================================================== + // ========= + // Accessor + // ======== + public Object[] getBindArgs() { + return bindArgs; + } + + public Class<?>[] getBindArgTypes() { + return bindArgTypes; + } + + public String getCompleteSql() { + return completeSql; + } + + public String getRawSql() { + return rawSql; + } + + public String toString() { + return rawSql; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLog.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,277 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqllog; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlLogRegistry { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalSqlLogRegistry.class); + + //========================================================================== + // ========= + // Definition + // ========== + protected static final String NAME_SqlLogRegistryLocator = "org.seasar.extension.jdbc.SqlLogRegistryLocator"; + + protected static final String NAME_getInstance = "getInstance"; + + protected static final String NAME_setInstance = "setInstance"; + + protected static final String NAME_SqlLogRegistry = "org.seasar.extension.jdbc.SqlLogRegistry"; + + protected static final String NAME_SqlLogRegistryImpl = "org.seasar.extension.jdbc.impl.SqlLogRegistryImpl"; + + protected static final String NAME_SqlLog = "org.seasar.extension.jdbc.SqlLog"; + + protected static final String NAME_SqlLogImpl = "org.seasar.extension.jdbc.impl.SqlLogImpl"; + static { + forNameContainerSqlLogRegistryLocator(); + } + + //========================================================================== + // ========= + // Public Entry + // ============ + public static boolean setupSqlLogRegistry() { + final Class<?> sqlLogRegistryLocatorType = forNameContainerSqlLogRegistryLocator(); + if (sqlLogRegistryLocatorType == null) { + return false; + } + final Class<?> sqlLogRegistryType = forNameContainerSqlLogRegistry(); + if (sqlLogRegistryType == null) { + return false; + } + final Object sqlLogRegistryImpl = createContainerSqlLogRegistryImpl(); + if (sqlLogRegistryImpl == null) { + return false; + } + try { + final Method method = sqlLogRegistryLocatorType.getMethod( + NAME_setInstance, new Class[] { sqlLogRegistryType }); + _log.info("...Setting the registry of sqlLog to the locator."); + method.invoke(null, new Object[] { sqlLogRegistryImpl }); + return true; + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.setupSqlLogRegistry() threw the exception:"; + msg = msg + " sqlLogRegistryLocatorType=" + + sqlLogRegistryLocatorType; + msg = msg + " NAME_setInstance=" + NAME_setInstance; + throw new IllegalStateException(msg, e); + } + } + + public static void clearSqlLogRegistry() { + final Class<?> sqlLogRegistryLocatorType = forNameContainerSqlLogRegistryLocator(); + if (sqlLogRegistryLocatorType == null) { + return; + } + final Object sqlLogRegistry = findContainerSqlLogRegistry(); + if (sqlLogRegistry == null) { + return; + } + Class<? extends Object> sqlLogRegistryType = sqlLogRegistry.getClass(); + try { + final Method method = sqlLogRegistryType.getMethod("clear", + new Class[] {}); + method.invoke(sqlLogRegistry, new Object[] {}); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.clearSqlLogRegistry() threw the exception:"; + msg = msg + " sqlLogRegistryLocatorType=" + + sqlLogRegistryLocatorType; + throw new IllegalStateException(msg, e); + } + } + + public static Object findContainerSqlLogRegistry() { + final Class<?> sqlLogRegistryLocatorType = forNameContainerSqlLogRegistryLocator(); + if (sqlLogRegistryLocatorType == null) { + return null; + } + try { + final Method method = sqlLogRegistryLocatorType.getMethod( + NAME_getInstance, (Class[]) null); + return method.invoke(null, (Object[]) null); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.findContainerSqlLogRegistry() threw the exception:"; + msg = msg + " sqlLogRegistryLocatorType=" + + sqlLogRegistryLocatorType; + msg = msg + " NAME_getInstance=" + NAME_getInstance; + throw new IllegalStateException(msg, e); + } + } + + public static void closeRegistration() { + final Class<?> sqlLogRegistryLocatorType = forNameContainerSqlLogRegistryLocator(); + if (sqlLogRegistryLocatorType == null) { + return; + } + final Class<?> sqlLogRegistryType = forNameContainerSqlLogRegistry(); + if (sqlLogRegistryType == null) { + return; + } + try { + final Method method = sqlLogRegistryLocatorType.getMethod( + NAME_setInstance, new Class[] { sqlLogRegistryType }); + _log.info("...Closing the registry of sqlLog."); + method.invoke(null, new Object[] { null }); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.closeRegistration() threw the exception:"; + msg = msg + " sqlLogRegistryLocatorType=" + + sqlLogRegistryLocatorType; + msg = msg + " NAME_setInstance=" + NAME_setInstance; + throw new IllegalStateException(msg, e); + } + } + + public static void push(String rawSql, String completeSql, + Object[] bindArgs, Class<?>[] bindArgTypes, Object sqlLogRegistry) { + if (sqlLogRegistry == null) { + throw new IllegalArgumentException( + "sqlLogRegistry should not be null!"); + } + final Object sqlLogImpl = createContainerSqlLogImpl(rawSql, + completeSql, bindArgs, bindArgTypes); + reflectSqlLogToContainerSqlLogRegistry(sqlLogImpl, sqlLogRegistry); + } + + public static String peekCompleteSql() { + final Object sqlLogRegistry = findContainerSqlLogRegistry(); + if (sqlLogRegistry == null) { + return null; + } + final Object sqlLog = findLastContainerSqlLog(sqlLogRegistry); + if (sqlLog == null) { + return null; + } + return extractCompleteSqlFromContainerSqlLog(sqlLog); + } + + //========================================================================== + // ========= + // Container Reflection + // ==================== + protected static Object createContainerSqlLogRegistryImpl() { + try { + final Class<?> clazz = forNameContainerSqlLogRegistryImpl(); + if (clazz == null) { + return null; + } + final Constructor<?> constructor = clazz.getConstructor(int.class); + return constructor.newInstance(new Object[] { 3 }); + } catch (Exception e) { + String msg = NAME_SqlLogRegistry + + ".class.newInstance threw the exception:"; + msg = msg + " NAME_SqlLogRegistry=" + NAME_SqlLogRegistry; + throw new IllegalStateException(msg, e); + } + } + + protected static Object createContainerSqlLogImpl(String rawSql, + String completeSql, Object[] bindArgs, Class<?>[] bindArgTypes) { + try { + final Class<?> sqlLogImplType = Class.forName(NAME_SqlLogImpl); + final Class<?>[] argTypes = new Class[] { String.class, + String.class, Object[].class, Class[].class }; + final Constructor<?> constructor = sqlLogImplType + .getConstructor(argTypes); + return constructor.newInstance(new Object[] { rawSql, completeSql, + bindArgs, bindArgTypes }); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.createContainerSqlLogImpl() threw the exception:"; + msg = msg + " completeSql=" + completeSql; + msg = msg + " NAME_SqlLogImpl=" + NAME_SqlLogImpl; + throw new IllegalStateException(msg, e); + } + } + + protected static void reflectSqlLogToContainerSqlLogRegistry(Object sqlLog, + Object sqlLogRegistry) { + if (sqlLog == null || sqlLogRegistry == null) { + return; + } + try { + final Class<?> sqlLogRegistryType = sqlLogRegistry.getClass(); + final Class<?> sqlLogType = Class.forName(NAME_SqlLog); + final Method method = sqlLogRegistryType.getMethod("add", + new Class[] { sqlLogType }); + method.invoke(sqlLogRegistry, new Object[] { sqlLog }); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.reflectToContainerSqlLogRegistry() threw the exception:"; + msg = msg + " sqlLog=" + sqlLog + " sqlLogRegistry=" + + sqlLogRegistry; + msg = msg + " NAME_SqlLog=" + NAME_SqlLog; + throw new IllegalStateException(msg, e); + } + } + + protected static Object findLastContainerSqlLog(Object sqlLogRegistry) { + if (sqlLogRegistry == null) { + return null; + } + try { + final Class<?> sqlLogRegistryType = sqlLogRegistry.getClass(); + final Method method = sqlLogRegistryType.getMethod("getLast", + (Class[]) null); + return method.invoke(sqlLogRegistry, (Object[]) null); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.findLastContainerSqlLog() threw the exception:"; + msg = msg + " sqlLogRegistry=" + sqlLogRegistry; + throw new IllegalStateException(msg, e); + } + } + + protected static String extractCompleteSqlFromContainerSqlLog(Object sqlLog) { + if (sqlLog == null) { + return null; + } + try { + final Class<?> sqlLogType = sqlLog.getClass(); + final Method method = sqlLogType.getMethod("getCompleteSql", + (Class[]) null); + return (String) method.invoke(sqlLog, (Object[]) null); + } catch (Exception e) { + String msg = "InternalSqlLogRegistry.extractCompleteSqlFromContainerSqlLog() threw the exception:"; + msg = msg + " sqlLog=" + sqlLog; + throw new IllegalStateException(msg, e); + } + } + + protected static Class<?> forNameContainerSqlLogRegistryLocator() { + Class<?> clazz = null; + try { + clazz = Class.forName(NAME_SqlLogRegistryLocator); + } catch (Exception ignored) { + return null; + } + return clazz; + } + + protected static Class<?> forNameContainerSqlLogRegistry() { + Class<?> clazz = null; + try { + clazz = Class.forName(NAME_SqlLogRegistry); + } catch (Exception ignored) { + return null; + } + return clazz; + } + + protected static Class<?> forNameContainerSqlLogRegistryImpl() { + Class<?> clazz = null; + try { + clazz = Class.forName(NAME_SqlLogRegistryImpl); + } catch (Exception ignored) { + return null; + } + return clazz; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqllog/InternalSqlLogRegistry.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,53 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.context.CommandContextImpl; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalCommandContextCreator { + + //========================================================================== + // ========= + // Attribute + // ========= + protected String[] argNames; + + protected Class<?>[] argTypes; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalCommandContextCreator(String[] argNames, Class<?>[] argTypes) { + this.argNames = (argNames != null ? argNames : new String[0]); + this.argTypes = (argTypes != null ? argTypes : new Class[0]); + } + + //========================================================================== + // ========= + // Create + // ====== + public CommandContext createCommandContext(Object[] args) { + final CommandContext ctx = new CommandContextImpl(); + if (args != null) { + for (int i = 0; i < args.length; ++i) { + Class<?> argType = null; + if (args[i] != null) { + if (i < argTypes.length) { + argType = argTypes[i]; + } else if (args[i] != null) { + argType = args[i].getClass(); + } + } + if (i < argNames.length) { + ctx.addArg(argNames[i], args[i], argType); + } else { + ctx.addArg("$" + (i + 1), args[i], argType); + } + } + } + return ctx; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalCommandContextCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1290 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser; + +import java.lang.reflect.Array; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Stack; +import java.util.StringTokenizer; + +import jp.sf.pal.scheduler.db.allcommon.cbean.MapParameterBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption; +import jp.sf.pal.scheduler.db.allcommon.exception.BindVariableCommentNotFoundPropertyException; +import jp.sf.pal.scheduler.db.allcommon.exception.BindVariableParameterNullValueException; +import jp.sf.pal.scheduler.db.allcommon.exception.EmbeddedValueCommentNotFoundPropertyException; +import jp.sf.pal.scheduler.db.allcommon.exception.EmbeddedValueParameterNullValueException; +import jp.sf.pal.scheduler.db.allcommon.exception.EndCommentNotFoundException; +import jp.sf.pal.scheduler.db.allcommon.exception.IfCommentConditionNotFoundException; +import jp.sf.pal.scheduler.db.allcommon.exception.IfCommentNotBooleanResultException; +import jp.sf.pal.scheduler.db.allcommon.exception.IfCommentWrongExpressionException; +import jp.sf.pal.scheduler.db.allcommon.exception.RequiredOptionNotFoundException; +import jp.sf.pal.scheduler.db.allcommon.s2dao.internal.util.InternalBindVariableUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleStringUtil; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.CommandContext; +import org.seasar.dao.Node; +import org.seasar.dao.node.AbstractNode; +import org.seasar.dao.node.BeginNode; +import org.seasar.dao.node.ContainerNode; +import org.seasar.dao.node.ElseNode; +import org.seasar.dao.node.PrefixSqlNode; +import org.seasar.dao.node.SqlNode; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.PropertyDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; +import org.seasar.framework.util.OgnlUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlParser { + + //========================================================================== + // ========= + // Attribute + // ========= + protected InternalSqlTokenizer tokenizer; + + protected Stack<Node> nodeStack = new Stack<Node>(); + + protected String specifiedSql;// Extension! + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalSqlParser(String sql) { + sql = sql.trim(); + if (sql.endsWith(";")) { + sql = sql.substring(0, sql.length() - 1); + } + specifiedSql = sql;// Extension! + tokenizer = new InternalSqlTokenizer(sql); + } + + //========================================================================== + // ========= + // Parse + // ===== + public Node parse() { + push(new ContainerNode()); + while (InternalSqlTokenizer.EOF != tokenizer.next()) { + parseToken(); + } + return pop(); + } + + protected void parseToken() { + switch (tokenizer.getTokenType()) { + case InternalSqlTokenizer.SQL: + parseSql(); + break; + case InternalSqlTokenizer.COMMENT: + parseComment(); + break; + case InternalSqlTokenizer.ELSE: + parseElse(); + break; + case InternalSqlTokenizer.BIND_VARIABLE: + parseBindVariable(); + break; + } + } + + protected void parseSql() { + String sql = tokenizer.getToken(); + if (isElseMode()) { + sql = InternalStringUtil.replace(sql, "--", ""); + } + Node node = peek(); + if ((node instanceof InternalIfNode || node instanceof ElseNode) + && node.getChildSize() == 0) { + + InternalSqlTokenizer st = new InternalSqlTokenizer(sql); + st.skipWhitespace(); + String token = st.skipToken(); + st.skipWhitespace(); + if (sql.startsWith(",")) { + if (sql.startsWith(", ")) { + node.addChild(new PrefixSqlNode(", ", sql.substring(2))); + } else { + node.addChild(new PrefixSqlNode(",", sql.substring(1))); + } + } else if ("AND".equalsIgnoreCase(token) + || "OR".equalsIgnoreCase(token)) { + node.addChild(new PrefixSqlNode(st.getBefore(), st.getAfter())); + } else { + node.addChild(new SqlNode(sql)); + } + } else { + node.addChild(new SqlNode(sql)); + } + } + + protected void parseComment() { + final String comment = tokenizer.getToken(); + if (isTargetComment(comment)) { + if (isIfComment(comment)) { + parseIf(); + } else if (isBeginComment(comment)) { + parseBegin(); + } else if (isEndComment(comment)) { + return; + } else { + parseCommentBindVariable(); + } + } else if (comment != null && 0 < comment.length()) { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - + // [UnderReview]: Should I resolve bind character on scope + // comment(normal comment)? + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - + String before = tokenizer.getBefore(); + peek().addChild( + new SqlNode(before.substring(before.lastIndexOf("/*")))); + } + } + + protected void parseIf() { + final String condition = tokenizer.getToken().substring(2).trim(); + if (InternalStringUtil.isEmpty(condition)) { + throwIfCommentConditionNotFoundException(); + } + final ContainerNode ifNode = createIfNode(condition); + peek().addChild(ifNode); + push(ifNode); + parseEnd(); + } + + protected void throwIfCommentConditionNotFoundException() { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The condition of IF comment was Not Found!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the IF comment expression." + + getLineSeparator(); + msg = msg + + "It may exist the IF comment that DOESN'T have a condition." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x) -- /*IF*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Expression]" + getLineSeparator() + + tokenizer.getToken() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IfCommentConditionNotFoundException(msg); + } + + protected void parseBegin() { + BeginNode beginNode = new BeginNode(); + peek().addChild(beginNode); + push(beginNode); + parseEnd(); + } + + protected void parseEnd() { + while (InternalSqlTokenizer.EOF != tokenizer.next()) { + if (tokenizer.getTokenType() == InternalSqlTokenizer.COMMENT + && isEndComment(tokenizer.getToken())) { + pop(); + return; + } + parseToken(); + } + throwEndCommentNotFoundException(); + } + + protected void throwEndCommentNotFoundException() { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The end comment was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the parameter comment logic." + + getLineSeparator(); + msg = msg + + "It may exist the parameter comment that DOESN'T have an end comment." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + + " before (x) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new EndCommentNotFoundException(msg); + } + + protected void parseElse() { + final Node parent = peek(); + if (!(parent instanceof InternalIfNode)) { + return; + } + final InternalIfNode ifNode = (InternalIfNode) pop(); + final InternalElseNode elseNode = new InternalElseNode(); + ifNode.setElseNode(elseNode); + push(elseNode); + tokenizer.skipWhitespace(); + } + + protected void parseCommentBindVariable() { + final String expr = tokenizer.getToken(); + final String s = tokenizer.skipToken(); + if (expr.startsWith("$")) { + peek().addChild(createEmbeddedValueNode(expr.substring(1), s));// Extension + // ! + } else { + peek().addChild(createBindVariableNode(expr, s));// Extension! + } + } + + protected void parseBindVariable() { + final String expr = tokenizer.getToken(); + peek().addChild(createBindVariableNode(expr, null));// Extension! + } + + protected Node pop() { + return (Node) nodeStack.pop(); + } + + protected Node peek() { + return (Node) nodeStack.peek(); + } + + protected void push(Node node) { + nodeStack.push(node); + } + + protected boolean isElseMode() { + for (int i = 0; i < nodeStack.size(); ++i) { + if (nodeStack.get(i) instanceof InternalElseNode) { + return true; + } + } + return false; + } + + private static boolean isTargetComment(String comment) { + return comment != null && comment.length() > 0 + && Character.isJavaIdentifierStart(comment.charAt(0)); + } + + private static boolean isIfComment(String comment) { + return comment.startsWith("IF"); + } + + private static boolean isBeginComment(String content) { + return content != null && "BEGIN".equals(content); + } + + private static boolean isEndComment(String content) { + return content != null && "END".equals(content); + } + + protected AbstractNode createBindVariableNode(String expr, String testValue) {// Extension + // ! + return new InternalBindVariableNode(expr, testValue, specifiedSql); + } + + protected AbstractNode createEmbeddedValueNode(String expr, String testValue) {// Extension + // ! + return new InternalEmbeddedValueNode(expr, testValue, specifiedSql); + } + + protected ContainerNode createIfNode(String expr) {// Extension! + return new InternalIfNode(expr, specifiedSql); + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + protected final String replaceString(String text, String fromText, + String toText) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + //========================================================================== + // ========= + // Extension + // ========= + // ----------------------------------------------------- + // BindVariableNode + // ---------------- + protected static class InternalBindVariableNode extends AbstractNode { + protected String _expression; + + protected String _testValue; + + protected String[] _names; + + protected String _specifiedSql; + + public InternalBindVariableNode(String expression, String testValue, + String specifiedSql) { + this._expression = expression; + this._testValue = testValue; + this._names = InternalStringUtil.split(expression, "."); + this._specifiedSql = specifiedSql; + } + + public void accept(CommandContext ctx) { + final Object value = ctx.getArg(_names[0]); + final Class<?> clazz = ctx.getArgType(_names[0]); + final InternalValueAndType valueAndType = new InternalValueAndType(); + valueAndType.setTargetValue(value); + valueAndType.setTargetType(clazz); + setupValueAndType(valueAndType); + + if (valueAndType.getTargetValue() == null) { + throwBindOrEmbeddedParameterNullValueException(valueAndType); + } + if (!isInScope()) { + // Main Root + ctx.addSql("?", valueAndType.getTargetValue(), valueAndType + .getTargetType()); + } else { + if (List.class.isAssignableFrom(valueAndType.getTargetType())) { + bindArray(ctx, ((List<?>) valueAndType.getTargetValue()) + .toArray()); + } else if (valueAndType.getTargetType().isArray()) { + bindArray(ctx, valueAndType.getTargetValue()); + } else { + ctx.addSql("?", valueAndType.getTargetValue(), valueAndType + .getTargetType()); + } + } + if (valueAndType.isValidRearOption()) { + ctx.addSql(valueAndType.buildRearOptionOnSql()); + } + } + + protected void setupValueAndType(InternalValueAndType valueAndType) { + final InternalValueAndTypeSetuper valueAndTypeSetuper = new InternalValueAndTypeSetuper( + _expression, _names, _specifiedSql, true); + valueAndTypeSetuper.setupValueAndType(valueAndType); + } + + protected void throwBindOrEmbeddedParameterNullValueException( + InternalValueAndType valueAndType) { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullValueException( + _expression, valueAndType.getTargetType(), + _specifiedSql, true); + } + + protected boolean isInScope() { + return _testValue != null && _testValue.startsWith("(") + && _testValue.endsWith(")"); + } + + protected void bindArray(CommandContext ctx, Object array) { + if (array == null) { + return; + } + final int length = Array.getLength(array); + if (length == 0) { + throwBindOrEmbeddedParameterEmptyListException(); + } + Class<?> clazz = null; + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + clazz = currentElement.getClass(); + break; + } + } + if (clazz == null) { + throwBindOrEmbeddedParameterNullOnlyListException(); + } + boolean existsValidElements = false; + ctx.addSql("("); + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + if (!existsValidElements) { + ctx.addSql("?", currentElement, clazz); + existsValidElements = true; + } else { + ctx.addSql(", ?", currentElement, clazz); + } + } + } + ctx.addSql(")"); + } + + protected void throwBindOrEmbeddedParameterEmptyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterEmptyListException( + _expression, _specifiedSql, false); + } + + protected void throwBindOrEmbeddedParameterNullOnlyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullOnlyListException( + _expression, _specifiedSql, true); + } + } + + // ----------------------------------------------------- + // EmbeddedValueNode + // ----------------- + protected static class InternalEmbeddedValueNode extends AbstractNode { + protected String _expression; + + protected String _testValue; + + protected String[] _names; + + protected String _specifiedSql; + + public InternalEmbeddedValueNode(String expression, String testValue, + String specifiedSql) { + this._expression = expression; + this._testValue = testValue; + this._names = InternalStringUtil.split(expression, "."); + this._specifiedSql = specifiedSql; + } + + public void accept(CommandContext ctx) { + final Object value = ctx.getArg(_names[0]); + final Class<?> clazz = ctx.getArgType(_names[0]); + final InternalValueAndType valueAndType = new InternalValueAndType(); + valueAndType.setTargetValue(value); + valueAndType.setTargetType(clazz); + setupValueAndType(valueAndType); + + if (valueAndType.getTargetValue() == null) { + throwBindOrEmbeddedParameterNullValueException(valueAndType); + } + if (!isInScope()) { + // Main Root + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - + // [UnderReview]: Should I make an original exception instead of + // this exception? + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - + if (valueAndType.getTargetValue() != null + && valueAndType.getTargetValue().toString() + .indexOf("?") > -1) { + throw new org.seasar.framework.exception.SRuntimeException( + "EDAO0023"); + } + ctx.addSql(valueAndType.getTargetValue().toString()); + } else { + if (List.class.isAssignableFrom(valueAndType.getTargetType())) { + embedArray(ctx, ((List<?>) valueAndType.getTargetValue()) + .toArray()); + } else if (valueAndType.getTargetType().isArray()) { + embedArray(ctx, valueAndType.getTargetValue()); + } else { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - + // [UnderReview]: Should I make an original exception + // instead of this exception? + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - + if (valueAndType.getTargetValue() != null + && valueAndType.getTargetValue().toString() + .indexOf("?") > -1) { + throw new org.seasar.framework.exception.SRuntimeException( + "EDAO0023"); + } + ctx.addSql(valueAndType.getTargetValue().toString()); + } + } + if (valueAndType.isValidRearOption()) { + ctx.addSql(valueAndType.buildRearOptionOnSql()); + } + } + + protected void setupValueAndType(InternalValueAndType valueAndType) { + final InternalValueAndTypeSetuper valueAndTypeSetuper = new InternalValueAndTypeSetuper( + _expression, _names, _specifiedSql, false); + valueAndTypeSetuper.setupValueAndType(valueAndType); + } + + protected void throwBindOrEmbeddedParameterNullValueException( + InternalValueAndType valueAndType) { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullValueException( + _expression, valueAndType.getTargetType(), + _specifiedSql, false); + } + + protected boolean isInScope() { + return _testValue != null && _testValue.startsWith("(") + && _testValue.endsWith(")"); + } + + protected void embedArray(CommandContext ctx, Object array) { + if (array == null) { + return; + } + final int length = Array.getLength(array); + if (length == 0) { + throwBindOrEmbeddedParameterEmptyListException(); + } + String quote = null; + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + quote = !(currentElement instanceof Number) ? "'" : ""; + break; + } + } + if (quote == null) { + throwBindOrEmbeddedParameterNullOnlyListException(); + } + boolean existsValidElements = false; + ctx.addSql("("); + for (int i = 0; i < length; ++i) { + final Object currentElement = Array.get(array, i); + if (currentElement != null) { + if (!existsValidElements) { + ctx.addSql(quote + currentElement + quote); + existsValidElements = true; + } else { + ctx.addSql(", " + quote + currentElement + quote); + } + } + } + ctx.addSql(")"); + } + + protected void throwBindOrEmbeddedParameterEmptyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterEmptyListException( + _expression, _specifiedSql, false); + } + + protected void throwBindOrEmbeddedParameterNullOnlyListException() { + ParameterCommentExceptionProvider + .throwBindOrEmbeddedParameterNullOnlyListException( + _expression, _specifiedSql, false); + } + } + + // ----------------------------------------------------- + // Value and Type + // -------------- + protected static class InternalValueAndType { + public Object _targetValue; + + public Class<?> _targetType; + + protected String _rearOption; + + public boolean isValidRearOption() { + return _targetValue != null && _rearOption != null + && _rearOption.trim().length() > 0; + } + + public String buildRearOptionOnSql() { + return " " + _rearOption.trim() + " "; + } + + public Object getTargetValue() { + return _targetValue; + } + + public void setTargetValue(Object targetValue) { + this._targetValue = targetValue; + } + + public Class<?> getTargetType() { + return _targetType; + } + + public void setTargetType(Class<?> targetType) { + this._targetType = targetType; + } + + public String getRearOption() { + return _rearOption; + } + + public void setRearOption(String rearOption) { + this._rearOption = rearOption; + } + } + + protected static class InternalValueAndTypeSetuper { + protected String _expression; + + protected String[] _names; + + protected String _specifiedSql; + + protected boolean _bind; + + public InternalValueAndTypeSetuper(String expression, String[] names, + String specifiedSql, boolean bind) { + this._expression = expression; + this._names = names; + this._specifiedSql = specifiedSql; + this._bind = bind; + } + + protected void setupValueAndType(InternalValueAndType valueAndType) { + Object value = valueAndType.getTargetValue(); + Class<?> clazz = valueAndType.getTargetType(); + + // LikeSearchOption handling here is for OutsideSql. + LikeSearchOption likeSearchOption = null; + String rearOption = null; + + for (int pos = 1; pos < _names.length; ++pos) { + if (value == null) { + break; + } + final String currentName = _names[pos]; + if (pos == 1) {// at the First Loop + final BeanDesc beanDesc = BeanDescFactory + .getBeanDesc(clazz); + if (hasLikeSearchOption(beanDesc, currentName)) { + likeSearchOption = getLikeSearchOption(beanDesc, + currentName, value); + } + } + if (Map.class.isInstance(value)) { + final Map<?, ?> map = (Map<?, ?>) value; + value = map.get(_names[pos]); + if (isLastLoop4LikeSearch(pos, likeSearchOption) + && isValidStringValue(value)) {// at the Last Loop + value = likeSearchOption + .generateRealValue((String) value); + rearOption = likeSearchOption.getRearOption(); + } + clazz = (value != null ? value.getClass() : clazz); + continue; + } + final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(clazz); + if (beanDesc.hasPropertyDesc(currentName)) { + final PropertyDesc pd = beanDesc + .getPropertyDesc(currentName); + value = getPropertyValue(clazz, value, currentName, pd); + if (isLastLoop4LikeSearch(pos, likeSearchOption) + && isValidStringValue(value)) {// at the Last Loop + value = likeSearchOption + .generateRealValue((String) value); + rearOption = likeSearchOption.getRearOption(); + } + clazz = (value != null ? value.getClass() : pd + .getPropertyType()); + continue; + } + final String methodName = "get" + initCap(currentName); + if (beanDesc.hasMethod(methodName)) {// Is this unused??? + final Method method = beanDesc.getMethod(methodName); + value = invokeGetter(method, value); + clazz = method.getReturnType(); + continue; + } + if (pos == 1 && MapParameterBean.class.isAssignableFrom(clazz)) { + final MapParameterBean pmb = (MapParameterBean) value; + final Map<String, Object> map = pmb.getParameterMap(); + final Object elementValue = (map != null ? map + .get(_names[pos]) : null); + if (elementValue != null) { + value = elementValue; + clazz = value.getClass(); + continue; + } + } + throwBindOrEmbeddedCommentNotFoundPropertyException( + _expression, clazz, currentName, _specifiedSql, _bind); + } + valueAndType.setTargetValue(value); + valueAndType.setTargetType(clazz); + valueAndType.setRearOption(rearOption); + } + + // for OutsideSql + protected boolean isLastLoop4LikeSearch(int pos, + LikeSearchOption likeSearchOption) { + return _names.length == (pos + 1) && likeSearchOption != null; + } + + protected boolean isValidStringValue(Object value) { + return value != null && value instanceof String + && ((String) value).length() > 0; + } + + // for OutsideSql + protected boolean hasLikeSearchOption(BeanDesc beanDesc, + String currentName) { + return beanDesc.hasPropertyDesc(currentName + + "InternalLikeSearchOption"); + } + + // for OutsideSql + protected LikeSearchOption getLikeSearchOption(BeanDesc beanDesc, + String currentName, Object resourceBean) { + final PropertyDesc pb = beanDesc.getPropertyDesc(currentName + + "InternalLikeSearchOption"); + final LikeSearchOption option = (LikeSearchOption) pb + .getValue(resourceBean); + if (option == null) { + throwLikeSearchOptionNotFoundException(resourceBean, + currentName); + } + if (option.isSplit()) { + throwOutsideSqlLikeSearchOptionSplitUnsupportedException( + option, resourceBean, currentName); + } + return option; + } + + // for OutsideSql + protected void throwLikeSearchOptionNotFoundException( + Object resourceBean, String currentName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The likeSearchOption was Not Found! (Should not be null!)" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your method call:" + getLineSeparator(); + final String beanName = resourceBean.getClass().getSimpleName(); + final String methodName = "set" + initCap(currentName) + + "_LikeSearch(value, likeSearchOption);"; + msg = msg + " " + beanName + "." + methodName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target ParameterBean]" + getLineSeparator() + + resourceBean + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new RequiredOptionNotFoundException(msg); + } + + // for OutsideSql + protected void throwOutsideSqlLikeSearchOptionSplitUnsupportedException( + LikeSearchOption option, Object resourceBean, String currentName) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The splitByXxx() of LikeSearchOption is unsupported at OutsideSql!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your method call:" + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + final String beanName = resourceBean.getClass().getSimpleName(); + final String methodName = "set" + initCap(currentName) + + "_LikeSearch(value, likeSearchOption);"; + msg = msg + " " + beanName + " pmb = new " + beanName + "();" + + getLineSeparator(); + msg = msg + + " LikeSearchOption likeSearchOption = new LikeSearchOption().likeContain();" + + getLineSeparator(); + msg = msg + + " likeSearchOption.splitBySpace(); // *No! Don't invoke this!" + + getLineSeparator(); + msg = msg + " pmb." + methodName + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + " " + beanName + " pmb = new " + beanName + "();" + + getLineSeparator(); + msg = msg + + " LikeSearchOption likeSearchOption = new LikeSearchOption().likeContain();" + + getLineSeparator(); + msg = msg + " pmb." + methodName + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target LikeSearchOption]" + getLineSeparator() + + option + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target ParameterBean]" + getLineSeparator() + + resourceBean + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new UnsupportedOperationException(msg); + } + + protected Object getPropertyValue(Class<?> beanType, Object beanValue, + String currentName, PropertyDesc pd) { + try { + return pd.getValue(beanValue); + } catch (RuntimeException e) { + throwPropertyHandlingFailureException(beanType, beanValue, + currentName, _expression, _specifiedSql, _bind, e); + return null;// Unreachable! + } + } + + protected void throwPropertyHandlingFailureException(Class<?> beanType, + Object beanValue, String currentName, String expression, + String specifiedSql, boolean bind, Exception e) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The handlig of the property was failed!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "This is the Framework Exception!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Bean Type]" + getLineSeparator() + beanType + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Bean Value]" + getLineSeparator() + beanValue + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Property Name]" + getLineSeparator() + currentName + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalStateException(msg, e); + } + + protected String initCap(String name) { + return SimpleStringUtil.initCap(name); + } + + protected Object invokeGetter(Method method, Object target) { + try { + return method.invoke(target, (Object[]) null); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (java.lang.reflect.InvocationTargetException e) { + throw new RuntimeException(e); + } + } + + protected void throwBindOrEmbeddedCommentNotFoundPropertyException( + String expression, Class<?> targetType, + String notFoundProperty, String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The property on the " + + (bind ? "bind variable" : "embedded value") + + " comment was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your property on your arguments." + + getLineSeparator(); + msg = msg + "Abd has the property had misspelling?" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[NotFound Property]" + getLineSeparator() + + (targetType != null ? targetType.getName() + "#" : "") + + notFoundProperty + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + if (bind) { + throw new BindVariableCommentNotFoundPropertyException(msg); + } else { + throw new EmbeddedValueCommentNotFoundPropertyException(msg); + } + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + // ----------------------------------------------------- + // Exception Provider + // ------------------ + protected static class ParameterCommentExceptionProvider { + public static void throwBindOrEmbeddedParameterNullValueException( + String expression, Class<?> targetType, String specifiedSql, + boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The value of " + + (bind ? "bind variable" : "embedded value") + + " was Null!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Is it within the scope of your assumption?" + + getLineSeparator(); + msg = msg + + "If the answer is YES, please confirm your application logic about the parameter." + + getLineSeparator(); + msg = msg + + "If the answer is NO, please confirm the logic of parameter comment(especially IF comment)." + + getLineSeparator(); + msg = msg + " --> For example:" + getLineSeparator(); + msg = msg + " before (x) -- XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Parameter Property Type]" + getLineSeparator() + + targetType + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + if (bind) { + throw new BindVariableParameterNullValueException(msg); + } else { + throw new EmbeddedValueParameterNullValueException(msg); + } + } + + public static void throwBindOrEmbeddedParameterEmptyListException( + String expression, String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The list of " + + (bind ? "bind variable" : "embedded value") + + " was empty!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your application logic." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + msg = msg + + " List<Integer> xxxIdList = new ArrayList<Integer>();" + + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + + " List<Integer> xxxIdList = new ArrayList<Integer>();" + + getLineSeparator(); + msg = msg + " xxxIdList.add(3);" + getLineSeparator(); + msg = msg + " xxxIdList.add(7);" + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalArgumentException(msg); + } + + public static void throwBindOrEmbeddedParameterNullOnlyListException( + String expression, String specifiedSql, boolean bind) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The list of " + + (bind ? "bind variable" : "embedded value") + + " was 'Null Only List'!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm your application logic." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " before (x):" + getLineSeparator(); + msg = msg + + " List<Integer> xxxIdList = new ArrayList<Integer>();" + + getLineSeparator(); + msg = msg + " xxxIdList.add(null);" + getLineSeparator(); + msg = msg + " xxxIdList.add(null);" + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + " after (o):" + getLineSeparator(); + msg = msg + + " List<Integer> xxxIdList = new ArrayList<Integer>();" + + getLineSeparator(); + msg = msg + " xxxIdList.add(3);" + getLineSeparator(); + msg = msg + " xxxIdList.add(7);" + getLineSeparator(); + msg = msg + + " cb.query().setXxxId_InScope(xxxIdList);// Or pmb.setXxxIdList(xxxIdList);" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[" + (bind ? "Bind Variable" : "Embedded Value") + + " Comment Expression]" + getLineSeparator() + expression + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IllegalArgumentException(msg); + } + + protected static String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + // ----------------------------------------------------- + // IfNode + // ------ + protected static class InternalIfNode extends ContainerNode { + private String _expression; + + private Object _parsedExpression; + + private InternalElseNode _elseNode; + + private String _specifiedSql; + + public InternalIfNode(String expression, String specifiedSql) { + this._expression = expression; + this._parsedExpression = OgnlUtil.parseExpression(expression); + this._specifiedSql = specifiedSql; + } + + public String getExpression() { + return _expression; + } + + public InternalElseNode getElseNode() { + return _elseNode; + } + + public void setElseNode(InternalElseNode elseNode) { + this._elseNode = elseNode; + } + + public void accept(CommandContext ctx) { + Object result = null; + try { + result = OgnlUtil.getValue(_parsedExpression, ctx); + } catch (RuntimeException e) { + if (!_expression.contains("pmb.")) { + throwIfCommentWrongExpressionException(_expression, e, + _specifiedSql); + } + final String replaced = InternalStringUtil.replace(_expression, + "pmb.", "pmb.parameterMap."); + final Object secondParsedExpression = OgnlUtil + .parseExpression(replaced); + try { + result = OgnlUtil.getValue(secondParsedExpression, ctx); + } catch (RuntimeException ignored) { + throwIfCommentWrongExpressionException(_expression, e, + _specifiedSql); + } + if (result == null) { + throwIfCommentWrongExpressionException(_expression, e, + _specifiedSql); + } + _parsedExpression = secondParsedExpression; + } + if (result != null && result instanceof Boolean) { + if (((Boolean) result).booleanValue()) { + super.accept(ctx); + ctx.setEnabled(true); + } else if (_elseNode != null) { + _elseNode.accept(ctx); + ctx.setEnabled(true); + } + } else { + throwIfCommentNotBooleanResultException(_expression, result, + _specifiedSql); + } + } + + protected void throwIfCommentWrongExpressionException( + String expression, RuntimeException cause, String specifiedSql) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The IF comment of your specified SQL was Wrong!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the existence of your property on your arguments." + + getLineSeparator(); + msg = msg + "And confirm the IF comment of your specified SQL." + + getLineSeparator(); + msg = msg + " For example, correct IF comment is as below:" + + getLineSeparator(); + msg = msg + " /*IF pmb.xxxId != null*/XXX_ID = .../*END*/" + + getLineSeparator(); + msg = msg + " /*IF pmb.isPaging()*/.../*END*/" + + getLineSeparator(); + msg = msg + + " /*IF pmb.xxxId == null && pmb.xxxName != null*/.../*END*/" + + getLineSeparator(); + msg = msg + + " /*IF pmb.xxxId == null || pmb.xxxName != null*/.../*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Expression]" + getLineSeparator() + + expression + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Cause Message]" + getLineSeparator(); + msg = msg + cause.getClass() + ":" + getLineSeparator(); + msg = msg + " --> " + cause.getMessage() + getLineSeparator(); + final Throwable nestedCause = cause.getCause(); + if (nestedCause != null) { + msg = msg + nestedCause.getClass() + ":" + getLineSeparator(); + msg = msg + " --> " + nestedCause.getMessage() + + getLineSeparator(); + } + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IfCommentWrongExpressionException(msg, cause); + } + + protected void throwIfCommentNotBooleanResultException( + String expression, Object result, String specifiedSql) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + + "The boolean expression on IF comment of your specified SQL was Wrong!" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "Please confirm the grammar of your IF comment. Does it really express boolean?" + + getLineSeparator(); + msg = msg + + "And confirm the existence of your property on your arguments if you use parameterMap." + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Expression]" + getLineSeparator() + + expression + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[IF Comment Result Value]" + getLineSeparator() + + result + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + specifiedSql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new IfCommentNotBooleanResultException(msg); + } + + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + } + + // ----------------------------------------------------- + // ElseNode + // -------- + protected static class InternalElseNode extends ContainerNode { + public void accept(CommandContext ctx) { + super.accept(ctx); + ctx.setEnabled(true); + } + } + + // ----------------------------------------------------- + // StringUtil + // ---------- + 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) { + return SimpleStringUtil.replace(text, fromText, toText); + } + + public static String[] split(String str, String delim) { + if (str == null) { + return EMPTY_STRINGS; + } + List<String> list = new ArrayList<String>(); + StringTokenizer st = new StringTokenizer(str, delim); + while (st.hasMoreElements()) { + list.add(st.nextToken()); + } + return (String[]) list.toArray(new String[list.size()]); + } + } + + //========================================================================== + // ========= + // Convert + // ======= + public static String convertTwoWaySql2DisplaySql(String twoWaySql, + Object arg) { + final String[] argNames = new String[] { "dto" }; + final Class<?>[] argTypes = new Class<?>[] { arg.getClass() }; + final Object[] args = new Object[] { arg }; + return convertTwoWaySql2DisplaySql(twoWaySql, argNames, argTypes, args); + } + + public static String convertTwoWaySql2DisplaySql(String twoWaySql, + String[] argNames, Class<?>[] argTypes, Object[] args) { + final CommandContext context; + { + final InternalSqlParser parser = new InternalSqlParser(twoWaySql); + final Node node = parser.parse(); + final InternalCommandContextCreator creator = new InternalCommandContextCreator( + argNames, argTypes); + context = creator.createCommandContext(args); + node.accept(context); + } + final String preparedSql = context.getSql(); + return InternalBindVariableUtil.getCompleteSql(preparedSql, context + .getBindVariables()); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlParser.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,301 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.sqlparser; + +import jp.sf.pal.scheduler.db.allcommon.exception.EndCommentNotFoundException; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalSqlTokenizer { + + //========================================================================== + // ========= + // Definition + // ========== + public static final int SQL = 1; + + public static final int COMMENT = 2; + + public static final int ELSE = 3; + + public static final int BIND_VARIABLE = 4; + + public static final int EOF = 99; + + //========================================================================== + // ========= + // Attribute + // ========= + protected String sql; + + protected int position = 0; + + protected String token; + + protected int tokenType = SQL; + + protected int nextTokenType = SQL; + + protected int bindVariableNum = 0; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalSqlTokenizer(String sql) { + this.sql = sql; + } + + //========================================================================== + // ========= + // Tokenize + // ======== + public int next() { + if (position >= sql.length()) { + token = null; + tokenType = EOF; + nextTokenType = EOF; + return tokenType; + } + switch (nextTokenType) { + case SQL: + parseSql(); + break; + case COMMENT: + parseComment(); + break; + case ELSE: + parseElse(); + break; + case BIND_VARIABLE: + parseBindVariable(); + break; + default: + parseEof(); + break; + } + return tokenType; + } + + protected void parseSql() { + int commentStartPos = sql.indexOf("/*", position); + int commentStartPos2 = sql.indexOf("#*", position); + if (0 < commentStartPos2 && commentStartPos2 < commentStartPos) { + commentStartPos = commentStartPos2; + } + int lineCommentStartPos = sql.indexOf("--", position); + int bindVariableStartPos = sql.indexOf("?", position); + int elseCommentStartPos = -1; + int elseCommentLength = -1; + if (lineCommentStartPos >= 0) { + int skipPos = skipWhitespace(lineCommentStartPos + 2); + if (skipPos + 4 < sql.length() + && "ELSE".equals(sql.substring(skipPos, skipPos + 4))) { + elseCommentStartPos = lineCommentStartPos; + elseCommentLength = skipPos + 4 - lineCommentStartPos; + } + } + int nextStartPos = getNextStartPos(commentStartPos, + elseCommentStartPos, bindVariableStartPos); + if (nextStartPos < 0) { + token = sql.substring(position); + nextTokenType = EOF; + position = sql.length(); + tokenType = SQL; + } else { + token = sql.substring(position, nextStartPos); + tokenType = SQL; + boolean needNext = nextStartPos == position; + if (nextStartPos == commentStartPos) { + nextTokenType = COMMENT; + position = commentStartPos + 2; + } else if (nextStartPos == elseCommentStartPos) { + nextTokenType = ELSE; + position = elseCommentStartPos + elseCommentLength; + } else if (nextStartPos == bindVariableStartPos) { + nextTokenType = BIND_VARIABLE; + position = bindVariableStartPos; + } + if (needNext) { + next(); + } + } + } + + protected int getNextStartPos(int commentStartPos, int elseCommentStartPos, + int bindVariableStartPos) { + int nextStartPos = -1; + if (commentStartPos >= 0) { + nextStartPos = commentStartPos; + } + if (elseCommentStartPos >= 0 + && (nextStartPos < 0 || elseCommentStartPos < nextStartPos)) { + nextStartPos = elseCommentStartPos; + } + if (bindVariableStartPos >= 0 + && (nextStartPos < 0 || bindVariableStartPos < nextStartPos)) { + nextStartPos = bindVariableStartPos; + } + return nextStartPos; + } + + protected String nextBindVariableName() { + return "$" + ++bindVariableNum; + } + + protected void parseComment() { + int commentEndPos = sql.indexOf("*/", position); + int commentEndPos2 = sql.indexOf("*#", position); + if (0 < commentEndPos2 && commentEndPos2 < commentEndPos) { + commentEndPos = commentEndPos2; + } + if (commentEndPos < 0) { + throwEndCommentNotFoundException(sql.substring(position)); + } + token = sql.substring(position, commentEndPos); + nextTokenType = SQL; + position = commentEndPos + 2; + tokenType = COMMENT; + } + + protected void throwEndCommentNotFoundException(String expression) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "The end comment was Not Found!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + "Please confirm the parameter comment logic." + + getLineSeparator(); + msg = msg + + "It may exist the parameter comment that DOESN'T have an end comment." + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + + " before (x) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3" + + getLineSeparator(); + msg = msg + + " after (o) -- /*IF pmb.xxxId != null*/XXX_ID = /*pmb.xxxId*/3/*END*/" + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[End Comment Expected Place]" + getLineSeparator() + + expression + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Specified SQL]" + getLineSeparator() + sql + + getLineSeparator(); + msg = msg + "* * * * * * * * * */" + getLineSeparator(); + throw new EndCommentNotFoundException(msg); + } + + protected void parseBindVariable() { + token = nextBindVariableName(); + nextTokenType = SQL; + position += 1; + tokenType = BIND_VARIABLE; + } + + protected void parseElse() { + token = null; + nextTokenType = SQL; + tokenType = ELSE; + } + + protected void parseEof() { + token = null; + tokenType = EOF; + nextTokenType = EOF; + } + + public String skipToken() { + int index = sql.length(); + char quote = position < sql.length() ? sql.charAt(position) : '\0'; + boolean quoting = quote == '\'' || quote == '('; + if (quote == '(') { + quote = ')'; + } + for (int i = quoting ? position + 1 : position; i < sql.length(); ++i) { + char c = sql.charAt(i); + if ((Character.isWhitespace(c) || c == ',' || c == ')' || c == '(') + && !quoting) { + index = i; + break; + } else if (c == '/' && i + 1 < sql.length() + && sql.charAt(i + 1) == '*') { + index = i; + break; + } else if (c == '-' && i + 1 < sql.length() + && sql.charAt(i + 1) == '-') { + index = i; + break; + } else if (quoting && quote == '\'' && c == '\'' + && (i + 1 >= sql.length() || sql.charAt(i + 1) != '\'')) { + index = i + 1; + break; + } else if (quoting && c == quote) { + index = i + 1; + break; + } + } + token = sql.substring(position, index); + tokenType = SQL; + nextTokenType = SQL; + position = index; + return token; + } + + public String skipWhitespace() { + int index = skipWhitespace(position); + token = sql.substring(position, index); + position = index; + return token; + } + + protected int skipWhitespace(int position) { + int index = sql.length(); + for (int i = position; i < sql.length(); ++i) { + char c = sql.charAt(i); + if (!Character.isWhitespace(c)) { + index = i; + break; + } + } + return index; + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public int getPosition() { + return position; + } + + public String getToken() { + return token; + } + + public String getBefore() { + return sql.substring(0, position); + } + + public String getAfter() { + return sql.substring(position); + } + + public int getTokenType() { + return tokenType; + } + + public int getNextTokenType() { + return nextTokenType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/sqlparser/InternalSqlTokenizer.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,304 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.util; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Calendar; + +import jp.sf.pal.scheduler.db.allcommon.DBFluteConfig; + +import org.seasar.extension.jdbc.ValueType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalBindVariableUtil { + + //========================================================================== + // ========= + // Definition + // ========== + private static final String NULL = "null"; + + //========================================================================== + // ========= + // Constructor + // =========== + private InternalBindVariableUtil() { + } + + public static String getCompleteSql(String sql, Object[] args) { + if (args == null || args.length == 0) { + return sql; + } + return getCompleteSql(sql, args, new ValueType[args.length]); + } + + public static String getCompleteSql(String sql, Object[] args, + ValueType[] valueTypes) { + if (args == null || args.length == 0) { + return sql; + } + StringBuffer buf = new StringBuffer(sql.length() + args.length * 15); + int pos = 0; + int pos2 = 0; + int pos3 = 0; + int pos4 = 0; + int pos5 = 0; + int pos6 = 0; + int index = 0; + while (true) { + pos = sql.indexOf('?', pos2); + pos3 = sql.indexOf('\'', pos2); + pos4 = sql.indexOf('\'', pos3 + 1); + pos5 = sql.indexOf("/*", pos2); + pos6 = sql.indexOf("*/", pos5 + 1); + if (pos > 0) { + if (pos3 >= 0 && pos3 < pos && pos < pos4) { + buf.append(sql.substring(pos2, pos4 + 1)); + pos2 = pos4 + 1; + } else if (pos5 >= 0 && pos5 < pos && pos < pos6) { + buf.append(sql.substring(pos2, pos6 + 1)); + pos2 = pos6 + 1; + } else { + if (args.length <= index) { + String msg = "The size of bind arguments is illegal:"; + msg = msg + " size=" + args.length + " sql=" + sql; + throw new IllegalStateException(msg); + } + buf.append(sql.substring(pos2, pos)); + buf.append(getBindVariableText(args[index], + valueTypes[index])); + pos2 = pos + 1; + index++; + } + } else { + buf.append(sql.substring(pos2)); + break; + } + } + return buf.toString(); + } + + public static String getBindVariableText(Object bindVariable) { + if (bindVariable instanceof String) { + return quote(bindVariable.toString()); + } else if (bindVariable instanceof Number) { + return bindVariable.toString(); + } else if (bindVariable instanceof Time) { + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); + return quote(sdf.format((java.util.Date) bindVariable)); + } else if (bindVariable instanceof Timestamp) { + SimpleDateFormat sdf = new SimpleDateFormat(getLogTimestampFormat()); + return quote(sdf.format((java.util.Date) bindVariable)); + } else if (bindVariable instanceof java.util.Date) { + SimpleDateFormat sdf = new SimpleDateFormat(getLogDateFormat()); + return quote(sdf.format((java.util.Date) bindVariable)); + } else if (bindVariable instanceof Boolean) { + return bindVariable.toString(); + } else if (bindVariable == null) { + return NULL; + } else { + return quote(bindVariable.toString()); + } + } + + protected static String getLogDateFormat() { + String logDateFormat = DBFluteConfig.getInstance().getLogDateFormat(); + return logDateFormat != null ? logDateFormat : "yyyy-MM-dd"; + } + + protected static String getLogTimestampFormat() { + String logTimestampFormat = DBFluteConfig.getInstance() + .getLogTimestampFormat(); + return logTimestampFormat != null ? logTimestampFormat + : "yyyy-MM-dd HH:mm:ss"; + } + + // For various seasar's version. + protected static final Class<?>[] TOTEXT_ARGUMENT_TYPES = new Class<?>[] { Object.class }; + + protected static final Method TOTEXT_METHOD; + static { + Method method = null; + try { + method = ValueType.class.getMethod("toText", TOTEXT_ARGUMENT_TYPES); + } catch (SecurityException e) { + } catch (NoSuchMethodException e) { + } + TOTEXT_METHOD = method; + } + + public static String getBindVariableText(Object bindVariable, + ValueType valueType) { + if (valueType != null && TOTEXT_METHOD != null) { + try { + return (String) TOTEXT_METHOD.invoke(valueType, + new Object[] { bindVariable }); + } catch (IllegalArgumentException e) { + String msg = "ValueType.toText() threw the IllegalArgumentException:"; + msg = msg + " valueType=" + valueType + " bindVariable=" + + bindVariable; + throw new IllegalStateException(msg, e); + } catch (IllegalAccessException e) { + String msg = "ValueType.toText() threw the IllegalAccessException:"; + msg = msg + " valueType=" + valueType + " bindVariable=" + + bindVariable; + throw new IllegalStateException(msg, e); + } catch (InvocationTargetException e) { + if (e.getTargetException() instanceof RuntimeException) { + throw (RuntimeException) e.getTargetException(); + } else { + String msg = "ValueType.toText() threw the exception:"; + msg = msg + " valueType=" + valueType + " bindVariable=" + + bindVariable; + throw new IllegalStateException(msg, e.getTargetException()); + } + } + } + return getBindVariableText(bindVariable); + } + + public static String nullText() { + return NULL; + } + + public static String toText(Number value) { + if (value == null) { + return NULL; + } + return value.toString(); + } + + public static String toText(Boolean value) { + if (value == null) { + return NULL; + } + return quote(value.toString()); + } + + public static String toText(String value) { + if (value == null) { + return NULL; + } + return quote(value); + } + + public static String toText(Date value) { + if (value == null) { + return NULL; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(value); + StringBuilder buf = new StringBuilder(); + addDate(buf, calendar); + return quote(buf.toString()); + } + + public static String toText(Time value) { + if (value == null) { + return NULL; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(value); + StringBuilder buf = new StringBuilder(); + addTime(buf, calendar); + addTimeDecimalPart(buf, calendar.get(Calendar.MILLISECOND)); + return quote(buf.toString()); + } + + public static String toText(Timestamp value) { + if (value == null) { + return NULL; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(value); + StringBuilder buf = new StringBuilder(30); + addDate(buf, calendar); + addTime(buf, calendar); + addTimeDecimalPart(buf, value.getNanos()); + return quote(buf.toString()); + } + + public static String toText(byte[] value) { + if (value == null) { + return NULL; + } + return quote(value.toString() + "(byteLength=" + + Integer.toString(value.length) + ")"); + } + + /** + * {@link Object}の文字列表現を返します。 + * + * @param value 値 + * @return 文字列表現 + */ + public static String toText(Object value) { + if (value == null) { + return NULL; + } + return quote(value.toString()); + } + + // yyyy-mm-dd + protected static void addDate(StringBuilder buf, Calendar calendar) { + int year = calendar.get(Calendar.YEAR); + buf.append(year); + buf.append('-'); + int month = calendar.get(Calendar.MONTH) + 1; + if (month < 10) { + buf.append('0'); + } + buf.append(month); + buf.append('-'); + int date = calendar.get(Calendar.DATE); + if (date < 10) { + buf.append('0'); + } + buf.append(date); + } + + // hh:mm:ss + protected static void addTime(StringBuilder buf, Calendar calendar) { + if (buf.length() > 0) { + buf.append(' '); + } + int hour = calendar.get(Calendar.HOUR_OF_DAY); + if (hour < 10) { + buf.append('0'); + } + buf.append(hour); + buf.append(':'); + int minute = calendar.get(Calendar.MINUTE); + if (minute < 10) { + buf.append('0'); + } + buf.append(minute); + buf.append(':'); + int second = calendar.get(Calendar.SECOND); + if (second < 10) { + buf.append('0'); + } + buf.append(second); + } + + // .000 + protected static void addTimeDecimalPart(StringBuilder buf, int decimalPart) { + if (decimalPart == 0) { + return; + } + if (buf.length() > 0) { + buf.append('.'); + } + buf.append(decimalPart); + } + + // 'text' + protected static String quote(String text) { + return "'" + text + "'"; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/util/InternalBindVariableUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/valuetype/InternalBytesOidType.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/valuetype/InternalBytesOidType.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/valuetype/InternalBytesOidType.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,137 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.valuetype; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; + +import org.seasar.extension.jdbc.types.BytesType; + +/** + * The value type of bytes OID. (for PostgreSQL) + * + * @author DBFlute(AutoGenerator) + */ +public class InternalBytesOidType extends BytesType { + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalBytesOidType() { + super(new InternalBytesOidTrait()); + } + + //========================================================================== + // ========= + // Blob Trait + // ========== + protected static class InternalBytesOidTrait implements Trait { + + public int getSqlType() { + return Types.BLOB; + } + + public void set(PreparedStatement ps, int parameterIndex, byte[] bytes) + throws SQLException { + ps.setBlob(parameterIndex, createBytesOidImpl(bytes)); + } + + protected Blob createBytesOidImpl(byte[] bytes) { + return new InternalBytesOidImpl(bytes); + } + + public void set(CallableStatement cs, String parameterName, byte[] bytes) + throws SQLException { + cs.setBytes(parameterName, bytes); + } + + public byte[] get(ResultSet rs, int columnIndex) throws SQLException { + return BytesType.toBytes(rs.getBlob(columnIndex)); + } + + public byte[] get(ResultSet rs, String columnName) throws SQLException { + return BytesType.toBytes(rs.getBlob(columnName)); + } + + public byte[] get(CallableStatement cs, int columnIndex) + throws SQLException { + return BytesType.toBytes(cs.getBlob(columnIndex)); + } + + public byte[] get(CallableStatement cs, String columnName) + throws SQLException { + return BytesType.toBytes(cs.getBlob(columnName)); + } + } + + //========================================================================== + // ========= + // Blob Implementation + // =================== + protected static class InternalBytesOidImpl implements Blob { + + protected byte[] bytes; + + public InternalBytesOidImpl(byte[] bytes) { + this.bytes = bytes; + } + + public void free() throws SQLException { // for JDK-6.0 + throw new UnsupportedOperationException("free()"); + } + + public InputStream getBinaryStream() throws SQLException { + return new ByteArrayInputStream(bytes); + } + + public InputStream getBinaryStream(long pos, long length) + throws SQLException { // for JDK-6.0 + throw new UnsupportedOperationException( + "getBinaryStream(pos, length)"); + } + + public byte[] getBytes(long pos, int length) throws SQLException { + if (length == bytes.length) { + return bytes; + } + byte[] result = new byte[length]; + System.arraycopy(bytes, 0, result, 0, length); + return result; + } + + public long length() throws SQLException { + return bytes.length; + } + + public long position(Blob pattern, long start) throws SQLException { + throw new UnsupportedOperationException("position"); + } + + public long position(byte[] pattern, long start) throws SQLException { + throw new UnsupportedOperationException("position"); + } + + public OutputStream setBinaryStream(long pos) throws SQLException { + throw new UnsupportedOperationException("setBinaryStream"); + } + + public int setBytes(long pos, byte[] bytes, int offset, int len) + throws SQLException { + throw new UnsupportedOperationException("setBytes"); + } + + public int setBytes(long pos, byte[] bytes) throws SQLException { + throw new UnsupportedOperationException("setBytes"); + } + + public void truncate(long len) throws SQLException { + throw new UnsupportedOperationException("truncate"); + } + } +} \ No newline at end of file Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/valuetype/InternalBytesOidType.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaData.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaData.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaData.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,101 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalProcedureMetaData { + + //========================================================================== + // ========= + // Attribute + // ========= + private String procedureName; + + private Map<String, InternalProcedureParameterType> unorderedMap = createUnorderedMap(); + + private Map<String, InternalProcedureParameterType> parameterTypes = createParameterTypes(); + + private boolean returnType; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalProcedureMetaData(final String procedureName) { + this.procedureName = procedureName; + } + + //========================================================================== + // ========= + // Factory + // ======= + protected Map<String, InternalProcedureParameterType> createUnorderedMap() { + return new HashMap<String, InternalProcedureParameterType>(); + } + + protected Map<String, InternalProcedureParameterType> createParameterTypes() { + return new TreeMap<String, InternalProcedureParameterType>( + new ParameterComparator()); + } + + protected class ParameterComparator implements Comparator<String> { + public int compare(String o1, String o2) { + final int oneGreaterThanTwo = 1; + final int twoGreaterThanOne = -1; + final InternalProcedureParameterType parameterType1 = unorderedMap + .get(o1); + final InternalProcedureParameterType parameterType2 = unorderedMap + .get(o2); + if (parameterType1.isReturnType()) { + return twoGreaterThanOne; // Return type is prior + } + if (parameterType2.isReturnType()) { + return oneGreaterThanTwo; // Return type is prior + } + final Integer parameterIndex1 = parameterType1.getParameterIndex(); + final Integer parameterIndex2 = parameterType2.getParameterIndex(); + if (parameterIndex1 == null && parameterIndex2 == null) { + return oneGreaterThanTwo; // No changes + } + if (parameterIndex1 != null && parameterIndex2 == null) { + return twoGreaterThanOne; // Not null is prior + } + if (parameterIndex1 == null && parameterIndex2 != null) { + return oneGreaterThanTwo; // Not null is prior + } + return parameterIndex1.compareTo(parameterIndex2); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getProcedureName() { + return procedureName; + } + + public Collection<InternalProcedureParameterType> parameterTypes() { + return parameterTypes.values(); + } + + public void addParameterType( + final InternalProcedureParameterType parameterType) { + final String name = parameterType.getParameterName(); + unorderedMap.put(name, parameterType); + parameterTypes.put(name, parameterType); + if (parameterType.isReturnType()) { + returnType = true; + } + } + + public boolean hasReturnParameterType() { + return returnType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaData.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,232 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; + +import org.seasar.dao.ValueTypeFactory; +import org.seasar.dao.util.TypeUtil; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.extension.jdbc.types.ValueTypes; +import org.seasar.framework.beans.BeanDesc; +import org.seasar.framework.beans.factory.BeanDescFactory; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalProcedureMetaDataFactory { + + //========================================================================== + // ========= + // Attribute + // ========= + protected ValueTypeFactory valueTypeFactory; + + protected InternalFieldProcedureAnnotationReader annotationReader = new InternalFieldProcedureAnnotationReader(); + + //========================================================================== + // ========= + // Main + // ==== + public InternalProcedureMetaData createProcedureMetaData( + final String procedureName, final Class<?> pmbType) { + final InternalProcedureMetaData metaData = new InternalProcedureMetaData( + procedureName); + if (pmbType == null) { + return metaData; + } else { + if (!isDtoType(pmbType)) { + throw new IllegalStateException( + "The pmb type was Not DTO type: " + pmbType.getName()); + } + } + final BeanDesc pmbDesc = BeanDescFactory.getBeanDesc(pmbType); + + // *Point + final Stack<Class<?>> stack = new Stack<Class<?>>(); + for (Class<?> clazz = pmbType; clazz != null && clazz != Object.class; clazz = clazz + .getSuperclass()) { + stack.push(clazz); + } + for (; !stack.isEmpty();) { + final Class<?> clazz = stack.pop(); + registerParameterType(metaData, pmbDesc, clazz.getDeclaredFields()); + } + + return metaData; + } + + protected void registerParameterType(InternalProcedureMetaData metaData, + BeanDesc pmbDesc, Field[] fields) { + for (Field field : fields) { + if (!isInstanceField(field)) { + continue; + } + final InternalProcedureParameterType ppt = getProcedureParameterType( + pmbDesc, field); + if (ppt == null) { + continue; + } + metaData.addParameterType(ppt); + } + } + + protected InternalProcedureParameterType getProcedureParameterType( + final BeanDesc dtoDesc, final Field field) { + final String procedureParameter = annotationReader + .getProcedureParameter(dtoDesc, field); + if (procedureParameter == null) { + return null; + } + final String type = extractParameterType(procedureParameter); + field.setAccessible(true); + final InternalProcedureParameterType ppt = new InternalProcedureParameterType( + field); + if (type.equalsIgnoreCase("in")) { + ppt.setInType(true); + } else if (type.equalsIgnoreCase("out")) { + ppt.setOutType(true); + } else if (type.equalsIgnoreCase("inout")) { + ppt.setInType(true); + ppt.setOutType(true); + } else if (type.equalsIgnoreCase("return")) { + ppt.setOutType(true); + ppt.setReturnType(true); + } else { + String msg = "The parameter type should be 'in' or 'out' or 'inout' or 'return':"; + msg = msg + " class=" + field.getDeclaringClass().getSimpleName(); + msg = msg + " field=" + field.getName(); + msg = msg + " parameterType=" + type; + throw new IllegalStateException(msg); + } + final Integer index = extractParameterIndex(procedureParameter, field); + ppt.setParameterIndex(index); + final ValueType valueType = getValueType(dtoDesc, field); + ppt.setValueType(valueType); + return ppt; + } + + protected String extractParameterType(String procedureParameter) { + if (procedureParameter.contains(",")) { + return procedureParameter.substring(0, + procedureParameter.indexOf(",")).trim(); + } + return procedureParameter.trim(); + } + + protected Integer extractParameterIndex(String procedureParameter, + Field field) { + if (procedureParameter.contains(",")) { + String tmp = procedureParameter.substring( + procedureParameter.indexOf(",") + ",".length()).trim(); + try { + return Integer.valueOf(tmp); + } catch (NumberFormatException e) { + String msg = "The parameter index should be number:"; + msg = msg + " class=" + + field.getDeclaringClass().getSimpleName(); + msg = msg + " field=" + field.getName(); + msg = msg + " parameterIndex=" + tmp + " procedureParameter=" + + procedureParameter; + throw new IllegalStateException(msg, e); + } + } + return null; + } + + protected ValueType getValueType(final BeanDesc dtoDesc, final Field field) { + final String name = annotationReader.getValueType(dtoDesc, field); + if (name != null) { + return valueTypeFactory.getValueTypeByName(name); + } + final Class<?> type = field.getType(); + if (List.class.isAssignableFrom(type)) {// is for out parameter cursor. + if (ConditionBeanContext.isOracle()) { + return ValueTypes.ORACLE_RESULT_SET; + } else if (ConditionBeanContext.isPostgreSql()) { + return ValueTypes.POSTGRE_RESULT_SET; + } else { + return ValueTypes.SERIALIZABLE_BYTE_ARRAY; + } + } + return valueTypeFactory.getValueTypeByClass(type); + } + + protected boolean isInstanceField(final Field field) { + final int mod = field.getModifiers(); + return !Modifier.isStatic(mod) && !Modifier.isFinal(mod); + } + + protected boolean isDtoType(final Class<?> clazz) { + return !TypeUtil.isSimpleType(clazz) && !isContainerType(clazz); + } + + protected boolean isContainerType(final Class<?> clazz) { + if (clazz == null) { + throw new NullPointerException("clazz"); + } + return Collection.class.isAssignableFrom(clazz) + || Map.class.isAssignableFrom(clazz) || clazz.isArray(); + } + + public void setValueTypeFactory(final ValueTypeFactory valueTypeFactory) { + this.valueTypeFactory = valueTypeFactory; + } + + protected static class InternalFieldProcedureAnnotationReader { + protected String PROCEDURE_PARAMETER_SUFFIX; + + protected String VALUE_TYPE_SUFFIX; + + public InternalFieldProcedureAnnotationReader() { + PROCEDURE_PARAMETER_SUFFIX = "_PROCEDURE_PARAMETER"; + VALUE_TYPE_SUFFIX = "_VALUE_TYPE"; + } + + public String getProcedureParameter(BeanDesc dtoDesc, Field field) { + String fieldName = removeInstanceVariablePrefix(field.getName());// * + // Point + String annotationName = fieldName + PROCEDURE_PARAMETER_SUFFIX; + if (dtoDesc.hasField(annotationName)) { + Field f = dtoDesc.getField(annotationName); + return (String) getValue(f, null); + } else { + return null; + } + } + + public String getValueType(BeanDesc dtoDesc, Field field) { + String fieldName = removeInstanceVariablePrefix(field.getName());// * + // Point + String annotationName = fieldName + VALUE_TYPE_SUFFIX; + if (dtoDesc.hasField(annotationName)) { + Field f = dtoDesc.getField(annotationName); + return (String) getValue(f, null); + } else { + return null; + } + } + + protected String removeInstanceVariablePrefix(String fieldName) { + return fieldName.startsWith("_") ? fieldName + .substring("_".length()) : fieldName; + } + + protected Object getValue(Field field, Object target) { + try { + return field.get(target); + } catch (IllegalAccessException e) { + String msg = "The getting of the field threw the exception:"; + msg = msg + " class=" + + field.getDeclaringClass().getSimpleName(); + msg = msg + " field=" + field.getName(); + throw new IllegalStateException(msg, e); + } + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureMetaDataFactory.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureParameterType.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureParameterType.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureParameterType.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,112 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.lang.reflect.Field; + +import org.seasar.extension.jdbc.ValueType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalProcedureParameterType { + + //========================================================================== + // ========= + // Attribute + // ========= + private String parameterName; + + private Integer parameterIndex; + + private Field field; + + private ValueType valueType; + + private boolean inType; + + private boolean outType; + + private boolean returnType; + + //========================================================================== + // ========= + // Constructor + // =========== + public InternalProcedureParameterType(Field field) { + this.field = field; + this.parameterName = field.getName(); + } + + //========================================================================== + // ========= + // Field Value + // =========== + public Object getValue(Object target) { + try { + return field.get(target); + } catch (IllegalAccessException e) { + String msg = "The getting of the field threw the exception:"; + msg = msg + " class=" + field.getDeclaringClass().getSimpleName(); + msg = msg + " field=" + field.getName(); + throw new IllegalStateException(msg, e); + } + } + + public void setValue(Object target, Object value) { + try { + field.set(target, value); + } catch (IllegalAccessException e) { + String msg = "The setting of the field threw the exception:"; + msg = msg + " class=" + field.getDeclaringClass().getSimpleName(); + msg = msg + " field=" + field.getName(); + throw new IllegalStateException(msg, e); + } + } + + //========================================================================== + // ========= + // Accessor + // ======== + public String getParameterName() { + return parameterName; + } + + public Integer getParameterIndex() { + return parameterIndex; + } + + public void setParameterIndex(Integer parameterIndex) { + this.parameterIndex = parameterIndex; + } + + public ValueType getValueType() { + return valueType; + } + + public void setValueType(final ValueType valueType) { + this.valueType = valueType; + } + + public boolean isInType() { + return inType; + } + + public void setInType(final boolean inType) { + this.inType = inType; + } + + public boolean isOutType() { + return outType; + } + + public void setOutType(final boolean outType) { + this.outType = outType; + } + + public boolean isReturnType() { + return returnType; + } + + public void setReturnType(final boolean returnType) { + this.returnType = returnType; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalProcedureParameterType.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRelationRowCreator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRelationRowCreator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRelationRowCreator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,327 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBeanContext; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; + +import org.seasar.dao.BeanMetaData; +import org.seasar.dao.RelationPropertyType; +import org.seasar.dao.impl.RelationRowCreationResource; +import org.seasar.dao.impl.RelationRowCreatorImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ValueType; +import org.seasar.framework.beans.PropertyDesc; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalRelationRowCreator extends RelationRowCreatorImpl { + + @Override + protected Object createRelationRow(RelationRowCreationResource res) + throws SQLException { + // - - - - - - - - - - - + // Recursive Call Point! + // - - - - - - - - - - - + if (!res.hasPropertyCacheElement()) { + return null; + } + setupRelationKeyValue(res); + setupRelationAllValue(res); + return res.getRow(); + } + + @Override + protected void setupRelationKeyValue(RelationRowCreationResource res) { + final RelationPropertyType rpt = res.getRelationPropertyType(); + final BeanMetaData bmd = rpt.getBeanMetaData(); + final DBMeta dbmeta = findDBMeta(bmd.getBeanClass(), bmd.getTableName()); + for (int i = 0; i < rpt.getKeySize(); ++i) { + final String columnName = rpt.getMyKey(i) + res.getBaseSuffix(); + + if (!res.containsColumnName(columnName)) { + continue; + } + if (!res.hasRowInstance()) { + final Object row; + if (dbmeta != null) { + row = dbmeta.newEntity(); + } else { + row = newRelationRow(rpt); + } + res.setRow(row); + } + if (!res.containsRelKeyValueIfExists(columnName)) { + continue; + } + final Object value = res.extractRelKeyValue(columnName); + if (value == null) { + continue; + } + + final String yourKey = rpt.getYourKey(i); + final PropertyType pt = bmd.getPropertyTypeByColumnName(yourKey); + final PropertyDesc pd = pt.getPropertyDesc(); + pd.setValue(res.getRow(), value); + continue; + } + } + + protected Object createRelationRowInstance(DBMeta dbmeta) { + if (dbmeta != null) { + return dbmeta.newEntity(); + } + return null; + } + + protected DBMeta findDBMeta(Class<?> rowType, String tableName) { + return InternalRowCreator.findDBMeta(rowType, tableName); + } + + @SuppressWarnings("unchecked") + @Override + protected void setupRelationAllValue(RelationRowCreationResource res) + throws SQLException { + final Map propertyCacheElement = res.extractPropertyCacheElement(); + final Set columnNameCacheElementKeySet = propertyCacheElement.keySet(); + for (final Iterator ite = columnNameCacheElementKeySet.iterator(); ite + .hasNext();) { + final String columnName = (String) ite.next(); + final PropertyType pt = (PropertyType) propertyCacheElement + .get(columnName); + res.setCurrentPropertyType(pt); + if (!isValidRelationPerPropertyLoop(res)) { + res.clearRowInstance(); + return; + } + setupRelationProperty(res); + } + if (!isValidRelationAfterPropertyLoop(res)) { + res.clearRowInstance(); + return; + } + res.clearValidValueCount(); + if (res.hasNextRelationProperty() + && (hasConditionBean(res) || res.hasNextRelationLevel())) { + setupNextRelationRow(res); + } + } + + @Override + protected void registerRelationValue(RelationRowCreationResource res, + String columnName) throws SQLException { + final PropertyType pt = res.getCurrentPropertyType(); + Object value = null; + if (res.containsRelKeyValueIfExists(columnName)) { + value = res.extractRelKeyValue(columnName); + } else { + final ValueType valueType = pt.getValueType(); + value = valueType.getValue(res.getResultSet(), columnName); + } + + if (value != null) { + res.incrementValidValueCount(); + final DBMeta dbmeta = findDBMeta(res.getRow()); + final String propertyName = pt.getPropertyName(); + if (dbmeta != null + && dbmeta.hasEntityPropertySetupper(propertyName)) { + dbmeta.setupEntityProperty(propertyName, res.getRow(), value); + } else { + final PropertyDesc pd = pt.getPropertyDesc(); + pd.setValue(res.getRow(), value); + } + } + } + + /** + * @param row The instance of row. (NotNull) + * @return The interface of DBMeta. (Nullable: If it's null, it means + * NotFound.) + */ + protected DBMeta findDBMeta(Object row) { + return InternalRowCreator.findDBMeta(row); + } + + @Override + protected void setupPropertyCache(RelationRowCreationResource res) + throws SQLException { + // - - - - - - - - - - - + // Recursive Call Point! + // - - - - - - - - - - - + res.initializePropertyCacheElement(); + + // Do only selected foreign property for performance if condition-bean + // exists. + if (hasConditionBean(res) && !hasSelectedForeignInfo(res)) { + return; + } + + // Set up property cache about current beanMetaData. + final BeanMetaData nextBmd = res.getRelationBeanMetaData(); + for (int i = 0; i < nextBmd.getPropertyTypeSize(); ++i) { + final PropertyType pt = nextBmd.getPropertyType(i); + res.setCurrentPropertyType(pt); + if (!isTargetProperty(res)) { + continue; + } + setupPropertyCacheElement(res); + } + + // Set up next relation. + if (res.hasNextRelationProperty() + && (hasConditionBean(res) || res.hasNextRelationLevel())) { + res.backupRelationPropertyType(); + res.incrementCurrentRelationNestLevel(); + try { + setupNextPropertyCache(res, nextBmd); + } finally { + res.restoreRelationPropertyType(); + res.decrementCurrentRelationNestLevel(); + } + } + } + + @Override + protected boolean isTargetProperty(RelationRowCreationResource res) + throws SQLException { + final PropertyType pt = res.getCurrentPropertyType(); + if (!pt.getPropertyDesc().hasWriteMethod()) { + return false; + } + if (java.util.List.class.isAssignableFrom(pt.getPropertyDesc() + .getPropertyType())) { + return false; + } + return true; + } + + @Override + protected boolean isCreateDeadLink() { + return false; + } + + @Override + protected int getLimitRelationNestLevel() { + return 2;// for Compatible + } + + @SuppressWarnings("unchecked") + @Override + protected RelationRowCreationResource createResourceForRow(ResultSet rs, + RelationPropertyType rpt, Set columnNames, Map relKeyValues, + Map relationPropertyCache) throws SQLException { + final RelationRowCreationResource res = new RelationRowCreationResourceExtension(); + res.setResultSet(rs); + res.setRelationPropertyType(rpt); + res.setColumnNames(columnNames); + res.setRelKeyValues(relKeyValues); + res.setRelationPropertyCache(relationPropertyCache); + res.setBaseSuffix("");// as Default + res.setRelationNoSuffix(buildRelationNoSuffix(rpt)); + res.setLimitRelationNestLevel(getLimitRelationNestLevel()); + res.setCurrentRelationNestLevel(1);// as Default + res.setCreateDeadLink(isCreateDeadLink()); + return res; + } + + @SuppressWarnings("unchecked") + @Override + protected RelationRowCreationResource createResourceForPropertyCache( + RelationPropertyType rpt, Set columnNames, + Map relationPropertyCache, String baseSuffix, + String relationNoSuffix, int limitRelationNestLevel) + throws SQLException { + final RelationRowCreationResource res = new RelationRowCreationResourceExtension(); + res.setRelationPropertyType(rpt); + res.setColumnNames(columnNames); + res.setRelationPropertyCache(relationPropertyCache); + res.setBaseSuffix(baseSuffix); + res.setRelationNoSuffix(relationNoSuffix); + res.setLimitRelationNestLevel(limitRelationNestLevel); + res.setCurrentRelationNestLevel(1);// as Default + return res; + } + + protected boolean isConditionBeanSelectedRelation( + RelationRowCreationResource res) { + if (hasConditionBean(res)) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + if (cb.getSqlClause().hasSelectedForeignInfo( + res.getRelationNoSuffix())) { + return true; + } + } + return false; + } + + protected boolean hasConditionBean(RelationRowCreationResource res) { + return ConditionBeanContext.isExistConditionBeanOnThread(); + } + + protected boolean hasSelectedForeignInfo(RelationRowCreationResource res) { + final ConditionBean cb = ConditionBeanContext + .getConditionBeanOnThread(); + if (cb.getSqlClause().hasSelectedForeignInfo(res.getRelationNoSuffix())) { + return true; + } + return false; + } + + protected static class RelationRowCreationResourceExtension extends + RelationRowCreationResource { + protected Stack<RelationPropertyType> backupRelationPropertyType = new Stack<RelationPropertyType>(); + + protected Stack<String> backupBaseSuffix = new Stack<String>(); + + protected Stack<String> backupRelationSuffix = new Stack<String>(); + + @Override + public void backupRelationPropertyType() { + backupRelationPropertyType.push(getRelationPropertyType()); + } + + @Override + public void restoreRelationPropertyType() { + setRelationPropertyType(backupRelationPropertyType.pop()); + } + + @Override + public void backupSuffixAndPrepare(String baseSuffix, + String additionalRelationNoSuffix) { + backupBaseSuffixExtension(); + backupRelationNoSuffixExtension(); + setBaseSuffix(baseSuffix); + addRelationNoSuffix(additionalRelationNoSuffix); + } + + @Override + public void restoreSuffix() { + restoreBaseSuffixExtension(); + restoreRelationNoSuffixExtension(); + } + + protected void backupBaseSuffixExtension() { + backupBaseSuffix.push(getBaseSuffix()); + } + + protected void restoreBaseSuffixExtension() { + setBaseSuffix(backupBaseSuffix.pop()); + } + + protected void backupRelationNoSuffixExtension() { + backupRelationSuffix.push(getRelationNoSuffix()); + } + + protected void restoreRelationNoSuffixExtension() { + setRelationNoSuffix(backupRelationSuffix.pop()); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRelationRowCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRowCreator.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRowCreator.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRowCreator.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,289 @@ +package jp.sf.pal.scheduler.db.allcommon.s2dao.internal.various; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.InternalMapContext; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.allcommon.util.SimpleSystemUtil; + +import org.seasar.dao.impl.RowCreatorImpl; +import org.seasar.extension.jdbc.PropertyType; +import org.seasar.extension.jdbc.ValueType; + +/** + * @author DBFlute(AutoGenerator) + */ +public class InternalRowCreator extends RowCreatorImpl { + + //========================================================================== + // ========= + // Definition + // ========== + /** Log instance. */ + private static final org.apache.commons.logging.Log _log = org.apache.commons.logging.LogFactory + .getLog(InternalRowCreator.class); + + /** The key of DBMeta cache. */ + protected static final String DBMETA_CACHE_KEY = "df:DBMetaCache"; + + //========================================================================== + // ========= + // Attribute + // ========= + protected DBMeta _dbmeta; + + //========================================================================== + // ========= + // Constructor + // =========== + protected InternalRowCreator() { + } + + /** + * @param beanClass The class of target bean to find DB-meta. (Nullable) + * @return The instance of internal row creator. (NotNull) + */ + public static InternalRowCreator createInternalRowCreator(Class<?> beanClass) { + final InternalRowCreator rowCreator = new InternalRowCreator(); + if (beanClass != null) { + rowCreator.setDBMeta(findDBMetaByClass(beanClass)); + } + return rowCreator; + } + + //========================================================================== + // ========= + // Main + // ==== + @SuppressWarnings("unchecked") + @Override + public Object createRow(ResultSet rs, Map propertyCache, Class beanClass) + throws SQLException { + final Set columnNameSet = propertyCache.keySet(); + String columnName = null; + PropertyType pt = null; + String propertyName = null; + final Object row; + final DBMeta dbmeta; + if (_dbmeta != null) { + dbmeta = _dbmeta; + row = dbmeta.newEntity(); + } else { + row = newBean(beanClass); + dbmeta = findDBMeta(row); + } + try { + if (dbmeta != null) { + for (final Iterator ite = columnNameSet.iterator(); ite + .hasNext();) { + columnName = (String) ite.next(); + pt = (PropertyType) propertyCache.get(columnName); + propertyName = pt.getPropertyName(); + if (dbmeta.hasEntityPropertySetupper(propertyName)) { + final ValueType valueType = pt.getValueType(); + final Object value = valueType.getValue(rs, columnName); + dbmeta.setupEntityProperty(propertyName, row, value); + } else { + registerValue(rs, row, pt, columnName); + } + } + } else { + for (final Iterator ite = columnNameSet.iterator(); ite + .hasNext();) { + columnName = (String) ite.next(); + pt = (PropertyType) propertyCache.get(columnName); + propertyName = pt.getPropertyName(); + registerValue(rs, row, pt, columnName); + } + } + return row; + } catch (ClassCastException e) { + if (_log.isWarnEnabled()) { + String msg = ClassCastException.class.getSimpleName() + + " occurred while ResultSet Handling:"; + _log.warn(msg + " target=" + beanClass.getSimpleName() + "." + + propertyName + " dbmeta"); + } + throwNonsenseClassCastException(row, dbmeta, e); + return null; // Unreachable! + } catch (SQLException e) { + if (_log.isWarnEnabled()) { + String msg = SQLException.class.getSimpleName() + + " occurred while ResultSet Handling:"; + _log.warn(msg + " target=" + beanClass.getSimpleName() + "." + + propertyName); + } + throw e; + } + } + + protected void throwNonsenseClassCastException(Object entity, + DBMeta dbmeta, ClassCastException e) { + String msg = "Look! Read the message below." + getLineSeparator(); + msg = msg + + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *" + + getLineSeparator(); + msg = msg + "Nonsense ClassCastException occured!" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Advice]" + getLineSeparator(); + msg = msg + + "This exception may be from ClassLoader Headache about HotDeploy." + + getLineSeparator(); + msg = msg + + "Please add the ignore-package setting to convention.dicon like as follows:" + + getLineSeparator(); + msg = msg + " For example:" + getLineSeparator(); + msg = msg + " <initMethod name=”addIgnorePackageName”>" + + getLineSeparator(); + msg = msg + " <arg>”com.example.xxx.dbflute”</arg>" + + getLineSeparator(); + msg = msg + " </initMethod>" + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Exception Message]" + getLineSeparator() + e.getMessage() + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target Entity]" + getLineSeparator() + entity + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target Entity Class Loader]" + getLineSeparator() + + entity.getClass().getClassLoader() + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target DBMeta]" + getLineSeparator() + dbmeta + + getLineSeparator(); + msg = msg + getLineSeparator(); + msg = msg + "[Target DBMeta Class Loader]" + getLineSeparator() + + dbmeta.getClass().getClassLoader() + getLineSeparator(); + msg = msg + "* * * * * * * * * */"; + throw new NonsenseClassCastException(msg, e); + } + + public static class NonsenseClassCastException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public NonsenseClassCastException(String msg, ClassCastException e) { + super(msg, e); + } + } + + //========================================================================== + // ========= + // Assist Helper + // ============= + /** + * @param row The instance of row. (NotNull) + * @return The interface of DBMeta. (Nullable: If it's null, it means + * NotFound.) + */ + public static DBMeta findDBMeta(Object row) { + return DBMetaCacheHandler.findDBMeta(row); + } + + /** + * @param rowType The type of row. (NotNull) + * @param tableName The name of table. (NotNull) + * @return The interface of DBMeta. (Nullable: If it's null, it means + * NotFound.) + */ + public static DBMeta findDBMeta(Class<?> rowType, String tableName) { + return DBMetaCacheHandler.findDBMeta(rowType, tableName); + } + + protected static class DBMetaCacheHandler { + + /** The key of DBMeta cache. */ + protected static final String DBMETA_CACHE_KEY = "df:DBMetaCache"; + + public static DBMeta findDBMeta(Object row) { + if (!(row instanceof Entity)) { + return null; + } + final Entity entity = (Entity) row; + DBMeta dbmeta = findCachedDBMeta(entity.getClass()); + if (dbmeta != null) { + return dbmeta; + } + dbmeta = entity.getDBMeta(); + cacheDBMeta(entity, dbmeta); + return dbmeta; + } + + public static DBMeta findDBMeta(Class<?> rowType, String tableName) { + DBMeta dbmeta = findCachedDBMeta(rowType); + if (dbmeta != null) { + return dbmeta; + } + try { + dbmeta = DBMetaInstanceHandler.findDBMeta(tableName); + } catch (DBMetaInstanceHandler.DBMetaNotFoundException ignored) { + return null; + } + cacheDBMeta(rowType, dbmeta); + return dbmeta; + } + + protected static DBMeta findCachedDBMeta(Class<?> rowType) { + Map<Class<?>, DBMeta> dbmetaCache = findDBMetaCache(); + if (dbmetaCache == null) { + dbmetaCache = new HashMap<Class<?>, DBMeta>(); + InternalMapContext.setObject(DBMETA_CACHE_KEY, dbmetaCache); + } + return dbmetaCache.get(rowType); + } + + protected static void cacheDBMeta(Entity entity, DBMeta dbmeta) { + cacheDBMeta(entity.getClass(), dbmeta); + } + + protected static void cacheDBMeta(Class<?> type, DBMeta dbmeta) { + final Map<Class<?>, DBMeta> dbmetaCache = findDBMetaCache(); + dbmetaCache.put(type, dbmeta); + } + + @SuppressWarnings("unchecked") + protected static Map<Class<?>, DBMeta> findDBMetaCache() { + return (Map<Class<?>, DBMeta>) InternalMapContext + .getObject(DBMETA_CACHE_KEY); + } + } + + protected static DBMeta findDBMetaByClass(Class<?> beanClass) { + final Object instance = newInstance(beanClass); + if (!(instance instanceof Entity)) { + return null; + } + return ((Entity) instance).getDBMeta(); + } + + protected static Object newInstance(Class<?> clazz) { + try { + return clazz.newInstance(); + } catch (InstantiationException e) { + throw new IllegalStateException(e); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + } + + //========================================================================== + // ========= + // General Helper + // ============== + protected String getLineSeparator() { + return SimpleSystemUtil.getLineSeparator(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + public void setDBMeta(DBMeta dbmeta) { + this._dbmeta = dbmeta; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/s2dao/internal/various/InternalRowCreator.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleAssertUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleAssertUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleAssertUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,54 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleAssertUtil { + + //========================================================================== + // ========= + // Assert + // ====== + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * Assert that the object is not null. + * + * @param variableName Variable name. (NotNull) + * @param value Value. (NotNull) + * @exception IllegalArgumentException + */ + public 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) + */ + public static 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); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleAssertUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleStringUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleStringUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleStringUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,67 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleStringUtil { + + //========================================================================== + // ========= + // String + // ====== + public 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); + } + + public static String initCap(String str) { + assertObjectNotNull("str", str); + return str.substring(0, 1).toUpperCase() + str.substring(1); + } + + public static String initUncap(String str) { + assertObjectNotNull("str", str); + return str.substring(0, 1).toLowerCase() + str.substring(1); + } + + // ----------------------------------------------------- + // Assert Object + // ------------- + /** + * 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: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleStringUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleSystemUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleSystemUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleSystemUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class SimpleSystemUtil { + + //========================================================================== + // ========= + // System + // ====== + public static String getLineSeparator() { + // /- - - - - - - - - - - - - - - - - - - - - - + // Because 'CR + LF' caused many trouble! + // And Now 'LF' have little trouble. + // + // return System.getProperty("line.separator"); + // - - - - - - - - - -/ + return "\n"; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/SimpleSystemUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/TraceViewUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/TraceViewUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/TraceViewUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,67 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +/** + * @author DBFlute(AutoGenerator) + */ +public class TraceViewUtil { + + /** + * Convert to performance view. + * + * @param afterMinusBefore The value of after-minus-before millisecond. + * @return Performance view. (ex. 1m23s456ms) (NotNull) + */ + public static String convertToPerformanceView(long afterMinusBefore) { + if (afterMinusBefore < 0) { + return String.valueOf(afterMinusBefore); + } + + long sec = afterMinusBefore / 1000; + final long min = sec / 60; + sec = sec % 60; + final long mil = afterMinusBefore % 1000; + + final StringBuffer sb = new StringBuffer(); + if (min >= 10) { // Minute + sb.append(min).append("m"); + } else if (min < 10 && min >= 0) { + sb.append("0").append(min).append("m"); + } + if (sec >= 10) { // Second + sb.append(sec).append("s"); + } else if (sec < 10 && sec >= 0) { + sb.append("0").append(sec).append("s"); + } + if (mil >= 100) { // Millisecond + sb.append(mil).append("ms"); + } else if (mil < 100 && mil >= 10) { + sb.append("0").append(mil).append("ms"); + } else if (mil < 10 && mil >= 0) { + sb.append("00").append(mil).append("ms"); + } + + return sb.toString(); + } + + /** + * Convert object array to string view. + * + * @param objArray The array of object. (Nullable) + * @return The string divided with comma. (NotNull: If the argument is null, + * returns empty string.) + */ + public static String convertObjectArrayToStringView(Object[] objArray) { + if (objArray == null) { + return ""; + } + final StringBuffer sb = new StringBuffer(); + for (int i = 0; i < objArray.length; i++) { + if (i == 0) { + sb.append(objArray[i]); + } else { + sb.append(", ").append(objArray[i]); + } + } + return sb.toString(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/TraceViewUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/ValueLabelUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/ValueLabelUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/ValueLabelUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,65 @@ +package jp.sf.pal.scheduler.db.allcommon.util; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * @author DBFlute(AutoGenerator) + */ +public class ValueLabelUtil { + + /** + * Find the label by the value from the list of value label. + * + * @param valueLabelList The list of value label. (NotNull and NotEmpty) + * @param value Value. (NotNull) + * @return Label. (NotNull) + */ + public static String findLabel(List<Map<String, Object>> valueLabelList, + Object value) { + if (valueLabelList == null) { + String msg = "The arguement[valueLabelList] should not be null."; + throw new IllegalArgumentException(msg); + } + if (valueLabelList.isEmpty()) { + String msg = "The arguement[valueLabelList] should not be empty."; + throw new IllegalArgumentException(msg); + } + if (value == null) { + String msg = "The arguement[value] should not be null."; + throw new IllegalArgumentException(msg); + } + for (Map<String, Object> elementMap : valueLabelList) { + final Object currentValue = elementMap.get("value"); + if (value.equals(currentValue)) { + return (String) elementMap.get("label"); + } + } + String msg = "Not found label by the value: value=" + value + + " valueLabelList=" + valueLabelList; + throw new IllegalStateException(msg); + } + + public static Map<Object, String> createValueLabelMap( + List<Map<String, Object>> valueLabelList) { + final Map<Object, String> resultMap = new LinkedHashMap<Object, String>(); + for (Map<String, Object> elementMap : valueLabelList) { + final Object currentValue = elementMap.get("value"); + final String currentLabel = (String) elementMap.get("label"); + resultMap.put(currentValue, currentLabel); + } + return resultMap; + } + + public static Map<String, Object> createLabelValueMap( + List<Map<String, Object>> valueLabelList) { + final Map<String, Object> resultMap = new LinkedHashMap<String, Object>(); + for (Map<String, Object> elementMap : valueLabelList) { + final Object currentValue = elementMap.get("value"); + final String currentLabel = (String) elementMap.get("label"); + resultMap.put(currentLabel, currentValue); + } + return resultMap; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/allcommon/util/ValueLabelUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupInfoBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupInfoBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupInfoBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,897 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.GroupInfoDbm; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.exbhv.GroupMappingBhv; +import jp.sf.pal.scheduler.db.exbhv.UserInfoBhv; +import jp.sf.pal.scheduler.db.exdao.GroupInfoDao; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of GROUP_INFO. + * + * <pre> + * [primary-key] + * GROUP_ID + * + * [column] + * GROUP_ID, NAME, DESCRIPTION, EMAIL, URL, TELEPHONE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * GROUP_MAPPING, USER_INFO + * + * [foreign-property] + * + * + * [referrer-property] + * groupMappingList, userInfoList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsGroupInfoBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected GroupInfoDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "GROUP_INFO"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return GroupInfoDbm.getInstance(); + } + + /** @return The meta data of the database 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() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public GroupInfo newMyEntity() { + return new GroupInfo(); + } + + public GroupInfoCB newMyConditionBean() { + return new GroupInfoCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of GroupInfo. (NotNull) + * @return The selected count. + */ + public int selectCount(GroupInfoCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of GroupInfo. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public GroupInfo selectEntity(final GroupInfoCB cb) { + return helpSelectEntityInternally(cb, + new InternalSelectEntityCallback<GroupInfo, GroupInfoCB>() { + public List<GroupInfo> callbackSelectList(GroupInfoCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of GroupInfo. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public GroupInfo selectEntityWithDeletedCheck(final GroupInfoCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<GroupInfo, GroupInfoCB>() { + public List<GroupInfo> callbackSelectList(GroupInfoCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public GroupInfo selectByPKValueWithDeletedCheck(String groupId) { + GroupInfo entity = new GroupInfo(); + entity.setGroupId(groupId); + final GroupInfoCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of GroupInfo. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<GroupInfo> selectList(GroupInfoCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<GroupInfo>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of GroupInfo. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<GroupInfo> selectPage(final GroupInfoCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<GroupInfo> invoker = new PagingInvoker<GroupInfo>( + getTableDbName()); + final PagingHandler<GroupInfo> handler = new PagingHandler<GroupInfo>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<GroupInfo> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of GroupInfo. (NotNull) + * @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) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + /** + * Load referrer of groupMappingList with the setupper for condition-bean of + * referrer. <br /> About internal policy, the value of primary key(and + * others too) is treated as case-insensitive. <br /> The condition-bean + * that the setupper provides have settings before you touch it. It is as + * follows: + * + * <pre> + * cb.query().setGroupId_InScope(pkList); + * cb.query().addOrderBy_GroupId_Asc(); + * </pre> + * + * @param groupInfoList The entity list of groupInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadGroupMappingList(List<GroupInfo> groupInfoList, + ConditionBeanSetupper<GroupMappingCB> conditionBeanSetupper) { + assertObjectNotNull("groupInfoList<GroupInfo>", groupInfoList); + assertObjectNotNull("conditionBeanSetupper<GroupMappingCB>", + conditionBeanSetupper); + if (groupInfoList.isEmpty()) { + return; + } + loadGroupMappingList(groupInfoList, + new LoadReferrerOption<GroupMappingCB, GroupMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param groupInfoList The entity list of groupInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadGroupMappingList(List<GroupInfo> groupInfoList, + LoadReferrerOption<GroupMappingCB, GroupMapping> loadReferrerOption) { + assertObjectNotNull("groupInfoList<GroupInfo>", groupInfoList); + assertObjectNotNull("loadReferrerOption<GroupMapping, GroupMappingCB>", + loadReferrerOption); + if (groupInfoList.isEmpty()) { + return; + } + final GroupMappingBhv referrerBhv = xgetBSFLR().select( + GroupMappingBhv.class); + helpLoadReferrerInternally( + groupInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<GroupInfo, String, GroupMappingCB, GroupMapping>() { + public String callbackBase_getPrimaryKeyValue( + GroupInfo entity) { + return entity.getGroupId(); + } + + public void callbackBase_setReferrerList(GroupInfo entity, + List<GroupMapping> referrerList) { + entity.setGroupMappingList(referrerList); + } + + public GroupMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + GroupMappingCB cb, List<String> pkList) { + cb.query().setGroupId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + GroupMappingCB cb) { + cb.query().addOrderBy_GroupId_Asc(); + } + + public List<GroupMapping> callbackReferrer_selectList( + GroupMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + GroupMapping entity) { + return entity.getGroupId(); + } + + public void callbackReferrer_setForeignEntity( + GroupMapping referrerEntity, GroupInfo baseEntity) { + referrerEntity.setGroupInfo(baseEntity); + } + }); + } + + /** + * Load referrer of userInfoList with the setupper for condition-bean of + * referrer. <br /> About internal policy, the value of primary key(and + * others too) is treated as case-insensitive. <br /> The condition-bean + * that the setupper provides have settings before you touch it. It is as + * follows: + * + * <pre> + * cb.query().setGroupId_InScope(pkList); + * cb.query().addOrderBy_GroupId_Asc(); + * </pre> + * + * @param groupInfoList The entity list of groupInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadUserInfoList(List<GroupInfo> groupInfoList, + ConditionBeanSetupper<UserInfoCB> conditionBeanSetupper) { + assertObjectNotNull("groupInfoList<GroupInfo>", groupInfoList); + assertObjectNotNull("conditionBeanSetupper<UserInfoCB>", + conditionBeanSetupper); + if (groupInfoList.isEmpty()) { + return; + } + loadUserInfoList(groupInfoList, + new LoadReferrerOption<UserInfoCB, UserInfo>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param groupInfoList The entity list of groupInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadUserInfoList(List<GroupInfo> groupInfoList, + LoadReferrerOption<UserInfoCB, UserInfo> loadReferrerOption) { + assertObjectNotNull("groupInfoList<GroupInfo>", groupInfoList); + assertObjectNotNull("loadReferrerOption<UserInfo, UserInfoCB>", + loadReferrerOption); + if (groupInfoList.isEmpty()) { + return; + } + final UserInfoBhv referrerBhv = xgetBSFLR().select(UserInfoBhv.class); + helpLoadReferrerInternally( + groupInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<GroupInfo, String, UserInfoCB, UserInfo>() { + public String callbackBase_getPrimaryKeyValue( + GroupInfo entity) { + return entity.getGroupId(); + } + + public void callbackBase_setReferrerList(GroupInfo entity, + List<UserInfo> referrerList) { + entity.setUserInfoList(referrerList); + } + + public UserInfoCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + UserInfoCB cb, List<String> pkList) { + cb.query().setGroupId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + UserInfoCB cb) { + cb.query().addOrderBy_GroupId_Asc(); + } + + public List<UserInfo> callbackReferrer_selectList( + UserInfoCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + UserInfo entity) { + return entity.getGroupId(); + } + + public void callbackReferrer_setForeignEntity( + UserInfo referrerEntity, GroupInfo baseEntity) { + referrerEntity.setGroupInfo(baseEntity); + } + }); + } + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param groupInfo The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(GroupInfo groupInfo) { + assertEntityNotNull(groupInfo); + delegateInsert(groupInfo); + } + + @Override + protected void doCreate(Entity groupInfo) { + insert((GroupInfo) groupInfo); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param groupInfo The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final GroupInfo groupInfo) { + helpUpdateInternally(groupInfo, + new InternalUpdateCallback<GroupInfo>() { + public int callbackDelegateUpdate(GroupInfo entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((GroupInfo) entity); + } + + /** + * Update the entity non-strictly modified-only. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param groupInfo The entity of update target. (NotNull) + * {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void updateNonstrict(final GroupInfo groupInfo) { + helpUpdateNonstrictInternally(groupInfo, + new InternalUpdateNonstrictCallback<GroupInfo>() { + public int callbackDelegateUpdateNonstrict(GroupInfo entity) { + return delegateUpdateNonstrict(entity); + } + }); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + updateNonstrict((GroupInfo) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param groupInfo The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final GroupInfo groupInfo) { + helpInsertOrUpdateInternally(groupInfo, + new InternalInsertOrUpdateCallback<GroupInfo, GroupInfoCB>() { + public void callbackInsert(GroupInfo entity) { + insert(entity); + } + + public void callbackUpdate(GroupInfo entity) { + update(entity); + } + + public GroupInfoCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(GroupInfoCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity groupInfo) { + insertOrUpdate((GroupInfo) groupInfo); + } + + /** + * Insert or update the entity non-strictly modified-only. + * {NonConcurrencyControl(when update)} + * + * @param groupInfo The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdateNonstrict(GroupInfo groupInfo) { + helpInsertOrUpdateInternally(groupInfo, + new InternalInsertOrUpdateNonstrictCallback<GroupInfo>() { + public void callbackInsert(GroupInfo entity) { + insert(entity); + } + + public void callbackUpdateNonstrict(GroupInfo entity) { + updateNonstrict(entity); + } + }); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdateNonstrict((GroupInfo) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param groupInfo The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(GroupInfo groupInfo) { + helpDeleteInternally(groupInfo, + new InternalDeleteCallback<GroupInfo>() { + public int callbackDelegateDelete(GroupInfo entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity groupInfo) { + delete((GroupInfo) groupInfo); + } + + /** + * Delete the entity non-strictly. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param groupInfo Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrict(GroupInfo groupInfo) { + helpDeleteNonstrictInternally(groupInfo, + new InternalDeleteNonstrictCallback<GroupInfo>() { + public int callbackDelegateDeleteNonstrict(GroupInfo entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + /** + * Delete the entity non-strictly ignoring deleted. + * {UpdateCountZeroException, NonConcurrencyControl} + * + * @param groupInfo Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrictIgnoreDeleted(GroupInfo groupInfo) { + helpDeleteNonstrictIgnoreDeletedInternally(groupInfo, + new InternalDeleteNonstrictIgnoreDeletedCallback<GroupInfo>() { + public int callbackDelegateDeleteNonstrict(GroupInfo entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param groupInfoList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<GroupInfo> groupInfoList) { + assertObjectNotNull("groupInfoList", groupInfoList); + return delegateInsertList(groupInfoList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param groupInfoList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchUpdate(List<GroupInfo> groupInfoList) { + assertObjectNotNull("groupInfoList", groupInfoList); + return delegateUpdateList(groupInfoList); + } + + /** + * Batch update the list non-strictly. All columns are update target. {NOT + * modified only} <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param groupInfoList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdateNonstrict(List<GroupInfo> groupInfoList) { + assertObjectNotNull("groupInfoList", groupInfoList); + return delegateUpdateListNonstrict(groupInfoList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param groupInfoList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchDelete(List<GroupInfo> groupInfoList) { + assertObjectNotNull("groupInfoList", groupInfoList); + return delegateDeleteList(groupInfoList); + } + + /** + * Batch delete the list non-strictly. <br /> This method use 'Batch Update' + * of java.sql.PreparedStatement. + * + * @param groupInfoList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDeleteNonstrict(List<GroupInfo> groupInfoList) { + assertObjectNotNull("groupInfoList", groupInfoList); + return delegateDeleteListNonstrict(groupInfoList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param groupInfo Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(GroupInfo groupInfo, GroupInfoCB cb) { + assertObjectNotNull("groupInfo", groupInfo); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(groupInfo); + filterEntityOfUpdate(groupInfo); + assertEntityOfUpdate(groupInfo); + return getMyDao().updateByQuery(cb, groupInfo); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(GroupInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(GroupInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<GroupInfo> delegateSelectList(GroupInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(GroupInfo e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(GroupInfo e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateUpdateNonstrict(GroupInfo e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateNonstrictModifiedOnly(e); + } + + protected int delegateDelete(GroupInfo e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int delegateDeleteNonstrict(GroupInfo e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().deleteNonstrict(e); + } + + protected int[] delegateInsertList(List<GroupInfo> ls) { + assertObjectNotNull("groupInfoList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<GroupInfo> ls) { + assertObjectNotNull("groupInfoList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateUpdateListNonstrict(List<GroupInfo> ls) { + assertObjectNotNull("groupInfoList", ls); + return getMyDao().updateListNonstrict( + helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<GroupInfo> ls) { + assertObjectNotNull("groupInfoList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + protected int[] delegateDeleteListNonstrict(List<GroupInfo> ls) { + assertObjectNotNull("groupInfoList", ls); + return getMyDao().deleteListNonstrict( + helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return !(downcast(entity).getVersionno() + "").equals("null");// For + // primitive + // type + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected GroupInfo downcast(Entity entity) { + return helpDowncastInternally(entity, GroupInfo.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupInfoBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,602 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.GroupMappingDbm; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.exdao.GroupMappingDao; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of GROUP_MAPPING. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, USER_ID, GROUP_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * GROUP_INFO, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * groupInfo, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsGroupMappingBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected GroupMappingDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "GROUP_MAPPING"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return GroupMappingDbm.getInstance(); + } + + /** @return The meta data of the database 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() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public GroupMapping newMyEntity() { + return new GroupMapping(); + } + + public GroupMappingCB newMyConditionBean() { + return new GroupMappingCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of GroupMapping. (NotNull) + * @return The selected count. + */ + public int selectCount(GroupMappingCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of GroupMapping. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public GroupMapping selectEntity(final GroupMappingCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<GroupMapping, GroupMappingCB>() { + public List<GroupMapping> callbackSelectList( + GroupMappingCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of GroupMapping. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public GroupMapping selectEntityWithDeletedCheck(final GroupMappingCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<GroupMapping, GroupMappingCB>() { + public List<GroupMapping> callbackSelectList( + GroupMappingCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public GroupMapping selectByPKValueWithDeletedCheck(Integer id) { + GroupMapping entity = new GroupMapping(); + entity.setId(id); + final GroupMappingCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of GroupMapping. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<GroupMapping> selectList(GroupMappingCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<GroupMapping>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of GroupMapping. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<GroupMapping> selectPage(final GroupMappingCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<GroupMapping> invoker = new PagingInvoker<GroupMapping>( + getTableDbName()); + final PagingHandler<GroupMapping> handler = new PagingHandler<GroupMapping>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<GroupMapping> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of GroupMapping. (NotNull) + * @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, + ValueLabelSetupper<GroupMapping> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'GroupInfo'. + * + * @param groupMappingList The list of groupMapping. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<GroupInfo> pulloutGroupInfo(List<GroupMapping> groupMappingList) { + return helpPulloutInternally(groupMappingList, + new InternalPulloutCallback<GroupMapping, GroupInfo>() { + public GroupInfo callbackGetForeignEntity( + GroupMapping entity) { + return entity.getGroupInfo(); + } + }); + } + + /** + * Pull out the list of foreign table 'UserInfo'. + * + * @param groupMappingList The list of groupMapping. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<UserInfo> pulloutUserInfo(List<GroupMapping> groupMappingList) { + return helpPulloutInternally(groupMappingList, + new InternalPulloutCallback<GroupMapping, UserInfo>() { + public UserInfo callbackGetForeignEntity(GroupMapping entity) { + return entity.getUserInfo(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param groupMapping The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(GroupMapping groupMapping) { + assertEntityNotNull(groupMapping); + delegateInsert(groupMapping); + } + + @Override + protected void doCreate(Entity groupMapping) { + insert((GroupMapping) groupMapping); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param groupMapping The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final GroupMapping groupMapping) { + helpUpdateInternally(groupMapping, + new InternalUpdateCallback<GroupMapping>() { + public int callbackDelegateUpdate(GroupMapping entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((GroupMapping) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((GroupMapping) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param groupMapping The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final GroupMapping groupMapping) { + helpInsertOrUpdateInternally( + groupMapping, + new InternalInsertOrUpdateCallback<GroupMapping, GroupMappingCB>() { + public void callbackInsert(GroupMapping entity) { + insert(entity); + } + + public void callbackUpdate(GroupMapping entity) { + update(entity); + } + + public GroupMappingCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(GroupMappingCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity groupMapping) { + insertOrUpdate((GroupMapping) groupMapping); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((GroupMapping) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param groupMapping The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(GroupMapping groupMapping) { + helpDeleteInternally(groupMapping, + new InternalDeleteCallback<GroupMapping>() { + public int callbackDelegateDelete(GroupMapping entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity groupMapping) { + delete((GroupMapping) groupMapping); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param groupMappingList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<GroupMapping> groupMappingList) { + assertObjectNotNull("groupMappingList", groupMappingList); + return delegateInsertList(groupMappingList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param groupMappingList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate(List<GroupMapping> groupMappingList) { + assertObjectNotNull("groupMappingList", groupMappingList); + return delegateUpdateList(groupMappingList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param groupMappingList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete(List<GroupMapping> groupMappingList) { + assertObjectNotNull("groupMappingList", groupMappingList); + return delegateDeleteList(groupMappingList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param groupMapping Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(GroupMapping groupMapping, GroupMappingCB cb) { + assertObjectNotNull("groupMapping", groupMapping); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(groupMapping); + filterEntityOfUpdate(groupMapping); + assertEntityOfUpdate(groupMapping); + return getMyDao().updateByQuery(cb, groupMapping); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(GroupMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(GroupMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<GroupMapping> delegateSelectList(GroupMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(GroupMapping e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(GroupMapping e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(GroupMapping e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List<GroupMapping> ls) { + assertObjectNotNull("groupMappingList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<GroupMapping> ls) { + assertObjectNotNull("groupMappingList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<GroupMapping> ls) { + assertObjectNotNull("groupMappingList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected GroupMapping downcast(Entity entity) { + return helpDowncastInternally(entity, GroupMapping.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsGroupMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleInfoBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleInfoBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleInfoBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,895 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.RoleInfoDbm; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.exbhv.RoleMappingBhv; +import jp.sf.pal.scheduler.db.exbhv.UserInfoBhv; +import jp.sf.pal.scheduler.db.exdao.RoleInfoDao; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of ROLE_INFO. + * + * <pre> + * [primary-key] + * ROLE_ID + * + * [column] + * ROLE_ID, NAME, DESCRIPTION, EMAIL, URL, TELEPHONE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * ROLE_MAPPING, USER_INFO + * + * [foreign-property] + * + * + * [referrer-property] + * roleMappingList, userInfoList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsRoleInfoBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoleInfoDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ROLE_INFO"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return RoleInfoDbm.getInstance(); + } + + /** @return The meta data of the database 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() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public RoleInfo newMyEntity() { + return new RoleInfo(); + } + + public RoleInfoCB newMyConditionBean() { + return new RoleInfoCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of RoleInfo. (NotNull) + * @return The selected count. + */ + public int selectCount(RoleInfoCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of RoleInfo. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoleInfo selectEntity(final RoleInfoCB cb) { + return helpSelectEntityInternally(cb, + new InternalSelectEntityCallback<RoleInfo, RoleInfoCB>() { + public List<RoleInfo> callbackSelectList(RoleInfoCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of RoleInfo. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoleInfo selectEntityWithDeletedCheck(final RoleInfoCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<RoleInfo, RoleInfoCB>() { + public List<RoleInfo> callbackSelectList(RoleInfoCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public RoleInfo selectByPKValueWithDeletedCheck(String roleId) { + RoleInfo entity = new RoleInfo(); + entity.setRoleId(roleId); + final RoleInfoCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of RoleInfo. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<RoleInfo> selectList(RoleInfoCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<RoleInfo>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of RoleInfo. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<RoleInfo> selectPage(final RoleInfoCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<RoleInfo> invoker = new PagingInvoker<RoleInfo>( + getTableDbName()); + final PagingHandler<RoleInfo> handler = new PagingHandler<RoleInfo>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<RoleInfo> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of RoleInfo. (NotNull) + * @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) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + /** + * Load referrer of roleMappingList with the setupper for condition-bean of + * referrer. <br /> About internal policy, the value of primary key(and + * others too) is treated as case-insensitive. <br /> The condition-bean + * that the setupper provides have settings before you touch it. It is as + * follows: + * + * <pre> + * cb.query().setRoleId_InScope(pkList); + * cb.query().addOrderBy_RoleId_Asc(); + * </pre> + * + * @param roleInfoList The entity list of roleInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadRoleMappingList(List<RoleInfo> roleInfoList, + ConditionBeanSetupper<RoleMappingCB> conditionBeanSetupper) { + assertObjectNotNull("roleInfoList<RoleInfo>", roleInfoList); + assertObjectNotNull("conditionBeanSetupper<RoleMappingCB>", + conditionBeanSetupper); + if (roleInfoList.isEmpty()) { + return; + } + loadRoleMappingList(roleInfoList, + new LoadReferrerOption<RoleMappingCB, RoleMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param roleInfoList The entity list of roleInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadRoleMappingList(List<RoleInfo> roleInfoList, + LoadReferrerOption<RoleMappingCB, RoleMapping> loadReferrerOption) { + assertObjectNotNull("roleInfoList<RoleInfo>", roleInfoList); + assertObjectNotNull("loadReferrerOption<RoleMapping, RoleMappingCB>", + loadReferrerOption); + if (roleInfoList.isEmpty()) { + return; + } + final RoleMappingBhv referrerBhv = xgetBSFLR().select( + RoleMappingBhv.class); + helpLoadReferrerInternally( + roleInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<RoleInfo, String, RoleMappingCB, RoleMapping>() { + public String callbackBase_getPrimaryKeyValue( + RoleInfo entity) { + return entity.getRoleId(); + } + + public void callbackBase_setReferrerList(RoleInfo entity, + List<RoleMapping> referrerList) { + entity.setRoleMappingList(referrerList); + } + + public RoleMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + RoleMappingCB cb, List<String> pkList) { + cb.query().setRoleId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + RoleMappingCB cb) { + cb.query().addOrderBy_RoleId_Asc(); + } + + public List<RoleMapping> callbackReferrer_selectList( + RoleMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + RoleMapping entity) { + return entity.getRoleId(); + } + + public void callbackReferrer_setForeignEntity( + RoleMapping referrerEntity, RoleInfo baseEntity) { + referrerEntity.setRoleInfo(baseEntity); + } + }); + } + + /** + * Load referrer of userInfoList with the setupper for condition-bean of + * referrer. <br /> About internal policy, the value of primary key(and + * others too) is treated as case-insensitive. <br /> The condition-bean + * that the setupper provides have settings before you touch it. It is as + * follows: + * + * <pre> + * cb.query().setRoleId_InScope(pkList); + * cb.query().addOrderBy_RoleId_Asc(); + * </pre> + * + * @param roleInfoList The entity list of roleInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadUserInfoList(List<RoleInfo> roleInfoList, + ConditionBeanSetupper<UserInfoCB> conditionBeanSetupper) { + assertObjectNotNull("roleInfoList<RoleInfo>", roleInfoList); + assertObjectNotNull("conditionBeanSetupper<UserInfoCB>", + conditionBeanSetupper); + if (roleInfoList.isEmpty()) { + return; + } + loadUserInfoList(roleInfoList, + new LoadReferrerOption<UserInfoCB, UserInfo>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param roleInfoList The entity list of roleInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadUserInfoList(List<RoleInfo> roleInfoList, + LoadReferrerOption<UserInfoCB, UserInfo> loadReferrerOption) { + assertObjectNotNull("roleInfoList<RoleInfo>", roleInfoList); + assertObjectNotNull("loadReferrerOption<UserInfo, UserInfoCB>", + loadReferrerOption); + if (roleInfoList.isEmpty()) { + return; + } + final UserInfoBhv referrerBhv = xgetBSFLR().select(UserInfoBhv.class); + helpLoadReferrerInternally( + roleInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<RoleInfo, String, UserInfoCB, UserInfo>() { + public String callbackBase_getPrimaryKeyValue( + RoleInfo entity) { + return entity.getRoleId(); + } + + public void callbackBase_setReferrerList(RoleInfo entity, + List<UserInfo> referrerList) { + entity.setUserInfoList(referrerList); + } + + public UserInfoCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + UserInfoCB cb, List<String> pkList) { + cb.query().setRoleId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + UserInfoCB cb) { + cb.query().addOrderBy_RoleId_Asc(); + } + + public List<UserInfo> callbackReferrer_selectList( + UserInfoCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + UserInfo entity) { + return entity.getRoleId(); + } + + public void callbackReferrer_setForeignEntity( + UserInfo referrerEntity, RoleInfo baseEntity) { + referrerEntity.setRoleInfo(baseEntity); + } + }); + } + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param roleInfo The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(RoleInfo roleInfo) { + assertEntityNotNull(roleInfo); + delegateInsert(roleInfo); + } + + @Override + protected void doCreate(Entity roleInfo) { + insert((RoleInfo) roleInfo); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param roleInfo The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final RoleInfo roleInfo) { + helpUpdateInternally(roleInfo, new InternalUpdateCallback<RoleInfo>() { + public int callbackDelegateUpdate(RoleInfo entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((RoleInfo) entity); + } + + /** + * Update the entity non-strictly modified-only. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param roleInfo The entity of update target. (NotNull) + * {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void updateNonstrict(final RoleInfo roleInfo) { + helpUpdateNonstrictInternally(roleInfo, + new InternalUpdateNonstrictCallback<RoleInfo>() { + public int callbackDelegateUpdateNonstrict(RoleInfo entity) { + return delegateUpdateNonstrict(entity); + } + }); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + updateNonstrict((RoleInfo) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param roleInfo The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final RoleInfo roleInfo) { + helpInsertOrUpdateInternally(roleInfo, + new InternalInsertOrUpdateCallback<RoleInfo, RoleInfoCB>() { + public void callbackInsert(RoleInfo entity) { + insert(entity); + } + + public void callbackUpdate(RoleInfo entity) { + update(entity); + } + + public RoleInfoCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(RoleInfoCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity roleInfo) { + insertOrUpdate((RoleInfo) roleInfo); + } + + /** + * Insert or update the entity non-strictly modified-only. + * {NonConcurrencyControl(when update)} + * + * @param roleInfo The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdateNonstrict(RoleInfo roleInfo) { + helpInsertOrUpdateInternally(roleInfo, + new InternalInsertOrUpdateNonstrictCallback<RoleInfo>() { + public void callbackInsert(RoleInfo entity) { + insert(entity); + } + + public void callbackUpdateNonstrict(RoleInfo entity) { + updateNonstrict(entity); + } + }); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdateNonstrict((RoleInfo) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param roleInfo The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(RoleInfo roleInfo) { + helpDeleteInternally(roleInfo, new InternalDeleteCallback<RoleInfo>() { + public int callbackDelegateDelete(RoleInfo entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity roleInfo) { + delete((RoleInfo) roleInfo); + } + + /** + * Delete the entity non-strictly. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param roleInfo Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrict(RoleInfo roleInfo) { + helpDeleteNonstrictInternally(roleInfo, + new InternalDeleteNonstrictCallback<RoleInfo>() { + public int callbackDelegateDeleteNonstrict(RoleInfo entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + /** + * Delete the entity non-strictly ignoring deleted. + * {UpdateCountZeroException, NonConcurrencyControl} + * + * @param roleInfo Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrictIgnoreDeleted(RoleInfo roleInfo) { + helpDeleteNonstrictIgnoreDeletedInternally(roleInfo, + new InternalDeleteNonstrictIgnoreDeletedCallback<RoleInfo>() { + public int callbackDelegateDeleteNonstrict(RoleInfo entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param roleInfoList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<RoleInfo> roleInfoList) { + assertObjectNotNull("roleInfoList", roleInfoList); + return delegateInsertList(roleInfoList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param roleInfoList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchUpdate(List<RoleInfo> roleInfoList) { + assertObjectNotNull("roleInfoList", roleInfoList); + return delegateUpdateList(roleInfoList); + } + + /** + * Batch update the list non-strictly. All columns are update target. {NOT + * modified only} <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param roleInfoList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdateNonstrict(List<RoleInfo> roleInfoList) { + assertObjectNotNull("roleInfoList", roleInfoList); + return delegateUpdateListNonstrict(roleInfoList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param roleInfoList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchDelete(List<RoleInfo> roleInfoList) { + assertObjectNotNull("roleInfoList", roleInfoList); + return delegateDeleteList(roleInfoList); + } + + /** + * Batch delete the list non-strictly. <br /> This method use 'Batch Update' + * of java.sql.PreparedStatement. + * + * @param roleInfoList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDeleteNonstrict(List<RoleInfo> roleInfoList) { + assertObjectNotNull("roleInfoList", roleInfoList); + return delegateDeleteListNonstrict(roleInfoList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param roleInfo Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(RoleInfo roleInfo, RoleInfoCB cb) { + assertObjectNotNull("roleInfo", roleInfo); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(roleInfo); + filterEntityOfUpdate(roleInfo); + assertEntityOfUpdate(roleInfo); + return getMyDao().updateByQuery(cb, roleInfo); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(RoleInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(RoleInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<RoleInfo> delegateSelectList(RoleInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(RoleInfo e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(RoleInfo e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateUpdateNonstrict(RoleInfo e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateNonstrictModifiedOnly(e); + } + + protected int delegateDelete(RoleInfo e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int delegateDeleteNonstrict(RoleInfo e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().deleteNonstrict(e); + } + + protected int[] delegateInsertList(List<RoleInfo> ls) { + assertObjectNotNull("roleInfoList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<RoleInfo> ls) { + assertObjectNotNull("roleInfoList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateUpdateListNonstrict(List<RoleInfo> ls) { + assertObjectNotNull("roleInfoList", ls); + return getMyDao().updateListNonstrict( + helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<RoleInfo> ls) { + assertObjectNotNull("roleInfoList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + protected int[] delegateDeleteListNonstrict(List<RoleInfo> ls) { + assertObjectNotNull("roleInfoList", ls); + return getMyDao().deleteListNonstrict( + helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return !(downcast(entity).getVersionno() + "").equals("null");// For + // primitive + // type + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected RoleInfo downcast(Entity entity) { + return helpDowncastInternally(entity, RoleInfo.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleInfoBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,597 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.RoleMappingDbm; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.exdao.RoleMappingDao; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of ROLE_MAPPING. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, USER_ID, ROLE_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * ROLE_INFO, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * roleInfo, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsRoleMappingBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoleMappingDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ROLE_MAPPING"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return RoleMappingDbm.getInstance(); + } + + /** @return The meta data of the database 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() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public RoleMapping newMyEntity() { + return new RoleMapping(); + } + + public RoleMappingCB newMyConditionBean() { + return new RoleMappingCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of RoleMapping. (NotNull) + * @return The selected count. + */ + public int selectCount(RoleMappingCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of RoleMapping. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoleMapping selectEntity(final RoleMappingCB cb) { + return helpSelectEntityInternally(cb, + new InternalSelectEntityCallback<RoleMapping, RoleMappingCB>() { + public List<RoleMapping> callbackSelectList(RoleMappingCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of RoleMapping. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoleMapping selectEntityWithDeletedCheck(final RoleMappingCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<RoleMapping, RoleMappingCB>() { + public List<RoleMapping> callbackSelectList(RoleMappingCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public RoleMapping selectByPKValueWithDeletedCheck(Integer id) { + RoleMapping entity = new RoleMapping(); + entity.setId(id); + final RoleMappingCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of RoleMapping. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<RoleMapping> selectList(RoleMappingCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<RoleMapping>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of RoleMapping. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<RoleMapping> selectPage(final RoleMappingCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<RoleMapping> invoker = new PagingInvoker<RoleMapping>( + getTableDbName()); + final PagingHandler<RoleMapping> handler = new PagingHandler<RoleMapping>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<RoleMapping> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of RoleMapping. (NotNull) + * @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) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'RoleInfo'. + * + * @param roleMappingList The list of roleMapping. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<RoleInfo> pulloutRoleInfo(List<RoleMapping> roleMappingList) { + return helpPulloutInternally(roleMappingList, + new InternalPulloutCallback<RoleMapping, RoleInfo>() { + public RoleInfo callbackGetForeignEntity(RoleMapping entity) { + return entity.getRoleInfo(); + } + }); + } + + /** + * Pull out the list of foreign table 'UserInfo'. + * + * @param roleMappingList The list of roleMapping. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<UserInfo> pulloutUserInfo(List<RoleMapping> roleMappingList) { + return helpPulloutInternally(roleMappingList, + new InternalPulloutCallback<RoleMapping, UserInfo>() { + public UserInfo callbackGetForeignEntity(RoleMapping entity) { + return entity.getUserInfo(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param roleMapping The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(RoleMapping roleMapping) { + assertEntityNotNull(roleMapping); + delegateInsert(roleMapping); + } + + @Override + protected void doCreate(Entity roleMapping) { + insert((RoleMapping) roleMapping); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param roleMapping The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final RoleMapping roleMapping) { + helpUpdateInternally(roleMapping, + new InternalUpdateCallback<RoleMapping>() { + public int callbackDelegateUpdate(RoleMapping entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((RoleMapping) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((RoleMapping) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param roleMapping The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final RoleMapping roleMapping) { + helpInsertOrUpdateInternally( + roleMapping, + new InternalInsertOrUpdateCallback<RoleMapping, RoleMappingCB>() { + public void callbackInsert(RoleMapping entity) { + insert(entity); + } + + public void callbackUpdate(RoleMapping entity) { + update(entity); + } + + public RoleMappingCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(RoleMappingCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity roleMapping) { + insertOrUpdate((RoleMapping) roleMapping); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((RoleMapping) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param roleMapping The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(RoleMapping roleMapping) { + helpDeleteInternally(roleMapping, + new InternalDeleteCallback<RoleMapping>() { + public int callbackDelegateDelete(RoleMapping entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity roleMapping) { + delete((RoleMapping) roleMapping); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param roleMappingList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<RoleMapping> roleMappingList) { + assertObjectNotNull("roleMappingList", roleMappingList); + return delegateInsertList(roleMappingList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param roleMappingList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate(List<RoleMapping> roleMappingList) { + assertObjectNotNull("roleMappingList", roleMappingList); + return delegateUpdateList(roleMappingList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param roleMappingList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete(List<RoleMapping> roleMappingList) { + assertObjectNotNull("roleMappingList", roleMappingList); + return delegateDeleteList(roleMappingList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param roleMapping Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(RoleMapping roleMapping, RoleMappingCB cb) { + assertObjectNotNull("roleMapping", roleMapping); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(roleMapping); + filterEntityOfUpdate(roleMapping); + assertEntityOfUpdate(roleMapping); + return getMyDao().updateByQuery(cb, roleMapping); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(RoleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(RoleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<RoleMapping> delegateSelectList(RoleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(RoleMapping e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(RoleMapping e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(RoleMapping e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List<RoleMapping> ls) { + assertObjectNotNull("roleMappingList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<RoleMapping> ls) { + assertObjectNotNull("roleMappingList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<RoleMapping> ls) { + assertObjectNotNull("roleMappingList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected RoleMapping downcast(Entity entity) { + return helpDowncastInternally(entity, RoleMapping.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoleMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,841 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.RoutineScheduleDbm; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.exbhv.RoutineScheduleMappingBhv; +import jp.sf.pal.scheduler.db.exdao.RoutineScheduleDao; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; + +/** + * The behavior of ROUTINE_SCHEDULE. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, TITLE, LOCATION, START_DATE, START_TIME, END_DATE, END_TIME, TYPE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * ROUTINE_SCHEDULE_CONTENT, ROUTINE_SCHEDULE_MAPPING + * + * [foreign-property] + * routineScheduleContentAsOne + * + * [referrer-property] + * routineScheduleMappingList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsRoutineScheduleBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ROUTINE_SCHEDULE"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return RoutineScheduleDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public RoutineScheduleDbm getMyDBMeta() { + return RoutineScheduleDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public RoutineScheduleDao getMyDao() { + return _dao; + } + + public void setMyDao(RoutineScheduleDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public RoutineSchedule newMyEntity() { + return new RoutineSchedule(); + } + + public RoutineScheduleCB newMyConditionBean() { + return new RoutineScheduleCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of RoutineSchedule. (NotNull) + * @return The selected count. + */ + public int selectCount(RoutineScheduleCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of RoutineSchedule. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoutineSchedule selectEntity(final RoutineScheduleCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<RoutineSchedule, RoutineScheduleCB>() { + public List<RoutineSchedule> callbackSelectList( + RoutineScheduleCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of RoutineSchedule. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoutineSchedule selectEntityWithDeletedCheck( + final RoutineScheduleCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<RoutineSchedule, RoutineScheduleCB>() { + public List<RoutineSchedule> callbackSelectList( + RoutineScheduleCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public RoutineSchedule selectByPKValueWithDeletedCheck(Long id) { + RoutineSchedule entity = new RoutineSchedule(); + entity.setId(id); + final RoutineScheduleCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of RoutineSchedule. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<RoutineSchedule> selectList(RoutineScheduleCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<RoutineSchedule>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of RoutineSchedule. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<RoutineSchedule> selectPage( + final RoutineScheduleCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<RoutineSchedule> invoker = new PagingInvoker<RoutineSchedule>( + getTableDbName()); + final PagingHandler<RoutineSchedule> handler = new PagingHandler<RoutineSchedule>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<RoutineSchedule> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of RoutineSchedule. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List<java.util.Map<String, Object>> selectValueLabelList( + RoutineScheduleCB cb, + ValueLabelSetupper<RoutineSchedule> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + /** + * Load referrer of routineScheduleMappingList with the setupper for + * condition-bean of referrer. <br /> About internal policy, the value of + * primary key(and others too) is treated as case-insensitive. <br /> The + * condition-bean that the setupper provides have settings before you touch + * it. It is as follows: + * + * <pre> + * cb.query().setScheduleId_InScope(pkList); + * cb.query().addOrderBy_ScheduleId_Asc(); + * </pre> + * + * @param routineScheduleList The entity list of routineSchedule. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadRoutineScheduleMappingList( + List<RoutineSchedule> routineScheduleList, + ConditionBeanSetupper<RoutineScheduleMappingCB> conditionBeanSetupper) { + assertObjectNotNull("routineScheduleList<RoutineSchedule>", + routineScheduleList); + assertObjectNotNull("conditionBeanSetupper<RoutineScheduleMappingCB>", + conditionBeanSetupper); + if (routineScheduleList.isEmpty()) { + return; + } + loadRoutineScheduleMappingList( + routineScheduleList, + new LoadReferrerOption<RoutineScheduleMappingCB, RoutineScheduleMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param routineScheduleList The entity list of routineSchedule. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadRoutineScheduleMappingList( + List<RoutineSchedule> routineScheduleList, + LoadReferrerOption<RoutineScheduleMappingCB, RoutineScheduleMapping> loadReferrerOption) { + assertObjectNotNull("routineScheduleList<RoutineSchedule>", + routineScheduleList); + assertObjectNotNull( + "loadReferrerOption<RoutineScheduleMapping, RoutineScheduleMappingCB>", + loadReferrerOption); + if (routineScheduleList.isEmpty()) { + return; + } + final RoutineScheduleMappingBhv referrerBhv = xgetBSFLR().select( + RoutineScheduleMappingBhv.class); + helpLoadReferrerInternally( + routineScheduleList, + loadReferrerOption, + new InternalLoadReferrerCallback<RoutineSchedule, Long, RoutineScheduleMappingCB, RoutineScheduleMapping>() { + public Long callbackBase_getPrimaryKeyValue( + RoutineSchedule entity) { + return entity.getId(); + } + + public void callbackBase_setReferrerList( + RoutineSchedule entity, + List<RoutineScheduleMapping> referrerList) { + entity.setRoutineScheduleMappingList(referrerList); + } + + public RoutineScheduleMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + RoutineScheduleMappingCB cb, List<Long> pkList) { + cb.query().setScheduleId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + RoutineScheduleMappingCB cb) { + cb.query().addOrderBy_ScheduleId_Asc(); + } + + public List<RoutineScheduleMapping> callbackReferrer_selectList( + RoutineScheduleMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public Long callbackReferrer_getForeignKeyValue( + RoutineScheduleMapping entity) { + return entity.getScheduleId(); + } + + public void callbackReferrer_setForeignEntity( + RoutineScheduleMapping referrerEntity, + RoutineSchedule baseEntity) { + referrerEntity.setRoutineSchedule(baseEntity); + } + }); + } + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of referrer-as-one table 'RoutineScheduleContent'. + * + * @param routineScheduleList The list of routineSchedule. (NotNull) + * @return The list of referrer-as-one table. (NotNull) + */ + public List<RoutineScheduleContent> pulloutRoutineScheduleContentAsOne( + List<RoutineSchedule> routineScheduleList) { + return helpPulloutInternally( + routineScheduleList, + new InternalPulloutCallback<RoutineSchedule, RoutineScheduleContent>() { + public RoutineScheduleContent callbackGetForeignEntity( + RoutineSchedule entity) { + return entity.getRoutineScheduleContentAsOne(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param routineSchedule The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(RoutineSchedule routineSchedule) { + assertEntityNotNull(routineSchedule); + delegateInsert(routineSchedule); + } + + @Override + protected void doCreate(Entity routineSchedule) { + insert((RoutineSchedule) routineSchedule); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param routineSchedule The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final RoutineSchedule routineSchedule) { + helpUpdateInternally(routineSchedule, + new InternalUpdateCallback<RoutineSchedule>() { + public int callbackDelegateUpdate(RoutineSchedule entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((RoutineSchedule) entity); + } + + /** + * Update the entity non-strictly modified-only. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param routineSchedule The entity of update target. (NotNull) + * {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void updateNonstrict(final RoutineSchedule routineSchedule) { + helpUpdateNonstrictInternally(routineSchedule, + new InternalUpdateNonstrictCallback<RoutineSchedule>() { + public int callbackDelegateUpdateNonstrict( + RoutineSchedule entity) { + return delegateUpdateNonstrict(entity); + } + }); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + updateNonstrict((RoutineSchedule) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param routineSchedule The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final RoutineSchedule routineSchedule) { + helpInsertOrUpdateInternally( + routineSchedule, + new InternalInsertOrUpdateCallback<RoutineSchedule, RoutineScheduleCB>() { + public void callbackInsert(RoutineSchedule entity) { + insert(entity); + } + + public void callbackUpdate(RoutineSchedule entity) { + update(entity); + } + + public RoutineScheduleCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(RoutineScheduleCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity routineSchedule) { + insertOrUpdate((RoutineSchedule) routineSchedule); + } + + /** + * Insert or update the entity non-strictly modified-only. + * {NonConcurrencyControl(when update)} + * + * @param routineSchedule The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdateNonstrict(RoutineSchedule routineSchedule) { + helpInsertOrUpdateInternally(routineSchedule, + new InternalInsertOrUpdateNonstrictCallback<RoutineSchedule>() { + public void callbackInsert(RoutineSchedule entity) { + insert(entity); + } + + public void callbackUpdateNonstrict(RoutineSchedule entity) { + updateNonstrict(entity); + } + }); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdateNonstrict((RoutineSchedule) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param routineSchedule The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(RoutineSchedule routineSchedule) { + helpDeleteInternally(routineSchedule, + new InternalDeleteCallback<RoutineSchedule>() { + public int callbackDelegateDelete(RoutineSchedule entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity routineSchedule) { + delete((RoutineSchedule) routineSchedule); + } + + /** + * Delete the entity non-strictly. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param routineSchedule Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrict(RoutineSchedule routineSchedule) { + helpDeleteNonstrictInternally(routineSchedule, + new InternalDeleteNonstrictCallback<RoutineSchedule>() { + public int callbackDelegateDeleteNonstrict( + RoutineSchedule entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + /** + * Delete the entity non-strictly ignoring deleted. + * {UpdateCountZeroException, NonConcurrencyControl} + * + * @param routineSchedule Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrictIgnoreDeleted(RoutineSchedule routineSchedule) { + helpDeleteNonstrictIgnoreDeletedInternally( + routineSchedule, + new InternalDeleteNonstrictIgnoreDeletedCallback<RoutineSchedule>() { + public int callbackDelegateDeleteNonstrict( + RoutineSchedule entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<RoutineSchedule> routineScheduleList) { + assertObjectNotNull("routineScheduleList", routineScheduleList); + return delegateInsertList(routineScheduleList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param routineScheduleList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchUpdate(List<RoutineSchedule> routineScheduleList) { + assertObjectNotNull("routineScheduleList", routineScheduleList); + return delegateUpdateList(routineScheduleList); + } + + /** + * Batch update the list non-strictly. All columns are update target. {NOT + * modified only} <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdateNonstrict(List<RoutineSchedule> routineScheduleList) { + assertObjectNotNull("routineScheduleList", routineScheduleList); + return delegateUpdateListNonstrict(routineScheduleList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchDelete(List<RoutineSchedule> routineScheduleList) { + assertObjectNotNull("routineScheduleList", routineScheduleList); + return delegateDeleteList(routineScheduleList); + } + + /** + * Batch delete the list non-strictly. <br /> This method use 'Batch Update' + * of java.sql.PreparedStatement. + * + * @param routineScheduleList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDeleteNonstrict(List<RoutineSchedule> routineScheduleList) { + assertObjectNotNull("routineScheduleList", routineScheduleList); + return delegateDeleteListNonstrict(routineScheduleList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param routineSchedule Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(RoutineSchedule routineSchedule, RoutineScheduleCB cb) { + assertObjectNotNull("routineSchedule", routineSchedule); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(routineSchedule); + filterEntityOfUpdate(routineSchedule); + assertEntityOfUpdate(routineSchedule); + return getMyDao().updateByQuery(cb, routineSchedule); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(RoutineScheduleCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(RoutineScheduleCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<RoutineSchedule> delegateSelectList(RoutineScheduleCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(RoutineSchedule e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(RoutineSchedule e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateUpdateNonstrict(RoutineSchedule e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateNonstrictModifiedOnly(e); + } + + protected int delegateDelete(RoutineSchedule e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int delegateDeleteNonstrict(RoutineSchedule e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().deleteNonstrict(e); + } + + protected int[] delegateInsertList(List<RoutineSchedule> ls) { + assertObjectNotNull("routineScheduleList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<RoutineSchedule> ls) { + assertObjectNotNull("routineScheduleList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateUpdateListNonstrict(List<RoutineSchedule> ls) { + assertObjectNotNull("routineScheduleList", ls); + return getMyDao().updateListNonstrict( + helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<RoutineSchedule> ls) { + assertObjectNotNull("routineScheduleList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + protected int[] delegateDeleteListNonstrict(List<RoutineSchedule> ls) { + assertObjectNotNull("routineScheduleList", ls); + return getMyDao().deleteListNonstrict( + helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return !(downcast(entity).getVersionno() + "").equals("null");// For + // primitive + // type + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected RoutineSchedule downcast(Entity entity) { + return helpDowncastInternally(entity, RoutineSchedule.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleContentBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleContentBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleContentBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,604 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.RoutineScheduleContentDbm; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleContentCB; +import jp.sf.pal.scheduler.db.exdao.RoutineScheduleContentDao; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent; + +/** + * The behavior of ROUTINE_SCHEDULE_CONTENT. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, CONTENT + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * + * + * [foreign-table] + * ROUTINE_SCHEDULE + * + * [referrer-table] + * + * + * [foreign-property] + * routineSchedule + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsRoutineScheduleContentBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleContentDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return RoutineScheduleContentDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public RoutineScheduleContentDbm getMyDBMeta() { + return RoutineScheduleContentDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public RoutineScheduleContentDao getMyDao() { + return _dao; + } + + public void setMyDao(RoutineScheduleContentDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public RoutineScheduleContent newMyEntity() { + return new RoutineScheduleContent(); + } + + public RoutineScheduleContentCB newMyConditionBean() { + return new RoutineScheduleContentCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of RoutineScheduleContent. (NotNull) + * @return The selected count. + */ + public int selectCount(RoutineScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of RoutineScheduleContent. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoutineScheduleContent selectEntity(final RoutineScheduleContentCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<RoutineScheduleContent, RoutineScheduleContentCB>() { + public List<RoutineScheduleContent> callbackSelectList( + RoutineScheduleContentCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of RoutineScheduleContent. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoutineScheduleContent selectEntityWithDeletedCheck( + final RoutineScheduleContentCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<RoutineScheduleContent, RoutineScheduleContentCB>() { + public List<RoutineScheduleContent> callbackSelectList( + RoutineScheduleContentCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public RoutineScheduleContent selectByPKValueWithDeletedCheck(Long id) { + RoutineScheduleContent entity = new RoutineScheduleContent(); + entity.setId(id); + final RoutineScheduleContentCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of RoutineScheduleContent. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<RoutineScheduleContent> selectList( + RoutineScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<RoutineScheduleContent>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of RoutineScheduleContent. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<RoutineScheduleContent> selectPage( + final RoutineScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<RoutineScheduleContent> invoker = new PagingInvoker<RoutineScheduleContent>( + getTableDbName()); + final PagingHandler<RoutineScheduleContent> handler = new PagingHandler<RoutineScheduleContent>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<RoutineScheduleContent> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of RoutineScheduleContent. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List<java.util.Map<String, Object>> selectValueLabelList( + RoutineScheduleContentCB cb, + ValueLabelSetupper<RoutineScheduleContent> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'RoutineSchedule'. + * + * @param routineScheduleContentList The list of routineScheduleContent. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<RoutineSchedule> pulloutRoutineSchedule( + List<RoutineScheduleContent> routineScheduleContentList) { + return helpPulloutInternally( + routineScheduleContentList, + new InternalPulloutCallback<RoutineScheduleContent, RoutineSchedule>() { + public RoutineSchedule callbackGetForeignEntity( + RoutineScheduleContent entity) { + return entity.getRoutineSchedule(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param routineScheduleContent The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(RoutineScheduleContent routineScheduleContent) { + assertEntityNotNull(routineScheduleContent); + delegateInsert(routineScheduleContent); + } + + @Override + protected void doCreate(Entity routineScheduleContent) { + insert((RoutineScheduleContent) routineScheduleContent); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param routineScheduleContent The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final RoutineScheduleContent routineScheduleContent) { + helpUpdateInternally(routineScheduleContent, + new InternalUpdateCallback<RoutineScheduleContent>() { + public int callbackDelegateUpdate( + RoutineScheduleContent entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((RoutineScheduleContent) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((RoutineScheduleContent) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param routineScheduleContent The entity of insert or update target. + * (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate( + final RoutineScheduleContent routineScheduleContent) { + helpInsertOrUpdateInternally( + routineScheduleContent, + new InternalInsertOrUpdateCallback<RoutineScheduleContent, RoutineScheduleContentCB>() { + public void callbackInsert(RoutineScheduleContent entity) { + insert(entity); + } + + public void callbackUpdate(RoutineScheduleContent entity) { + update(entity); + } + + public RoutineScheduleContentCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(RoutineScheduleContentCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity routineScheduleContent) { + insertOrUpdate((RoutineScheduleContent) routineScheduleContent); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((RoutineScheduleContent) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param routineScheduleContent The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(RoutineScheduleContent routineScheduleContent) { + helpDeleteInternally(routineScheduleContent, + new InternalDeleteCallback<RoutineScheduleContent>() { + public int callbackDelegateDelete( + RoutineScheduleContent entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity routineScheduleContent) { + delete((RoutineScheduleContent) routineScheduleContent); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleContentList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert( + List<RoutineScheduleContent> routineScheduleContentList) { + assertObjectNotNull("routineScheduleContentList", + routineScheduleContentList); + return delegateInsertList(routineScheduleContentList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param routineScheduleContentList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate( + List<RoutineScheduleContent> routineScheduleContentList) { + assertObjectNotNull("routineScheduleContentList", + routineScheduleContentList); + return delegateUpdateList(routineScheduleContentList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleContentList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete( + List<RoutineScheduleContent> routineScheduleContentList) { + assertObjectNotNull("routineScheduleContentList", + routineScheduleContentList); + return delegateDeleteList(routineScheduleContentList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param routineScheduleContent Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(RoutineScheduleContent routineScheduleContent, + RoutineScheduleContentCB cb) { + assertObjectNotNull("routineScheduleContent", routineScheduleContent); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(routineScheduleContent); + filterEntityOfUpdate(routineScheduleContent); + assertEntityOfUpdate(routineScheduleContent); + return getMyDao().updateByQuery(cb, routineScheduleContent); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(RoutineScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(RoutineScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<RoutineScheduleContent> delegateSelectList( + RoutineScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(RoutineScheduleContent e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(RoutineScheduleContent e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(RoutineScheduleContent e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List<RoutineScheduleContent> ls) { + assertObjectNotNull("routineScheduleContentList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<RoutineScheduleContent> ls) { + assertObjectNotNull("routineScheduleContentList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<RoutineScheduleContent> ls) { + assertObjectNotNull("routineScheduleContentList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected RoutineScheduleContent downcast(Entity entity) { + return helpDowncastInternally(entity, RoutineScheduleContent.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleContentBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,624 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.RoutineScheduleMappingDbm; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.exdao.RoutineScheduleMappingDao; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of ROUTINE_SCHEDULE_MAPPING. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, SCHEDULE_ID, USER_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * ROUTINE_SCHEDULE, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * routineSchedule, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsRoutineScheduleMappingBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleMappingDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return RoutineScheduleMappingDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public RoutineScheduleMappingDbm getMyDBMeta() { + return RoutineScheduleMappingDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public RoutineScheduleMappingDao getMyDao() { + return _dao; + } + + public void setMyDao(RoutineScheduleMappingDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public RoutineScheduleMapping newMyEntity() { + return new RoutineScheduleMapping(); + } + + public RoutineScheduleMappingCB newMyConditionBean() { + return new RoutineScheduleMappingCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of RoutineScheduleMapping. (NotNull) + * @return The selected count. + */ + public int selectCount(RoutineScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of RoutineScheduleMapping. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoutineScheduleMapping selectEntity(final RoutineScheduleMappingCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<RoutineScheduleMapping, RoutineScheduleMappingCB>() { + public List<RoutineScheduleMapping> callbackSelectList( + RoutineScheduleMappingCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of RoutineScheduleMapping. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public RoutineScheduleMapping selectEntityWithDeletedCheck( + final RoutineScheduleMappingCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<RoutineScheduleMapping, RoutineScheduleMappingCB>() { + public List<RoutineScheduleMapping> callbackSelectList( + RoutineScheduleMappingCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public RoutineScheduleMapping selectByPKValueWithDeletedCheck(Long id) { + RoutineScheduleMapping entity = new RoutineScheduleMapping(); + entity.setId(id); + final RoutineScheduleMappingCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of RoutineScheduleMapping. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<RoutineScheduleMapping> selectList( + RoutineScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<RoutineScheduleMapping>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of RoutineScheduleMapping. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<RoutineScheduleMapping> selectPage( + final RoutineScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<RoutineScheduleMapping> invoker = new PagingInvoker<RoutineScheduleMapping>( + getTableDbName()); + final PagingHandler<RoutineScheduleMapping> handler = new PagingHandler<RoutineScheduleMapping>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<RoutineScheduleMapping> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of RoutineScheduleMapping. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List<java.util.Map<String, Object>> selectValueLabelList( + RoutineScheduleMappingCB cb, + ValueLabelSetupper<RoutineScheduleMapping> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'RoutineSchedule'. + * + * @param routineScheduleMappingList The list of routineScheduleMapping. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<RoutineSchedule> pulloutRoutineSchedule( + List<RoutineScheduleMapping> routineScheduleMappingList) { + return helpPulloutInternally( + routineScheduleMappingList, + new InternalPulloutCallback<RoutineScheduleMapping, RoutineSchedule>() { + public RoutineSchedule callbackGetForeignEntity( + RoutineScheduleMapping entity) { + return entity.getRoutineSchedule(); + } + }); + } + + /** + * Pull out the list of foreign table 'UserInfo'. + * + * @param routineScheduleMappingList The list of routineScheduleMapping. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<UserInfo> pulloutUserInfo( + List<RoutineScheduleMapping> routineScheduleMappingList) { + return helpPulloutInternally( + routineScheduleMappingList, + new InternalPulloutCallback<RoutineScheduleMapping, UserInfo>() { + public UserInfo callbackGetForeignEntity( + RoutineScheduleMapping entity) { + return entity.getUserInfo(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param routineScheduleMapping The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(RoutineScheduleMapping routineScheduleMapping) { + assertEntityNotNull(routineScheduleMapping); + delegateInsert(routineScheduleMapping); + } + + @Override + protected void doCreate(Entity routineScheduleMapping) { + insert((RoutineScheduleMapping) routineScheduleMapping); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param routineScheduleMapping The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final RoutineScheduleMapping routineScheduleMapping) { + helpUpdateInternally(routineScheduleMapping, + new InternalUpdateCallback<RoutineScheduleMapping>() { + public int callbackDelegateUpdate( + RoutineScheduleMapping entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((RoutineScheduleMapping) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((RoutineScheduleMapping) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param routineScheduleMapping The entity of insert or update target. + * (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate( + final RoutineScheduleMapping routineScheduleMapping) { + helpInsertOrUpdateInternally( + routineScheduleMapping, + new InternalInsertOrUpdateCallback<RoutineScheduleMapping, RoutineScheduleMappingCB>() { + public void callbackInsert(RoutineScheduleMapping entity) { + insert(entity); + } + + public void callbackUpdate(RoutineScheduleMapping entity) { + update(entity); + } + + public RoutineScheduleMappingCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(RoutineScheduleMappingCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity routineScheduleMapping) { + insertOrUpdate((RoutineScheduleMapping) routineScheduleMapping); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((RoutineScheduleMapping) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param routineScheduleMapping The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(RoutineScheduleMapping routineScheduleMapping) { + helpDeleteInternally(routineScheduleMapping, + new InternalDeleteCallback<RoutineScheduleMapping>() { + public int callbackDelegateDelete( + RoutineScheduleMapping entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity routineScheduleMapping) { + delete((RoutineScheduleMapping) routineScheduleMapping); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleMappingList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert( + List<RoutineScheduleMapping> routineScheduleMappingList) { + assertObjectNotNull("routineScheduleMappingList", + routineScheduleMappingList); + return delegateInsertList(routineScheduleMappingList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param routineScheduleMappingList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate( + List<RoutineScheduleMapping> routineScheduleMappingList) { + assertObjectNotNull("routineScheduleMappingList", + routineScheduleMappingList); + return delegateUpdateList(routineScheduleMappingList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param routineScheduleMappingList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete( + List<RoutineScheduleMapping> routineScheduleMappingList) { + assertObjectNotNull("routineScheduleMappingList", + routineScheduleMappingList); + return delegateDeleteList(routineScheduleMappingList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param routineScheduleMapping Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(RoutineScheduleMapping routineScheduleMapping, + RoutineScheduleMappingCB cb) { + assertObjectNotNull("routineScheduleMapping", routineScheduleMapping); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(routineScheduleMapping); + filterEntityOfUpdate(routineScheduleMapping); + assertEntityOfUpdate(routineScheduleMapping); + return getMyDao().updateByQuery(cb, routineScheduleMapping); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(RoutineScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(RoutineScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<RoutineScheduleMapping> delegateSelectList( + RoutineScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(RoutineScheduleMapping e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(RoutineScheduleMapping e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(RoutineScheduleMapping e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List<RoutineScheduleMapping> ls) { + assertObjectNotNull("routineScheduleMappingList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<RoutineScheduleMapping> ls) { + assertObjectNotNull("routineScheduleMappingList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<RoutineScheduleMapping> ls) { + assertObjectNotNull("routineScheduleMappingList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected RoutineScheduleMapping downcast(Entity entity) { + return helpDowncastInternally(entity, RoutineScheduleMapping.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsRoutineScheduleMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,839 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.SingleScheduleDbm; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.exbhv.SingleScheduleMappingBhv; +import jp.sf.pal.scheduler.db.exdao.SingleScheduleDao; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleContent; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; + +/** + * The behavior of SINGLE_SCHEDULE. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, TITLE, LOCATION, START_DATE, START_TIME, END_DATE, END_TIME, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * SINGLE_SCHEDULE_CONTENT, SINGLE_SCHEDULE_MAPPING + * + * [foreign-property] + * singleScheduleContentAsOne + * + * [referrer-property] + * singleScheduleMappingList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsSingleScheduleBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "SINGLE_SCHEDULE"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return SingleScheduleDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public SingleScheduleDbm getMyDBMeta() { + return SingleScheduleDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public SingleScheduleDao getMyDao() { + return _dao; + } + + public void setMyDao(SingleScheduleDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public SingleSchedule newMyEntity() { + return new SingleSchedule(); + } + + public SingleScheduleCB newMyConditionBean() { + return new SingleScheduleCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of SingleSchedule. (NotNull) + * @return The selected count. + */ + public int selectCount(SingleScheduleCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of SingleSchedule. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public SingleSchedule selectEntity(final SingleScheduleCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<SingleSchedule, SingleScheduleCB>() { + public List<SingleSchedule> callbackSelectList( + SingleScheduleCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of SingleSchedule. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public SingleSchedule selectEntityWithDeletedCheck(final SingleScheduleCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<SingleSchedule, SingleScheduleCB>() { + public List<SingleSchedule> callbackSelectList( + SingleScheduleCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public SingleSchedule selectByPKValueWithDeletedCheck(Long id) { + SingleSchedule entity = new SingleSchedule(); + entity.setId(id); + final SingleScheduleCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of SingleSchedule. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<SingleSchedule> selectList(SingleScheduleCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<SingleSchedule>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of SingleSchedule. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<SingleSchedule> selectPage(final SingleScheduleCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<SingleSchedule> invoker = new PagingInvoker<SingleSchedule>( + getTableDbName()); + final PagingHandler<SingleSchedule> handler = new PagingHandler<SingleSchedule>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<SingleSchedule> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of SingleSchedule. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List<java.util.Map<String, Object>> selectValueLabelList( + SingleScheduleCB cb, + ValueLabelSetupper<SingleSchedule> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + /** + * Load referrer of singleScheduleMappingList with the setupper for + * condition-bean of referrer. <br /> About internal policy, the value of + * primary key(and others too) is treated as case-insensitive. <br /> The + * condition-bean that the setupper provides have settings before you touch + * it. It is as follows: + * + * <pre> + * cb.query().setScheduleId_InScope(pkList); + * cb.query().addOrderBy_ScheduleId_Asc(); + * </pre> + * + * @param singleScheduleList The entity list of singleSchedule. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadSingleScheduleMappingList( + List<SingleSchedule> singleScheduleList, + ConditionBeanSetupper<SingleScheduleMappingCB> conditionBeanSetupper) { + assertObjectNotNull("singleScheduleList<SingleSchedule>", + singleScheduleList); + assertObjectNotNull("conditionBeanSetupper<SingleScheduleMappingCB>", + conditionBeanSetupper); + if (singleScheduleList.isEmpty()) { + return; + } + loadSingleScheduleMappingList( + singleScheduleList, + new LoadReferrerOption<SingleScheduleMappingCB, SingleScheduleMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param singleScheduleList The entity list of singleSchedule. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadSingleScheduleMappingList( + List<SingleSchedule> singleScheduleList, + LoadReferrerOption<SingleScheduleMappingCB, SingleScheduleMapping> loadReferrerOption) { + assertObjectNotNull("singleScheduleList<SingleSchedule>", + singleScheduleList); + assertObjectNotNull( + "loadReferrerOption<SingleScheduleMapping, SingleScheduleMappingCB>", + loadReferrerOption); + if (singleScheduleList.isEmpty()) { + return; + } + final SingleScheduleMappingBhv referrerBhv = xgetBSFLR().select( + SingleScheduleMappingBhv.class); + helpLoadReferrerInternally( + singleScheduleList, + loadReferrerOption, + new InternalLoadReferrerCallback<SingleSchedule, Long, SingleScheduleMappingCB, SingleScheduleMapping>() { + public Long callbackBase_getPrimaryKeyValue( + SingleSchedule entity) { + return entity.getId(); + } + + public void callbackBase_setReferrerList( + SingleSchedule entity, + List<SingleScheduleMapping> referrerList) { + entity.setSingleScheduleMappingList(referrerList); + } + + public SingleScheduleMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + SingleScheduleMappingCB cb, List<Long> pkList) { + cb.query().setScheduleId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + SingleScheduleMappingCB cb) { + cb.query().addOrderBy_ScheduleId_Asc(); + } + + public List<SingleScheduleMapping> callbackReferrer_selectList( + SingleScheduleMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public Long callbackReferrer_getForeignKeyValue( + SingleScheduleMapping entity) { + return entity.getScheduleId(); + } + + public void callbackReferrer_setForeignEntity( + SingleScheduleMapping referrerEntity, + SingleSchedule baseEntity) { + referrerEntity.setSingleSchedule(baseEntity); + } + }); + } + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of referrer-as-one table 'SingleScheduleContent'. + * + * @param singleScheduleList The list of singleSchedule. (NotNull) + * @return The list of referrer-as-one table. (NotNull) + */ + public List<SingleScheduleContent> pulloutSingleScheduleContentAsOne( + List<SingleSchedule> singleScheduleList) { + return helpPulloutInternally( + singleScheduleList, + new InternalPulloutCallback<SingleSchedule, SingleScheduleContent>() { + public SingleScheduleContent callbackGetForeignEntity( + SingleSchedule entity) { + return entity.getSingleScheduleContentAsOne(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param singleSchedule The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(SingleSchedule singleSchedule) { + assertEntityNotNull(singleSchedule); + delegateInsert(singleSchedule); + } + + @Override + protected void doCreate(Entity singleSchedule) { + insert((SingleSchedule) singleSchedule); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param singleSchedule The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final SingleSchedule singleSchedule) { + helpUpdateInternally(singleSchedule, + new InternalUpdateCallback<SingleSchedule>() { + public int callbackDelegateUpdate(SingleSchedule entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((SingleSchedule) entity); + } + + /** + * Update the entity non-strictly modified-only. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param singleSchedule The entity of update target. (NotNull) + * {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void updateNonstrict(final SingleSchedule singleSchedule) { + helpUpdateNonstrictInternally(singleSchedule, + new InternalUpdateNonstrictCallback<SingleSchedule>() { + public int callbackDelegateUpdateNonstrict( + SingleSchedule entity) { + return delegateUpdateNonstrict(entity); + } + }); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + updateNonstrict((SingleSchedule) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param singleSchedule The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final SingleSchedule singleSchedule) { + helpInsertOrUpdateInternally( + singleSchedule, + new InternalInsertOrUpdateCallback<SingleSchedule, SingleScheduleCB>() { + public void callbackInsert(SingleSchedule entity) { + insert(entity); + } + + public void callbackUpdate(SingleSchedule entity) { + update(entity); + } + + public SingleScheduleCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(SingleScheduleCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity singleSchedule) { + insertOrUpdate((SingleSchedule) singleSchedule); + } + + /** + * Insert or update the entity non-strictly modified-only. + * {NonConcurrencyControl(when update)} + * + * @param singleSchedule The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdateNonstrict(SingleSchedule singleSchedule) { + helpInsertOrUpdateInternally(singleSchedule, + new InternalInsertOrUpdateNonstrictCallback<SingleSchedule>() { + public void callbackInsert(SingleSchedule entity) { + insert(entity); + } + + public void callbackUpdateNonstrict(SingleSchedule entity) { + updateNonstrict(entity); + } + }); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdateNonstrict((SingleSchedule) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param singleSchedule The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(SingleSchedule singleSchedule) { + helpDeleteInternally(singleSchedule, + new InternalDeleteCallback<SingleSchedule>() { + public int callbackDelegateDelete(SingleSchedule entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity singleSchedule) { + delete((SingleSchedule) singleSchedule); + } + + /** + * Delete the entity non-strictly. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param singleSchedule Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrict(SingleSchedule singleSchedule) { + helpDeleteNonstrictInternally(singleSchedule, + new InternalDeleteNonstrictCallback<SingleSchedule>() { + public int callbackDelegateDeleteNonstrict( + SingleSchedule entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + /** + * Delete the entity non-strictly ignoring deleted. + * {UpdateCountZeroException, NonConcurrencyControl} + * + * @param singleSchedule Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrictIgnoreDeleted(SingleSchedule singleSchedule) { + helpDeleteNonstrictIgnoreDeletedInternally( + singleSchedule, + new InternalDeleteNonstrictIgnoreDeletedCallback<SingleSchedule>() { + public int callbackDelegateDeleteNonstrict( + SingleSchedule entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<SingleSchedule> singleScheduleList) { + assertObjectNotNull("singleScheduleList", singleScheduleList); + return delegateInsertList(singleScheduleList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param singleScheduleList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchUpdate(List<SingleSchedule> singleScheduleList) { + assertObjectNotNull("singleScheduleList", singleScheduleList); + return delegateUpdateList(singleScheduleList); + } + + /** + * Batch update the list non-strictly. All columns are update target. {NOT + * modified only} <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdateNonstrict(List<SingleSchedule> singleScheduleList) { + assertObjectNotNull("singleScheduleList", singleScheduleList); + return delegateUpdateListNonstrict(singleScheduleList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchDelete(List<SingleSchedule> singleScheduleList) { + assertObjectNotNull("singleScheduleList", singleScheduleList); + return delegateDeleteList(singleScheduleList); + } + + /** + * Batch delete the list non-strictly. <br /> This method use 'Batch Update' + * of java.sql.PreparedStatement. + * + * @param singleScheduleList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDeleteNonstrict(List<SingleSchedule> singleScheduleList) { + assertObjectNotNull("singleScheduleList", singleScheduleList); + return delegateDeleteListNonstrict(singleScheduleList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param singleSchedule Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(SingleSchedule singleSchedule, SingleScheduleCB cb) { + assertObjectNotNull("singleSchedule", singleSchedule); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(singleSchedule); + filterEntityOfUpdate(singleSchedule); + assertEntityOfUpdate(singleSchedule); + return getMyDao().updateByQuery(cb, singleSchedule); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(SingleScheduleCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(SingleScheduleCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<SingleSchedule> delegateSelectList(SingleScheduleCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(SingleSchedule e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(SingleSchedule e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateUpdateNonstrict(SingleSchedule e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateNonstrictModifiedOnly(e); + } + + protected int delegateDelete(SingleSchedule e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int delegateDeleteNonstrict(SingleSchedule e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().deleteNonstrict(e); + } + + protected int[] delegateInsertList(List<SingleSchedule> ls) { + assertObjectNotNull("singleScheduleList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<SingleSchedule> ls) { + assertObjectNotNull("singleScheduleList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateUpdateListNonstrict(List<SingleSchedule> ls) { + assertObjectNotNull("singleScheduleList", ls); + return getMyDao().updateListNonstrict( + helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<SingleSchedule> ls) { + assertObjectNotNull("singleScheduleList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + protected int[] delegateDeleteListNonstrict(List<SingleSchedule> ls) { + assertObjectNotNull("singleScheduleList", ls); + return getMyDao().deleteListNonstrict( + helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return !(downcast(entity).getVersionno() + "").equals("null");// For + // primitive + // type + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected SingleSchedule downcast(Entity entity) { + return helpDowncastInternally(entity, SingleSchedule.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleContentBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleContentBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleContentBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,603 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.SingleScheduleContentDbm; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleContentCB; +import jp.sf.pal.scheduler.db.exdao.SingleScheduleContentDao; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleContent; + +/** + * The behavior of SINGLE_SCHEDULE_CONTENT. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, CONTENT + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * + * + * [foreign-table] + * SINGLE_SCHEDULE + * + * [referrer-table] + * + * + * [foreign-property] + * singleSchedule + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsSingleScheduleContentBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleContentDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return SingleScheduleContentDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public SingleScheduleContentDbm getMyDBMeta() { + return SingleScheduleContentDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public SingleScheduleContentDao getMyDao() { + return _dao; + } + + public void setMyDao(SingleScheduleContentDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public SingleScheduleContent newMyEntity() { + return new SingleScheduleContent(); + } + + public SingleScheduleContentCB newMyConditionBean() { + return new SingleScheduleContentCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of SingleScheduleContent. (NotNull) + * @return The selected count. + */ + public int selectCount(SingleScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of SingleScheduleContent. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public SingleScheduleContent selectEntity(final SingleScheduleContentCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<SingleScheduleContent, SingleScheduleContentCB>() { + public List<SingleScheduleContent> callbackSelectList( + SingleScheduleContentCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of SingleScheduleContent. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public SingleScheduleContent selectEntityWithDeletedCheck( + final SingleScheduleContentCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<SingleScheduleContent, SingleScheduleContentCB>() { + public List<SingleScheduleContent> callbackSelectList( + SingleScheduleContentCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public SingleScheduleContent selectByPKValueWithDeletedCheck(Long id) { + SingleScheduleContent entity = new SingleScheduleContent(); + entity.setId(id); + final SingleScheduleContentCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of SingleScheduleContent. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<SingleScheduleContent> selectList( + SingleScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<SingleScheduleContent>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of SingleScheduleContent. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<SingleScheduleContent> selectPage( + final SingleScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<SingleScheduleContent> invoker = new PagingInvoker<SingleScheduleContent>( + getTableDbName()); + final PagingHandler<SingleScheduleContent> handler = new PagingHandler<SingleScheduleContent>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<SingleScheduleContent> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of SingleScheduleContent. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List<java.util.Map<String, Object>> selectValueLabelList( + SingleScheduleContentCB cb, + ValueLabelSetupper<SingleScheduleContent> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'SingleSchedule'. + * + * @param singleScheduleContentList The list of singleScheduleContent. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<SingleSchedule> pulloutSingleSchedule( + List<SingleScheduleContent> singleScheduleContentList) { + return helpPulloutInternally( + singleScheduleContentList, + new InternalPulloutCallback<SingleScheduleContent, SingleSchedule>() { + public SingleSchedule callbackGetForeignEntity( + SingleScheduleContent entity) { + return entity.getSingleSchedule(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param singleScheduleContent The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(SingleScheduleContent singleScheduleContent) { + assertEntityNotNull(singleScheduleContent); + delegateInsert(singleScheduleContent); + } + + @Override + protected void doCreate(Entity singleScheduleContent) { + insert((SingleScheduleContent) singleScheduleContent); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param singleScheduleContent The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final SingleScheduleContent singleScheduleContent) { + helpUpdateInternally(singleScheduleContent, + new InternalUpdateCallback<SingleScheduleContent>() { + public int callbackDelegateUpdate( + SingleScheduleContent entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((SingleScheduleContent) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((SingleScheduleContent) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param singleScheduleContent The entity of insert or update target. + * (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final SingleScheduleContent singleScheduleContent) { + helpInsertOrUpdateInternally( + singleScheduleContent, + new InternalInsertOrUpdateCallback<SingleScheduleContent, SingleScheduleContentCB>() { + public void callbackInsert(SingleScheduleContent entity) { + insert(entity); + } + + public void callbackUpdate(SingleScheduleContent entity) { + update(entity); + } + + public SingleScheduleContentCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(SingleScheduleContentCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity singleScheduleContent) { + insertOrUpdate((SingleScheduleContent) singleScheduleContent); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((SingleScheduleContent) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param singleScheduleContent The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(SingleScheduleContent singleScheduleContent) { + helpDeleteInternally(singleScheduleContent, + new InternalDeleteCallback<SingleScheduleContent>() { + public int callbackDelegateDelete( + SingleScheduleContent entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity singleScheduleContent) { + delete((SingleScheduleContent) singleScheduleContent); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleContentList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert( + List<SingleScheduleContent> singleScheduleContentList) { + assertObjectNotNull("singleScheduleContentList", + singleScheduleContentList); + return delegateInsertList(singleScheduleContentList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param singleScheduleContentList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate( + List<SingleScheduleContent> singleScheduleContentList) { + assertObjectNotNull("singleScheduleContentList", + singleScheduleContentList); + return delegateUpdateList(singleScheduleContentList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleContentList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete( + List<SingleScheduleContent> singleScheduleContentList) { + assertObjectNotNull("singleScheduleContentList", + singleScheduleContentList); + return delegateDeleteList(singleScheduleContentList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param singleScheduleContent Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(SingleScheduleContent singleScheduleContent, + SingleScheduleContentCB cb) { + assertObjectNotNull("singleScheduleContent", singleScheduleContent); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(singleScheduleContent); + filterEntityOfUpdate(singleScheduleContent); + assertEntityOfUpdate(singleScheduleContent); + return getMyDao().updateByQuery(cb, singleScheduleContent); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(SingleScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(SingleScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<SingleScheduleContent> delegateSelectList( + SingleScheduleContentCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(SingleScheduleContent e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(SingleScheduleContent e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(SingleScheduleContent e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List<SingleScheduleContent> ls) { + assertObjectNotNull("singleScheduleContentList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<SingleScheduleContent> ls) { + assertObjectNotNull("singleScheduleContentList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<SingleScheduleContent> ls) { + assertObjectNotNull("singleScheduleContentList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected SingleScheduleContent downcast(Entity entity) { + return helpDowncastInternally(entity, SingleScheduleContent.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleContentBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,622 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.SingleScheduleMappingDbm; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.exdao.SingleScheduleMappingDao; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of SINGLE_SCHEDULE_MAPPING. + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, SCHEDULE_ID, USER_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * SINGLE_SCHEDULE, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * singleSchedule, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsSingleScheduleMappingBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleMappingDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return SingleScheduleMappingDbm.getInstance(); + } + + /** @return The meta data of the database as my table type. (NotNull) */ + public SingleScheduleMappingDbm getMyDBMeta() { + return SingleScheduleMappingDbm.getInstance(); + } + + //========================================================================== + // ========= + // Dao Accessor + // ============ + public SingleScheduleMappingDao getMyDao() { + return _dao; + } + + public void setMyDao(SingleScheduleMappingDao dao) { + assertObjectNotNull("dao", dao); + _dao = dao; + } + + public DaoReadable getDaoReadable() { + return getMyDao(); + } + + public DaoWritable getDaoWritable() { + return getMyDao(); + } + + //========================================================================== + // ========= + // New Instance + // ============ + public Entity newEntity() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public SingleScheduleMapping newMyEntity() { + return new SingleScheduleMapping(); + } + + public SingleScheduleMappingCB newMyConditionBean() { + return new SingleScheduleMappingCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of SingleScheduleMapping. (NotNull) + * @return The selected count. + */ + public int selectCount(SingleScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of SingleScheduleMapping. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public SingleScheduleMapping selectEntity(final SingleScheduleMappingCB cb) { + return helpSelectEntityInternally( + cb, + new InternalSelectEntityCallback<SingleScheduleMapping, SingleScheduleMappingCB>() { + public List<SingleScheduleMapping> callbackSelectList( + SingleScheduleMappingCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of SingleScheduleMapping. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public SingleScheduleMapping selectEntityWithDeletedCheck( + final SingleScheduleMappingCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<SingleScheduleMapping, SingleScheduleMappingCB>() { + public List<SingleScheduleMapping> callbackSelectList( + SingleScheduleMappingCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public SingleScheduleMapping selectByPKValueWithDeletedCheck(Long id) { + SingleScheduleMapping entity = new SingleScheduleMapping(); + entity.setId(id); + final SingleScheduleMappingCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of SingleScheduleMapping. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<SingleScheduleMapping> selectList( + SingleScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<SingleScheduleMapping>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of SingleScheduleMapping. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<SingleScheduleMapping> selectPage( + final SingleScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<SingleScheduleMapping> invoker = new PagingInvoker<SingleScheduleMapping>( + getTableDbName()); + final PagingHandler<SingleScheduleMapping> handler = new PagingHandler<SingleScheduleMapping>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<SingleScheduleMapping> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of SingleScheduleMapping. (NotNull) + * @param valueLabelSetupper The setupper of value-label. (NotNull) + * @return The list of value-label. (NotNull) + */ + public List<java.util.Map<String, Object>> selectValueLabelList( + SingleScheduleMappingCB cb, + ValueLabelSetupper<SingleScheduleMapping> valueLabelSetupper) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'SingleSchedule'. + * + * @param singleScheduleMappingList The list of singleScheduleMapping. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<SingleSchedule> pulloutSingleSchedule( + List<SingleScheduleMapping> singleScheduleMappingList) { + return helpPulloutInternally( + singleScheduleMappingList, + new InternalPulloutCallback<SingleScheduleMapping, SingleSchedule>() { + public SingleSchedule callbackGetForeignEntity( + SingleScheduleMapping entity) { + return entity.getSingleSchedule(); + } + }); + } + + /** + * Pull out the list of foreign table 'UserInfo'. + * + * @param singleScheduleMappingList The list of singleScheduleMapping. + * (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<UserInfo> pulloutUserInfo( + List<SingleScheduleMapping> singleScheduleMappingList) { + return helpPulloutInternally(singleScheduleMappingList, + new InternalPulloutCallback<SingleScheduleMapping, UserInfo>() { + public UserInfo callbackGetForeignEntity( + SingleScheduleMapping entity) { + return entity.getUserInfo(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param singleScheduleMapping The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(SingleScheduleMapping singleScheduleMapping) { + assertEntityNotNull(singleScheduleMapping); + delegateInsert(singleScheduleMapping); + } + + @Override + protected void doCreate(Entity singleScheduleMapping) { + insert((SingleScheduleMapping) singleScheduleMapping); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param singleScheduleMapping The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final SingleScheduleMapping singleScheduleMapping) { + helpUpdateInternally(singleScheduleMapping, + new InternalUpdateCallback<SingleScheduleMapping>() { + public int callbackDelegateUpdate( + SingleScheduleMapping entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((SingleScheduleMapping) entity); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + update((SingleScheduleMapping) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param singleScheduleMapping The entity of insert or update target. + * (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final SingleScheduleMapping singleScheduleMapping) { + helpInsertOrUpdateInternally( + singleScheduleMapping, + new InternalInsertOrUpdateCallback<SingleScheduleMapping, SingleScheduleMappingCB>() { + public void callbackInsert(SingleScheduleMapping entity) { + insert(entity); + } + + public void callbackUpdate(SingleScheduleMapping entity) { + update(entity); + } + + public SingleScheduleMappingCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(SingleScheduleMappingCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity singleScheduleMapping) { + insertOrUpdate((SingleScheduleMapping) singleScheduleMapping); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdate((SingleScheduleMapping) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param singleScheduleMapping The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(SingleScheduleMapping singleScheduleMapping) { + helpDeleteInternally(singleScheduleMapping, + new InternalDeleteCallback<SingleScheduleMapping>() { + public int callbackDelegateDelete( + SingleScheduleMapping entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity singleScheduleMapping) { + delete((SingleScheduleMapping) singleScheduleMapping); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleMappingList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert( + List<SingleScheduleMapping> singleScheduleMappingList) { + assertObjectNotNull("singleScheduleMappingList", + singleScheduleMappingList); + return delegateInsertList(singleScheduleMappingList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param singleScheduleMappingList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdate( + List<SingleScheduleMapping> singleScheduleMappingList) { + assertObjectNotNull("singleScheduleMappingList", + singleScheduleMappingList); + return delegateUpdateList(singleScheduleMappingList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param singleScheduleMappingList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDelete( + List<SingleScheduleMapping> singleScheduleMappingList) { + assertObjectNotNull("singleScheduleMappingList", + singleScheduleMappingList); + return delegateDeleteList(singleScheduleMappingList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param singleScheduleMapping Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(SingleScheduleMapping singleScheduleMapping, + SingleScheduleMappingCB cb) { + assertObjectNotNull("singleScheduleMapping", singleScheduleMapping); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(singleScheduleMapping); + filterEntityOfUpdate(singleScheduleMapping); + assertEntityOfUpdate(singleScheduleMapping); + return getMyDao().updateByQuery(cb, singleScheduleMapping); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(SingleScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(SingleScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<SingleScheduleMapping> delegateSelectList( + SingleScheduleMappingCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(SingleScheduleMapping e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(SingleScheduleMapping e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateDelete(SingleScheduleMapping e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int[] delegateInsertList(List<SingleScheduleMapping> ls) { + assertObjectNotNull("singleScheduleMappingList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<SingleScheduleMapping> ls) { + assertObjectNotNull("singleScheduleMappingList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<SingleScheduleMapping> ls) { + assertObjectNotNull("singleScheduleMappingList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return false; + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected SingleScheduleMapping downcast(Entity entity) { + return helpDowncastInternally(entity, SingleScheduleMapping.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsSingleScheduleMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsUserInfoBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsUserInfoBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsUserInfoBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1124 @@ +package jp.sf.pal.scheduler.db.bsbhv; + +import java.util.List; + +import jp.sf.pal.scheduler.db.allcommon.DaoReadable; +import jp.sf.pal.scheduler.db.allcommon.DaoWritable; +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.bhv.load.LoadReferrerOption; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ConditionBeanSetupper; +import jp.sf.pal.scheduler.db.allcommon.bhv.setup.ValueLabelSetupper; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ListResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingHandler; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingInvoker; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ResultBeanBuilder; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.bsentity.dbmeta.UserInfoDbm; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.exbhv.GroupMappingBhv; +import jp.sf.pal.scheduler.db.exbhv.RoleMappingBhv; +import jp.sf.pal.scheduler.db.exbhv.RoutineScheduleMappingBhv; +import jp.sf.pal.scheduler.db.exbhv.SingleScheduleMappingBhv; +import jp.sf.pal.scheduler.db.exdao.UserInfoDao; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The behavior of USER_INFO. + * + * <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, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * GROUP_INFO, ROLE_INFO + * + * [referrer-table] + * GROUP_MAPPING, ROLE_MAPPING, ROUTINE_SCHEDULE_MAPPING, SINGLE_SCHEDULE_MAPPING + * + * [foreign-property] + * groupInfo, roleInfo + * + * [referrer-property] + * groupMappingList, roleMappingList, routineScheduleMappingList, singleScheduleMappingList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ +public abstract class BsUserInfoBhv extends + jp.sf.pal.scheduler.db.allcommon.bhv.AbstractBehaviorWritable { + + //========================================================================== + // ========= + // Definition + // ========== + /* df:BehaviorQueryPathBegin */ + /* df:BehaviorQueryPathEnd */ + + //========================================================================== + // ========= + // Attribute + // ========= + protected UserInfoDao _dao; + + //========================================================================== + // ========= + // Table name + // ========== + /** @return The name on database of table. (NotNull) */ + public String getTableDbName() { + return "USER_INFO"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + /** @return The meta data of the database. (NotNull) */ + public DBMeta getDBMeta() { + return UserInfoDbm.getInstance(); + } + + /** @return The meta data of the database 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() { + return newMyEntity(); + } + + public ConditionBean newConditionBean() { + return newMyConditionBean(); + } + + public UserInfo newMyEntity() { + return new UserInfo(); + } + + public UserInfoCB newMyConditionBean() { + return new UserInfoCB(); + } + + //========================================================================== + // ========= + // Count Select + // ============ + /** + * Select the count of the condition-bean. {IgnorePagingCondition} + * + * @param cb The condition-bean of UserInfo. (NotNull) + * @return The selected count. + */ + public int selectCount(UserInfoCB cb) { + assertConditionBeanNotNull(cb); + return delegateSelectCount(cb); + } + + //========================================================================== + // ========= + // Entity Select + // ============= + /** + * Select the entity by the condition-bean. + * + * @param cb The condition-bean of UserInfo. (NotNull) + * @return The selected entity. (Nullalble) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public UserInfo selectEntity(final UserInfoCB cb) { + return helpSelectEntityInternally(cb, + new InternalSelectEntityCallback<UserInfo, UserInfoCB>() { + public List<UserInfo> callbackSelectList(UserInfoCB cb) { + return selectList(cb); + } + }); + } + + /** + * Select the entity by the condition-bean with deleted check. + * + * @param cb The condition-bean of UserInfo. (NotNull) + * @return The selected entity. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public UserInfo selectEntityWithDeletedCheck(final UserInfoCB cb) { + return helpSelectEntityWithDeletedCheckInternally( + cb, + new InternalSelectEntityWithDeletedCheckCallback<UserInfo, UserInfoCB>() { + public List<UserInfo> callbackSelectList(UserInfoCB cb) { + return selectList(cb); + } + }); + } + + /* + * (non-javadoc) Select the entity with deleted check. {by primary-key + * value} + * @param primaryKey The keys of primary. + * @return The selected entity. (NotNull) + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception + * jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException When + * the entity has been duplicated. + */ + public UserInfo selectByPKValueWithDeletedCheck(String userId) { + UserInfo entity = new UserInfo(); + entity.setUserId(userId); + final UserInfoCB cb = newMyConditionBean(); + cb.acceptPrimaryKeyMapString(getDBMeta().extractPrimaryKeyMapString( + entity)); + return selectEntityWithDeletedCheck(cb); + } + + //========================================================================== + // ========= + // List Select + // =========== + /** + * Select the list as result bean. + * + * @param cb The condition-bean of UserInfo. (NotNull) + * @return The result bean of selected list. (NotNull) + */ + public ListResultBean<UserInfo> selectList(UserInfoCB cb) { + assertConditionBeanNotNull(cb); + return new ResultBeanBuilder<UserInfo>(getTableDbName()) + .buildListResultBean(cb, delegateSelectList(cb)); + } + + //========================================================================== + // ========= + // Page Select + // =========== + /** + * Select the page as result bean. + * + * @param cb The condition-bean of UserInfo. (NotNull) + * @return The result bean of selected page. (NotNull) + */ + public PagingResultBean<UserInfo> selectPage(final UserInfoCB cb) { + assertConditionBeanNotNull(cb); + final PagingInvoker<UserInfo> invoker = new PagingInvoker<UserInfo>( + getTableDbName()); + final PagingHandler<UserInfo> handler = new PagingHandler<UserInfo>() { + public PagingBean getPagingBean() { + return cb; + } + + public int count() { + return selectCount(cb); + } + + public List<UserInfo> paging() { + return selectList(cb); + } + }; + return invoker.invokePaging(handler); + } + + //========================================================================== + // ========= + // Various Select + // ============== + /** + * Select the list of value-label. + * + * @param cb The condition-bean of UserInfo. (NotNull) + * @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) { + return createValueLabelList(selectList(cb), valueLabelSetupper); + } + + //========================================================================== + // ========= + // Load Referrer + // ============= + /** + * Load referrer of groupMappingList with the setupper for condition-bean of + * referrer. <br /> About internal policy, the value of primary key(and + * others too) is treated as case-insensitive. <br /> The condition-bean + * that the setupper provides have settings before you touch it. It is as + * follows: + * + * <pre> + * cb.query().setUserId_InScope(pkList); + * cb.query().addOrderBy_UserId_Asc(); + * </pre> + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadGroupMappingList(List<UserInfo> userInfoList, + ConditionBeanSetupper<GroupMappingCB> conditionBeanSetupper) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull("conditionBeanSetupper<GroupMappingCB>", + conditionBeanSetupper); + if (userInfoList.isEmpty()) { + return; + } + loadGroupMappingList(userInfoList, + new LoadReferrerOption<GroupMappingCB, GroupMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadGroupMappingList(List<UserInfo> userInfoList, + LoadReferrerOption<GroupMappingCB, GroupMapping> loadReferrerOption) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull("loadReferrerOption<GroupMapping, GroupMappingCB>", + loadReferrerOption); + if (userInfoList.isEmpty()) { + return; + } + final GroupMappingBhv referrerBhv = xgetBSFLR().select( + GroupMappingBhv.class); + helpLoadReferrerInternally( + userInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<UserInfo, String, GroupMappingCB, GroupMapping>() { + public String callbackBase_getPrimaryKeyValue( + UserInfo entity) { + return entity.getUserId(); + } + + public void callbackBase_setReferrerList(UserInfo entity, + List<GroupMapping> referrerList) { + entity.setGroupMappingList(referrerList); + } + + public GroupMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + GroupMappingCB cb, List<String> pkList) { + cb.query().setUserId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + GroupMappingCB cb) { + cb.query().addOrderBy_UserId_Asc(); + } + + public List<GroupMapping> callbackReferrer_selectList( + GroupMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + GroupMapping entity) { + return entity.getUserId(); + } + + public void callbackReferrer_setForeignEntity( + GroupMapping referrerEntity, UserInfo baseEntity) { + referrerEntity.setUserInfo(baseEntity); + } + }); + } + + /** + * Load referrer of roleMappingList with the setupper for condition-bean of + * referrer. <br /> About internal policy, the value of primary key(and + * others too) is treated as case-insensitive. <br /> The condition-bean + * that the setupper provides have settings before you touch it. It is as + * follows: + * + * <pre> + * cb.query().setUserId_InScope(pkList); + * cb.query().addOrderBy_UserId_Asc(); + * </pre> + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadRoleMappingList(List<UserInfo> userInfoList, + ConditionBeanSetupper<RoleMappingCB> conditionBeanSetupper) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull("conditionBeanSetupper<RoleMappingCB>", + conditionBeanSetupper); + if (userInfoList.isEmpty()) { + return; + } + loadRoleMappingList(userInfoList, + new LoadReferrerOption<RoleMappingCB, RoleMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadRoleMappingList(List<UserInfo> userInfoList, + LoadReferrerOption<RoleMappingCB, RoleMapping> loadReferrerOption) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull("loadReferrerOption<RoleMapping, RoleMappingCB>", + loadReferrerOption); + if (userInfoList.isEmpty()) { + return; + } + final RoleMappingBhv referrerBhv = xgetBSFLR().select( + RoleMappingBhv.class); + helpLoadReferrerInternally( + userInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<UserInfo, String, RoleMappingCB, RoleMapping>() { + public String callbackBase_getPrimaryKeyValue( + UserInfo entity) { + return entity.getUserId(); + } + + public void callbackBase_setReferrerList(UserInfo entity, + List<RoleMapping> referrerList) { + entity.setRoleMappingList(referrerList); + } + + public RoleMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + RoleMappingCB cb, List<String> pkList) { + cb.query().setUserId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + RoleMappingCB cb) { + cb.query().addOrderBy_UserId_Asc(); + } + + public List<RoleMapping> callbackReferrer_selectList( + RoleMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + RoleMapping entity) { + return entity.getUserId(); + } + + public void callbackReferrer_setForeignEntity( + RoleMapping referrerEntity, UserInfo baseEntity) { + referrerEntity.setUserInfo(baseEntity); + } + }); + } + + /** + * Load referrer of routineScheduleMappingList with the setupper for + * condition-bean of referrer. <br /> About internal policy, the value of + * primary key(and others too) is treated as case-insensitive. <br /> The + * condition-bean that the setupper provides have settings before you touch + * it. It is as follows: + * + * <pre> + * cb.query().setUserId_InScope(pkList); + * cb.query().addOrderBy_UserId_Asc(); + * </pre> + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadRoutineScheduleMappingList( + List<UserInfo> userInfoList, + ConditionBeanSetupper<RoutineScheduleMappingCB> conditionBeanSetupper) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull("conditionBeanSetupper<RoutineScheduleMappingCB>", + conditionBeanSetupper); + if (userInfoList.isEmpty()) { + return; + } + loadRoutineScheduleMappingList( + userInfoList, + new LoadReferrerOption<RoutineScheduleMappingCB, RoutineScheduleMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadRoutineScheduleMappingList( + List<UserInfo> userInfoList, + LoadReferrerOption<RoutineScheduleMappingCB, RoutineScheduleMapping> loadReferrerOption) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull( + "loadReferrerOption<RoutineScheduleMapping, RoutineScheduleMappingCB>", + loadReferrerOption); + if (userInfoList.isEmpty()) { + return; + } + final RoutineScheduleMappingBhv referrerBhv = xgetBSFLR().select( + RoutineScheduleMappingBhv.class); + helpLoadReferrerInternally( + userInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<UserInfo, String, RoutineScheduleMappingCB, RoutineScheduleMapping>() { + public String callbackBase_getPrimaryKeyValue( + UserInfo entity) { + return entity.getUserId(); + } + + public void callbackBase_setReferrerList(UserInfo entity, + List<RoutineScheduleMapping> referrerList) { + entity.setRoutineScheduleMappingList(referrerList); + } + + public RoutineScheduleMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + RoutineScheduleMappingCB cb, List<String> pkList) { + cb.query().setUserId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + RoutineScheduleMappingCB cb) { + cb.query().addOrderBy_UserId_Asc(); + } + + public List<RoutineScheduleMapping> callbackReferrer_selectList( + RoutineScheduleMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + RoutineScheduleMapping entity) { + return entity.getUserId(); + } + + public void callbackReferrer_setForeignEntity( + RoutineScheduleMapping referrerEntity, + UserInfo baseEntity) { + referrerEntity.setUserInfo(baseEntity); + } + }); + } + + /** + * Load referrer of singleScheduleMappingList with the setupper for + * condition-bean of referrer. <br /> About internal policy, the value of + * primary key(and others too) is treated as case-insensitive. <br /> The + * condition-bean that the setupper provides have settings before you touch + * it. It is as follows: + * + * <pre> + * cb.query().setUserId_InScope(pkList); + * cb.query().addOrderBy_UserId_Asc(); + * </pre> + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param conditionBeanSetupper The instance of referrer condition-bean + * setupper for registering referrer condition. (NotNull) + */ + public void loadSingleScheduleMappingList(List<UserInfo> userInfoList, + ConditionBeanSetupper<SingleScheduleMappingCB> conditionBeanSetupper) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull("conditionBeanSetupper<SingleScheduleMappingCB>", + conditionBeanSetupper); + if (userInfoList.isEmpty()) { + return; + } + loadSingleScheduleMappingList( + userInfoList, + new LoadReferrerOption<SingleScheduleMappingCB, SingleScheduleMapping>( + conditionBeanSetupper)); + } + + /** + * {Refer to overload method that has an argument of condition-bean + * setupper.} + * + * @param userInfoList The entity list of userInfo. (NotNull) + * @param loadReferrerOption The option of load-referrer. (NotNull) + */ + public void loadSingleScheduleMappingList( + List<UserInfo> userInfoList, + LoadReferrerOption<SingleScheduleMappingCB, SingleScheduleMapping> loadReferrerOption) { + assertObjectNotNull("userInfoList<UserInfo>", userInfoList); + assertObjectNotNull( + "loadReferrerOption<SingleScheduleMapping, SingleScheduleMappingCB>", + loadReferrerOption); + if (userInfoList.isEmpty()) { + return; + } + final SingleScheduleMappingBhv referrerBhv = xgetBSFLR().select( + SingleScheduleMappingBhv.class); + helpLoadReferrerInternally( + userInfoList, + loadReferrerOption, + new InternalLoadReferrerCallback<UserInfo, String, SingleScheduleMappingCB, SingleScheduleMapping>() { + public String callbackBase_getPrimaryKeyValue( + UserInfo entity) { + return entity.getUserId(); + } + + public void callbackBase_setReferrerList(UserInfo entity, + List<SingleScheduleMapping> referrerList) { + entity.setSingleScheduleMappingList(referrerList); + } + + public SingleScheduleMappingCB callbackReferrer_newMyConditionBean() { + return referrerBhv.newMyConditionBean(); + } + + public void callbackReferrer_queryForeignKeyInScope( + SingleScheduleMappingCB cb, List<String> pkList) { + cb.query().setUserId_InScope(pkList); + } + + public void callbackReferrer_queryAddOrderByForeignKeyAsc( + SingleScheduleMappingCB cb) { + cb.query().addOrderBy_UserId_Asc(); + } + + public List<SingleScheduleMapping> callbackReferrer_selectList( + SingleScheduleMappingCB cb) { + return referrerBhv.selectList(cb); + } + + public String callbackReferrer_getForeignKeyValue( + SingleScheduleMapping entity) { + return entity.getUserId(); + } + + public void callbackReferrer_setForeignEntity( + SingleScheduleMapping referrerEntity, + UserInfo baseEntity) { + referrerEntity.setUserInfo(baseEntity); + } + }); + } + + //========================================================================== + // ========= + // Pullout Foreign + // =============== + /** + * Pull out the list of foreign table 'GroupInfo'. + * + * @param userInfoList The list of userInfo. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<GroupInfo> pulloutGroupInfo(List<UserInfo> userInfoList) { + return helpPulloutInternally(userInfoList, + new InternalPulloutCallback<UserInfo, GroupInfo>() { + public GroupInfo callbackGetForeignEntity(UserInfo entity) { + return entity.getGroupInfo(); + } + }); + } + + /** + * Pull out the list of foreign table 'RoleInfo'. + * + * @param userInfoList The list of userInfo. (NotNull) + * @return The list of foreign table. (NotNull) + */ + public List<RoleInfo> pulloutRoleInfo(List<UserInfo> userInfoList) { + return helpPulloutInternally(userInfoList, + new InternalPulloutCallback<UserInfo, RoleInfo>() { + public RoleInfo callbackGetForeignEntity(UserInfo entity) { + return entity.getRoleInfo(); + } + }); + } + + //========================================================================== + // ========= + // Entity Update + // ============= + /** + * Insert the entity. + * + * @param userInfo The entity of insert target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insert(UserInfo userInfo) { + assertEntityNotNull(userInfo); + delegateInsert(userInfo); + } + + @Override + protected void doCreate(Entity userInfo) { + insert((UserInfo) userInfo); + } + + /** + * Update the entity modified-only. {UpdateCountZeroException, + * ConcurrencyControl} + * + * @param userInfo The entity of update target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void update(final UserInfo userInfo) { + helpUpdateInternally(userInfo, new InternalUpdateCallback<UserInfo>() { + public int callbackDelegateUpdate(UserInfo entity) { + return delegateUpdate(entity); + } + }); + } + + @Override + protected void doModify(Entity entity) { + update((UserInfo) entity); + } + + /** + * Update the entity non-strictly modified-only. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param userInfo The entity of update target. (NotNull) + * {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void updateNonstrict(final UserInfo userInfo) { + helpUpdateNonstrictInternally(userInfo, + new InternalUpdateNonstrictCallback<UserInfo>() { + public int callbackDelegateUpdateNonstrict(UserInfo entity) { + return delegateUpdateNonstrict(entity); + } + }); + } + + @Override + protected void doModifyNonstrict(Entity entity) { + updateNonstrict((UserInfo) entity); + } + + /** + * Insert or update the entity modified-only. {ConcurrencyControl(when + * update)} + * + * @param userInfo The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdate(final UserInfo userInfo) { + helpInsertOrUpdateInternally(userInfo, + new InternalInsertOrUpdateCallback<UserInfo, UserInfoCB>() { + public void callbackInsert(UserInfo entity) { + insert(entity); + } + + public void callbackUpdate(UserInfo entity) { + update(entity); + } + + public UserInfoCB callbackNewMyConditionBean() { + return newMyConditionBean(); + } + + public int callbackSelectCount(UserInfoCB cb) { + return selectCount(cb); + } + }); + } + + @Override + protected void doCreateOrUpdate(Entity userInfo) { + insertOrUpdate((UserInfo) userInfo); + } + + /** + * Insert or update the entity non-strictly modified-only. + * {NonConcurrencyControl(when update)} + * + * @param userInfo The entity of insert or update target. (NotNull) + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyExistsException + * When the entity already exists. (Unique Constraint + * Violation) + */ + public void insertOrUpdateNonstrict(UserInfo userInfo) { + helpInsertOrUpdateInternally(userInfo, + new InternalInsertOrUpdateNonstrictCallback<UserInfo>() { + public void callbackInsert(UserInfo entity) { + insert(entity); + } + + public void callbackUpdateNonstrict(UserInfo entity) { + updateNonstrict(entity); + } + }); + } + + @Override + protected void doCreateOrUpdateNonstrict(Entity entity) { + insertOrUpdateNonstrict((UserInfo) entity); + } + + /** + * Delete the entity. {UpdateCountZeroException, ConcurrencyControl} + * + * @param userInfo The entity of delete target. (NotNull) + * {PrimaryKeyRequired, ConcurrencyColumnRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyUpdatedException + * When the entity has already been updated. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void delete(UserInfo userInfo) { + helpDeleteInternally(userInfo, new InternalDeleteCallback<UserInfo>() { + public int callbackDelegateDelete(UserInfo entity) { + return delegateDelete(entity); + } + }); + } + + @Override + protected void doRemove(Entity userInfo) { + delete((UserInfo) userInfo); + } + + /** + * Delete the entity non-strictly. {UpdateCountZeroException, + * NonConcurrencyControl} + * + * @param userInfo Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrict(UserInfo userInfo) { + helpDeleteNonstrictInternally(userInfo, + new InternalDeleteNonstrictCallback<UserInfo>() { + public int callbackDelegateDeleteNonstrict(UserInfo entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + /** + * Delete the entity non-strictly ignoring deleted. + * {UpdateCountZeroException, NonConcurrencyControl} + * + * @param userInfo Entity. (NotNull) {PrimaryKeyRequired} + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityDuplicatedException + * When the entity has been duplicated. + */ + public void deleteNonstrictIgnoreDeleted(UserInfo userInfo) { + helpDeleteNonstrictIgnoreDeletedInternally(userInfo, + new InternalDeleteNonstrictIgnoreDeletedCallback<UserInfo>() { + public int callbackDelegateDeleteNonstrict(UserInfo entity) { + return delegateDeleteNonstrict(entity); + } + }); + } + + //========================================================================== + // ========= + // Batch Update + // ============ + /** + * Batch insert the list. This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param userInfoList The list of the entity. (NotNull) + * @return The array of inserted count. + */ + public int[] batchInsert(List<UserInfo> userInfoList) { + assertObjectNotNull("userInfoList", userInfoList); + return delegateInsertList(userInfoList); + } + + /** + * Batch update the list. All columns are update target. {NOT modified only} + * <br /> This method use 'Batch Update' of java.sql.PreparedStatement. + * + * @param userInfoList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchUpdate(List<UserInfo> userInfoList) { + assertObjectNotNull("userInfoList", userInfoList); + return delegateUpdateList(userInfoList); + } + + /** + * Batch update the list non-strictly. All columns are update target. {NOT + * modified only} <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param userInfoList The list of the entity. (NotNull) + * @return The array of updated count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchUpdateNonstrict(List<UserInfo> userInfoList) { + assertObjectNotNull("userInfoList", userInfoList); + return delegateUpdateListNonstrict(userInfoList); + } + + /** + * Batch delete the list. <br /> This method use 'Batch Update' of + * java.sql.PreparedStatement. + * + * @param userInfoList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.BatchEntityAlreadyUpdatedException + * When the entity has already been updated. This exception + * extends ${glEntityAlreadyUpdateException}. + */ + public int[] batchDelete(List<UserInfo> userInfoList) { + assertObjectNotNull("userInfoList", userInfoList); + return delegateDeleteList(userInfoList); + } + + /** + * Batch delete the list non-strictly. <br /> This method use 'Batch Update' + * of java.sql.PreparedStatement. + * + * @param userInfoList The list of the entity. (NotNull) + * @return The array of deleted count. + * @exception jp.sf.pal.scheduler.db.allcommon.exception.EntityAlreadyDeletedException + * When the entity has already been deleted. + */ + public int[] batchDeleteNonstrict(List<UserInfo> userInfoList) { + assertObjectNotNull("userInfoList", userInfoList); + return delegateDeleteListNonstrict(userInfoList); + } + + //========================================================================== + // ========= + // Query Update + // ============ + /** + * Query update the several entities. {NoConcurrencyControl} + * + * @param userInfo Entity. (NotNull) {PrimaryKeyNotRequired} + * @param cb Condition-bean. (NotNull) + * @return The updated count. + */ + public int queryUpdate(UserInfo userInfo, UserInfoCB cb) { + assertObjectNotNull("userInfo", userInfo); + assertConditionBeanNotNull(cb); + setupCommonColumnOfUpdateIfNeeds(userInfo); + filterEntityOfUpdate(userInfo); + assertEntityOfUpdate(userInfo); + return getMyDao().updateByQuery(cb, userInfo); + } + + /** + * Query delete the several entities. {NoConcurrencyControl} + * + * @param cb Condition-bean. (NotNull) + * @return The deleted count. + */ + public int queryDelete(UserInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().deleteByQuery(cb); + } + + //========================================================================== + // ========= + // Various Update + // ============== + + //========================================================================== + // ========= + // Delegate Method + // =============== + // ----------------------------------------------------- + // Select + // ------ + protected int delegateSelectCount(UserInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectCount(cb); + } + + protected List<UserInfo> delegateSelectList(UserInfoCB cb) { + assertConditionBeanNotNull(cb); + return getMyDao().selectList(cb); + } + + // ----------------------------------------------------- + // Update + // ------ + protected int delegateInsert(UserInfo e) { + if (!processBeforeInsert(e)) { + return 1; + } + return getMyDao().insert(e); + } + + protected int delegateUpdate(UserInfo e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateModifiedOnly(e); + } + + protected int delegateUpdateNonstrict(UserInfo e) { + if (!processBeforeUpdate(e)) { + return 1; + } + return getMyDao().updateNonstrictModifiedOnly(e); + } + + protected int delegateDelete(UserInfo e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().delete(e); + } + + protected int delegateDeleteNonstrict(UserInfo e) { + if (!processBeforeDelete(e)) { + return 1; + } + return getMyDao().deleteNonstrict(e); + } + + protected int[] delegateInsertList(List<UserInfo> ls) { + assertObjectNotNull("userInfoList", ls); + return getMyDao().insertList(helpFilterBeforeInsertInternally(ls)); + } + + protected int[] delegateUpdateList(List<UserInfo> ls) { + assertObjectNotNull("userInfoList", ls); + return getMyDao().updateList(helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateUpdateListNonstrict(List<UserInfo> ls) { + assertObjectNotNull("userInfoList", ls); + return getMyDao().updateListNonstrict( + helpFilterBeforeUpdateInternally(ls)); + } + + protected int[] delegateDeleteList(List<UserInfo> ls) { + assertObjectNotNull("userInfoList", ls); + return getMyDao().deleteList(helpFilterBeforeDeleteInternally(ls)); + } + + protected int[] delegateDeleteListNonstrict(List<UserInfo> ls) { + assertObjectNotNull("userInfoList", ls); + return getMyDao().deleteListNonstrict( + helpFilterBeforeDeleteInternally(ls)); + } + + //========================================================================== + // ========= + // Optimistic Lock Info + // ==================== + @Override + protected boolean hasVersionNoValue(Entity entity) { + return !(downcast(entity).getVersionno() + "").equals("null");// For + // primitive + // type + } + + @Override + protected boolean hasUpdateDateValue(Entity entity) { + return false; + } + + //========================================================================== + // ========= + // Helper + // ====== + protected UserInfo downcast(Entity entity) { + return helpDowncastInternally(entity, UserInfo.class); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsbhv/BsUserInfoBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupInfoDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupInfoDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupInfoDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; + +/** + * The DAO interface of GROUP_INFO. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsGroupInfoDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = GroupInfo.class; // For S2Dao + + public int selectCount(GroupInfoCB cb); + + public List<GroupInfo> selectList(GroupInfoCB cb); + + int insert(GroupInfo entity); + + int updateModifiedOnly(GroupInfo entity); + + int updateNonstrictModifiedOnly(GroupInfo entity); + + int delete(GroupInfo entity); + + int deleteNonstrict(GroupInfo entity); + + int[] insertList(List<GroupInfo> entityList); + + int[] updateList(List<GroupInfo> entityList); + + int[] updateListNonstrict(List<GroupInfo> entityList); + + int updateByQuery(GroupInfoCB cb, GroupInfo entity); + + int[] deleteList(List<GroupInfo> entityList); + + int[] deleteListNonstrict(List<GroupInfo> entityList); + + int deleteByQuery(GroupInfoCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupInfoDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; + +/** + * The DAO interface of GROUP_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsGroupMappingDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = GroupMapping.class; // For S2Dao + + public int selectCount(GroupMappingCB cb); + + public List<GroupMapping> selectList(GroupMappingCB cb); + + int insert(GroupMapping entity); + + int updateModifiedOnly(GroupMapping entity); + + int delete(GroupMapping entity); + + int[] insertList(List<GroupMapping> entityList); + + int[] updateList(List<GroupMapping> entityList); + + int updateByQuery(GroupMappingCB cb, GroupMapping entity); + + int[] deleteList(List<GroupMapping> entityList); + + int deleteByQuery(GroupMappingCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsGroupMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleInfoDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleInfoDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleInfoDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; + +/** + * The DAO interface of ROLE_INFO. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsRoleInfoDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = RoleInfo.class; // For S2Dao + + public int selectCount(RoleInfoCB cb); + + public List<RoleInfo> selectList(RoleInfoCB cb); + + int insert(RoleInfo entity); + + int updateModifiedOnly(RoleInfo entity); + + int updateNonstrictModifiedOnly(RoleInfo entity); + + int delete(RoleInfo entity); + + int deleteNonstrict(RoleInfo entity); + + int[] insertList(List<RoleInfo> entityList); + + int[] updateList(List<RoleInfo> entityList); + + int[] updateListNonstrict(List<RoleInfo> entityList); + + int updateByQuery(RoleInfoCB cb, RoleInfo entity); + + int[] deleteList(List<RoleInfo> entityList); + + int[] deleteListNonstrict(List<RoleInfo> entityList); + + int deleteByQuery(RoleInfoCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleInfoDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; + +/** + * The DAO interface of ROLE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsRoleMappingDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = RoleMapping.class; // For S2Dao + + public int selectCount(RoleMappingCB cb); + + public List<RoleMapping> selectList(RoleMappingCB cb); + + int insert(RoleMapping entity); + + int updateModifiedOnly(RoleMapping entity); + + int delete(RoleMapping entity); + + int[] insertList(List<RoleMapping> entityList); + + int[] updateList(List<RoleMapping> entityList); + + int updateByQuery(RoleMappingCB cb, RoleMapping entity); + + int[] deleteList(List<RoleMapping> entityList); + + int deleteByQuery(RoleMappingCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoleMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleContentDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleContentDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleContentDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleContentCB; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent; + +/** + * The DAO interface of ROUTINE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsRoutineScheduleContentDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = RoutineScheduleContent.class; // For S2Dao + + public int selectCount(RoutineScheduleContentCB cb); + + public List<RoutineScheduleContent> selectList(RoutineScheduleContentCB cb); + + int insert(RoutineScheduleContent entity); + + int updateModifiedOnly(RoutineScheduleContent entity); + + int delete(RoutineScheduleContent entity); + + int[] insertList(List<RoutineScheduleContent> entityList); + + int[] updateList(List<RoutineScheduleContent> entityList); + + int updateByQuery(RoutineScheduleContentCB cb, RoutineScheduleContent entity); + + int[] deleteList(List<RoutineScheduleContent> entityList); + + int deleteByQuery(RoutineScheduleContentCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleContentDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; + +/** + * The DAO interface of ROUTINE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsRoutineScheduleDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = RoutineSchedule.class; // For S2Dao + + public int selectCount(RoutineScheduleCB cb); + + public List<RoutineSchedule> selectList(RoutineScheduleCB cb); + + int insert(RoutineSchedule entity); + + int updateModifiedOnly(RoutineSchedule entity); + + int updateNonstrictModifiedOnly(RoutineSchedule entity); + + int delete(RoutineSchedule entity); + + int deleteNonstrict(RoutineSchedule entity); + + int[] insertList(List<RoutineSchedule> entityList); + + int[] updateList(List<RoutineSchedule> entityList); + + int[] updateListNonstrict(List<RoutineSchedule> entityList); + + int updateByQuery(RoutineScheduleCB cb, RoutineSchedule entity); + + int[] deleteList(List<RoutineSchedule> entityList); + + int[] deleteListNonstrict(List<RoutineSchedule> entityList); + + int deleteByQuery(RoutineScheduleCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; + +/** + * The DAO interface of ROUTINE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsRoutineScheduleMappingDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = RoutineScheduleMapping.class; // For S2Dao + + public int selectCount(RoutineScheduleMappingCB cb); + + public List<RoutineScheduleMapping> selectList(RoutineScheduleMappingCB cb); + + int insert(RoutineScheduleMapping entity); + + int updateModifiedOnly(RoutineScheduleMapping entity); + + int delete(RoutineScheduleMapping entity); + + int[] insertList(List<RoutineScheduleMapping> entityList); + + int[] updateList(List<RoutineScheduleMapping> entityList); + + int updateByQuery(RoutineScheduleMappingCB cb, RoutineScheduleMapping entity); + + int[] deleteList(List<RoutineScheduleMapping> entityList); + + int deleteByQuery(RoutineScheduleMappingCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsRoutineScheduleMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleContentDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleContentDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleContentDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.SingleScheduleContentCB; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleContent; + +/** + * The DAO interface of SINGLE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsSingleScheduleContentDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = SingleScheduleContent.class; // For S2Dao + + public int selectCount(SingleScheduleContentCB cb); + + public List<SingleScheduleContent> selectList(SingleScheduleContentCB cb); + + int insert(SingleScheduleContent entity); + + int updateModifiedOnly(SingleScheduleContent entity); + + int delete(SingleScheduleContent entity); + + int[] insertList(List<SingleScheduleContent> entityList); + + int[] updateList(List<SingleScheduleContent> entityList); + + int updateByQuery(SingleScheduleContentCB cb, SingleScheduleContent entity); + + int[] deleteList(List<SingleScheduleContent> entityList); + + int deleteByQuery(SingleScheduleContentCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleContentDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; + +/** + * The DAO interface of SINGLE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsSingleScheduleDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = SingleSchedule.class; // For S2Dao + + public int selectCount(SingleScheduleCB cb); + + public List<SingleSchedule> selectList(SingleScheduleCB cb); + + int insert(SingleSchedule entity); + + int updateModifiedOnly(SingleSchedule entity); + + int updateNonstrictModifiedOnly(SingleSchedule entity); + + int delete(SingleSchedule entity); + + int deleteNonstrict(SingleSchedule entity); + + int[] insertList(List<SingleSchedule> entityList); + + int[] updateList(List<SingleSchedule> entityList); + + int[] updateListNonstrict(List<SingleSchedule> entityList); + + int updateByQuery(SingleScheduleCB cb, SingleSchedule entity); + + int[] deleteList(List<SingleSchedule> entityList); + + int[] deleteListNonstrict(List<SingleSchedule> entityList); + + int deleteByQuery(SingleScheduleCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,37 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; + +/** + * The DAO interface of SINGLE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsSingleScheduleMappingDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = SingleScheduleMapping.class; // For S2Dao + + public int selectCount(SingleScheduleMappingCB cb); + + public List<SingleScheduleMapping> selectList(SingleScheduleMappingCB cb); + + int insert(SingleScheduleMapping entity); + + int updateModifiedOnly(SingleScheduleMapping entity); + + int delete(SingleScheduleMapping entity); + + int[] insertList(List<SingleScheduleMapping> entityList); + + int[] updateList(List<SingleScheduleMapping> entityList); + + int updateByQuery(SingleScheduleMappingCB cb, SingleScheduleMapping entity); + + int[] deleteList(List<SingleScheduleMapping> entityList); + + int deleteByQuery(SingleScheduleMappingCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsSingleScheduleMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsUserInfoDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsUserInfoDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsUserInfoDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.bsdao; + +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The DAO interface of USER_INFO. + * + * @author DBFlute(AutoGenerator) + */ +public interface BsUserInfoDao extends + jp.sf.pal.scheduler.db.allcommon.DaoWritable { + + public Class<?> BEAN = UserInfo.class; // For S2Dao + + public int selectCount(UserInfoCB cb); + + public List<UserInfo> selectList(UserInfoCB cb); + + int insert(UserInfo entity); + + int updateModifiedOnly(UserInfo entity); + + int updateNonstrictModifiedOnly(UserInfo entity); + + int delete(UserInfo entity); + + int deleteNonstrict(UserInfo entity); + + int[] insertList(List<UserInfo> entityList); + + int[] updateList(List<UserInfo> entityList); + + int[] updateListNonstrict(List<UserInfo> entityList); + + int updateByQuery(UserInfoCB cb, UserInfo entity); + + int[] deleteList(List<UserInfo> entityList); + + int[] deleteListNonstrict(List<UserInfo> entityList); + + int deleteByQuery(UserInfoCB cb); +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsdao/BsUserInfoDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,611 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The entity of GROUP_INFO that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * GROUP_ID + * + * [column] + * GROUP_ID, NAME, DESCRIPTION, EMAIL, URL, TELEPHONE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * GROUP_MAPPING, USER_INFO + * + * [foreign-property] + * + * + * [referrer-property] + * groupMappingList, userInfoList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsGroupInfo implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is GROUP_INFO. */ + public static final String TABLE = "GROUP_INFO"; + + /** VERSION_NO-Annotation */ + public static final String VERSION_NO_PROPERTY = "versionno"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** GROUP_ID: {PK : NotNull : VARCHAR(255)} */ + protected String _groupId; + + /** NAME: {VARCHAR(100)} */ + protected String _name; + + /** DESCRIPTION: {VARCHAR(255)} */ + protected String _description; + + /** EMAIL: {VARCHAR(255)} */ + protected String _email; + + /** URL: {VARCHAR(255)} */ + protected String _url; + + /** TELEPHONE: {VARCHAR(40)} */ + protected String _telephone; + + /** CREATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _createdTime; + + /** CREATED_BY: {NotNull : VARCHAR(255)} */ + protected String _createdBy; + + /** UPDATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _updatedTime; + + /** UPDATED_BY: {NotNull : VARCHAR(255)} */ + protected String _updatedBy; + + /** DELETED_TIME: {TIMESTAMP} */ + protected java.sql.Timestamp _deletedTime; + + /** DELETED_BY: {VARCHAR(255)} */ + protected String _deletedBy; + + /** VERSIONNO: {NotNull : INTEGER} */ + protected Integer _versionno; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsGroupInfo() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "GROUP_INFO"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "groupInfo"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + //========================================================================== + // ========= + // Referrer Property + // ================= + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [groupMappingList] + // * * * * * * * * */ + /** GROUP_MAPPING as 'groupMappingList'. */ + protected List<GroupMapping> _childrenGroupMappingList; + + /** + * GROUP_MAPPING as 'groupMappingList'. {without lazy-load} <br /> + * + * @return The entity list of referrer property 'groupMappingList'. + * (NotNull: If it's not loaded yet, initializes the list instance + * of referrer as empty and returns it.) + */ + public List<GroupMapping> getGroupMappingList() { + if (_childrenGroupMappingList == null) { + _childrenGroupMappingList = new ArrayList<GroupMapping>(); + } + return _childrenGroupMappingList; + } + + /** + * GROUP_MAPPING as 'groupMappingList'. + * + * @param groupMappingList The entity list of referrer property + * 'groupMappingList'. (Nullable) + */ + public void setGroupMappingList(List<GroupMapping> groupMappingList) { + _childrenGroupMappingList = groupMappingList; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [userInfoList] + // * * * * * * * * */ + /** USER_INFO as 'userInfoList'. */ + protected List<UserInfo> _childrenUserInfoList; + + /** + * USER_INFO as 'userInfoList'. {without lazy-load} <br /> + * + * @return The entity list of referrer property 'userInfoList'. (NotNull: If + * it's not loaded yet, initializes the list instance of referrer as + * empty and returns it.) + */ + public List<UserInfo> getUserInfoList() { + if (_childrenUserInfoList == null) { + _childrenUserInfoList = new ArrayList<UserInfo>(); + } + return _childrenUserInfoList; + } + + /** + * USER_INFO as 'userInfoList'. + * + * @param userInfoList The entity list of referrer property 'userInfoList'. + * (Nullable) + */ + public void setUserInfoList(List<UserInfo> userInfoList) { + _childrenUserInfoList = userInfoList; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_groupId == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsGroupInfo)) { + return false; + } + BsGroupInfo otherEntity = (BsGroupInfo) other; + if (!helpComparingValue(getGroupId(), otherEntity.getGroupId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getGroupId() != null) { + result = result + getGroupId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getName()); + sb.append(delimiter).append(getDescription()); + sb.append(delimiter).append(getEmail()); + sb.append(delimiter).append(getUrl()); + sb.append(delimiter).append(getTelephone()); + sb.append(delimiter).append(getCreatedTime()); + sb.append(delimiter).append(getCreatedBy()); + sb.append(delimiter).append(getUpdatedTime()); + sb.append(delimiter).append(getUpdatedBy()); + sb.append(delimiter).append(getDeletedTime()); + sb.append(delimiter).append(getDeletedBy()); + sb.append(delimiter).append(getVersionno()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : NotNull : VARCHAR(255)} */ + public static final String groupId_COLUMN = "GROUP_ID"; + + /** + * GROUP_ID: {PK : NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'GROUP_ID'. (Nullable) + */ + public String getGroupId() { + return _groupId; + } + + /** + * GROUP_ID: {PK : NotNull : VARCHAR(255)} <br /> + * + * @param groupId The value of the column 'GROUP_ID'. (Nullable) + */ + public void setGroupId(String groupId) { + _modifiedProperties.addPropertyName("groupId"); + this._groupId = groupId; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String name_COLUMN = "NAME"; + + /** + * NAME: {VARCHAR(100)} <br /> + * + * @return The value of the column 'NAME'. (Nullable) + */ + public String getName() { + return _name; + } + + /** + * NAME: {VARCHAR(100)} <br /> + * + * @param name The value of the column 'NAME'. (Nullable) + */ + public void setName(String name) { + _modifiedProperties.addPropertyName("name"); + this._name = name; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String description_COLUMN = "DESCRIPTION"; + + /** + * DESCRIPTION: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DESCRIPTION'. (Nullable) + */ + public String getDescription() { + return _description; + } + + /** + * DESCRIPTION: {VARCHAR(255)} <br /> + * + * @param description The value of the column 'DESCRIPTION'. (Nullable) + */ + public void setDescription(String description) { + _modifiedProperties.addPropertyName("description"); + this._description = description; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String email_COLUMN = "EMAIL"; + + /** + * EMAIL: {VARCHAR(255)} <br /> + * + * @return The value of the column 'EMAIL'. (Nullable) + */ + public String getEmail() { + return _email; + } + + /** + * EMAIL: {VARCHAR(255)} <br /> + * + * @param email The value of the column 'EMAIL'. (Nullable) + */ + public void setEmail(String email) { + _modifiedProperties.addPropertyName("email"); + this._email = email; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String url_COLUMN = "URL"; + + /** + * URL: {VARCHAR(255)} <br /> + * + * @return The value of the column 'URL'. (Nullable) + */ + public String getUrl() { + return _url; + } + + /** + * URL: {VARCHAR(255)} <br /> + * + * @param url The value of the column 'URL'. (Nullable) + */ + public void setUrl(String url) { + _modifiedProperties.addPropertyName("url"); + this._url = url; + } + + /** The column annotation for S2Dao. {VARCHAR(40)} */ + public static final String telephone_COLUMN = "TELEPHONE"; + + /** + * TELEPHONE: {VARCHAR(40)} <br /> + * + * @return The value of the column 'TELEPHONE'. (Nullable) + */ + public String getTelephone() { + return _telephone; + } + + /** + * TELEPHONE: {VARCHAR(40)} <br /> + * + * @param telephone The value of the column 'TELEPHONE'. (Nullable) + */ + public void setTelephone(String telephone) { + _modifiedProperties.addPropertyName("telephone"); + this._telephone = telephone; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String createdTime_COLUMN = "CREATED_TIME"; + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'CREATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getCreatedTime() { + return _createdTime; + } + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param createdTime The value of the column 'CREATED_TIME'. (Nullable) + */ + public void setCreatedTime(java.sql.Timestamp createdTime) { + _modifiedProperties.addPropertyName("createdTime"); + this._createdTime = createdTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String createdBy_COLUMN = "CREATED_BY"; + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'CREATED_BY'. (Nullable) + */ + public String getCreatedBy() { + return _createdBy; + } + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param createdBy The value of the column 'CREATED_BY'. (Nullable) + */ + public void setCreatedBy(String createdBy) { + _modifiedProperties.addPropertyName("createdBy"); + this._createdBy = createdBy; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String updatedTime_COLUMN = "UPDATED_TIME"; + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'UPDATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getUpdatedTime() { + return _updatedTime; + } + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param updatedTime The value of the column 'UPDATED_TIME'. (Nullable) + */ + public void setUpdatedTime(java.sql.Timestamp updatedTime) { + _modifiedProperties.addPropertyName("updatedTime"); + this._updatedTime = updatedTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String updatedBy_COLUMN = "UPDATED_BY"; + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'UPDATED_BY'. (Nullable) + */ + public String getUpdatedBy() { + return _updatedBy; + } + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param updatedBy The value of the column 'UPDATED_BY'. (Nullable) + */ + public void setUpdatedBy(String updatedBy) { + _modifiedProperties.addPropertyName("updatedBy"); + this._updatedBy = updatedBy; + } + + /** The column annotation for S2Dao. {TIMESTAMP} */ + public static final String deletedTime_COLUMN = "DELETED_TIME"; + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @return The value of the column 'DELETED_TIME'. (Nullable) + */ + public java.sql.Timestamp getDeletedTime() { + return _deletedTime; + } + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @param deletedTime The value of the column 'DELETED_TIME'. (Nullable) + */ + public void setDeletedTime(java.sql.Timestamp deletedTime) { + _modifiedProperties.addPropertyName("deletedTime"); + this._deletedTime = deletedTime; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String deletedBy_COLUMN = "DELETED_BY"; + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DELETED_BY'. (Nullable) + */ + public String getDeletedBy() { + return _deletedBy; + } + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @param deletedBy The value of the column 'DELETED_BY'. (Nullable) + */ + public void setDeletedBy(String deletedBy) { + _modifiedProperties.addPropertyName("deletedBy"); + this._deletedBy = deletedBy; + } + + /** The column annotation for S2Dao. {NotNull : INTEGER} */ + public static final String versionno_COLUMN = "VERSIONNO"; + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @return The value of the column 'VERSIONNO'. (Nullable) + */ + public Integer getVersionno() { + return _versionno; + } + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @param versionno The value of the column 'VERSIONNO'. (Nullable) + */ + public void setVersionno(Integer versionno) { + _modifiedProperties.addPropertyName("versionno"); + this._versionno = versionno; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,356 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The entity of GROUP_MAPPING that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, USER_ID, GROUP_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * GROUP_INFO, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * groupInfo, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsGroupMapping implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is GROUP_MAPPING. */ + public static final String TABLE = "GROUP_MAPPING"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : INTEGER} */ + protected Integer _id; + + /** USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} */ + protected String _userId; + + /** GROUP_ID: {NotNull : VARCHAR(255) : FK to GROUP_INFO} */ + protected String _groupId; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsGroupMapping() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "GROUP_MAPPING"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "groupMapping"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [groupInfo] + // * * * * * * * * */ + public static final int groupInfo_RELNO = 0; + + public static final String groupInfo_RELKEYS = "GROUP_ID:GROUP_ID"; + + /** GROUP_INFO as 'groupInfo'. */ + protected GroupInfo _parentGroupInfo; + + /** + * GROUP_INFO as 'groupInfo'. {without lazy-load} + * + * @return The entity of foreign property 'groupInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public GroupInfo getGroupInfo() { + return _parentGroupInfo; + } + + /** + * GROUP_INFO as 'groupInfo'. + * + * @param groupInfo The entity of foreign property 'groupInfo'. (Nullable) + */ + public void setGroupInfo(GroupInfo groupInfo) { + _parentGroupInfo = groupInfo; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [userInfo] + // * * * * * * * * */ + public static final int userInfo_RELNO = 1; + + public static final String userInfo_RELKEYS = "USER_ID:USER_ID"; + + /** USER_INFO as 'userInfo'. */ + protected UserInfo _parentUserInfo; + + /** + * USER_INFO as 'userInfo'. {without lazy-load} + * + * @return The entity of foreign property 'userInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public UserInfo getUserInfo() { + return _parentUserInfo; + } + + /** + * USER_INFO as 'userInfo'. + * + * @param userInfo The entity of foreign property 'userInfo'. (Nullable) + */ + public void setUserInfo(UserInfo userInfo) { + _parentUserInfo = userInfo; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsGroupMapping)) { + return false; + } + BsGroupMapping otherEntity = (BsGroupMapping) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getUserId()); + sb.append(delimiter).append(getGroupId()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : ID : NotNull : INTEGER} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : INTEGER} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Integer getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : INTEGER} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Integer id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** + * The column annotation for S2Dao. {NotNull : VARCHAR(255) : FK to + * USER_INFO} + */ + public static final String userId_COLUMN = "USER_ID"; + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @return The value of the column 'USER_ID'. (Nullable) + */ + public String getUserId() { + return _userId; + } + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @param userId The value of the column 'USER_ID'. (Nullable) + */ + public void setUserId(String userId) { + _modifiedProperties.addPropertyName("userId"); + this._userId = userId; + } + + /** + * The column annotation for S2Dao. {NotNull : VARCHAR(255) : FK to + * GROUP_INFO} + */ + public static final String groupId_COLUMN = "GROUP_ID"; + + /** + * GROUP_ID: {NotNull : VARCHAR(255) : FK to GROUP_INFO} <br /> + * + * @return The value of the column 'GROUP_ID'. (Nullable) + */ + public String getGroupId() { + return _groupId; + } + + /** + * GROUP_ID: {NotNull : VARCHAR(255) : FK to GROUP_INFO} <br /> + * + * @param groupId The value of the column 'GROUP_ID'. (Nullable) + */ + public void setGroupId(String groupId) { + _modifiedProperties.addPropertyName("groupId"); + this._groupId = groupId; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsGroupMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,611 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The entity of ROLE_INFO that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ROLE_ID + * + * [column] + * ROLE_ID, NAME, DESCRIPTION, EMAIL, URL, TELEPHONE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * ROLE_MAPPING, USER_INFO + * + * [foreign-property] + * + * + * [referrer-property] + * roleMappingList, userInfoList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsRoleInfo implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ROLE_INFO. */ + public static final String TABLE = "ROLE_INFO"; + + /** VERSION_NO-Annotation */ + public static final String VERSION_NO_PROPERTY = "versionno"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ROLE_ID: {PK : NotNull : VARCHAR(255)} */ + protected String _roleId; + + /** NAME: {VARCHAR(100)} */ + protected String _name; + + /** DESCRIPTION: {VARCHAR(255)} */ + protected String _description; + + /** EMAIL: {VARCHAR(255)} */ + protected String _email; + + /** URL: {VARCHAR(255)} */ + protected String _url; + + /** TELEPHONE: {VARCHAR(40)} */ + protected String _telephone; + + /** CREATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _createdTime; + + /** CREATED_BY: {NotNull : VARCHAR(255)} */ + protected String _createdBy; + + /** UPDATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _updatedTime; + + /** UPDATED_BY: {NotNull : VARCHAR(255)} */ + protected String _updatedBy; + + /** DELETED_TIME: {TIMESTAMP} */ + protected java.sql.Timestamp _deletedTime; + + /** DELETED_BY: {VARCHAR(255)} */ + protected String _deletedBy; + + /** VERSIONNO: {NotNull : INTEGER} */ + protected Integer _versionno; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoleInfo() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROLE_INFO"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "roleInfo"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + //========================================================================== + // ========= + // Referrer Property + // ================= + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [roleMappingList] + // * * * * * * * * */ + /** ROLE_MAPPING as 'roleMappingList'. */ + protected List<RoleMapping> _childrenRoleMappingList; + + /** + * ROLE_MAPPING as 'roleMappingList'. {without lazy-load} <br /> + * + * @return The entity list of referrer property 'roleMappingList'. (NotNull: + * If it's not loaded yet, initializes the list instance of referrer + * as empty and returns it.) + */ + public List<RoleMapping> getRoleMappingList() { + if (_childrenRoleMappingList == null) { + _childrenRoleMappingList = new ArrayList<RoleMapping>(); + } + return _childrenRoleMappingList; + } + + /** + * ROLE_MAPPING as 'roleMappingList'. + * + * @param roleMappingList The entity list of referrer property + * 'roleMappingList'. (Nullable) + */ + public void setRoleMappingList(List<RoleMapping> roleMappingList) { + _childrenRoleMappingList = roleMappingList; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [userInfoList] + // * * * * * * * * */ + /** USER_INFO as 'userInfoList'. */ + protected List<UserInfo> _childrenUserInfoList; + + /** + * USER_INFO as 'userInfoList'. {without lazy-load} <br /> + * + * @return The entity list of referrer property 'userInfoList'. (NotNull: If + * it's not loaded yet, initializes the list instance of referrer as + * empty and returns it.) + */ + public List<UserInfo> getUserInfoList() { + if (_childrenUserInfoList == null) { + _childrenUserInfoList = new ArrayList<UserInfo>(); + } + return _childrenUserInfoList; + } + + /** + * USER_INFO as 'userInfoList'. + * + * @param userInfoList The entity list of referrer property 'userInfoList'. + * (Nullable) + */ + public void setUserInfoList(List<UserInfo> userInfoList) { + _childrenUserInfoList = userInfoList; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_roleId == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsRoleInfo)) { + return false; + } + BsRoleInfo otherEntity = (BsRoleInfo) other; + if (!helpComparingValue(getRoleId(), otherEntity.getRoleId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getRoleId() != null) { + result = result + getRoleId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getRoleId()); + sb.append(delimiter).append(getName()); + sb.append(delimiter).append(getDescription()); + sb.append(delimiter).append(getEmail()); + sb.append(delimiter).append(getUrl()); + sb.append(delimiter).append(getTelephone()); + sb.append(delimiter).append(getCreatedTime()); + sb.append(delimiter).append(getCreatedBy()); + sb.append(delimiter).append(getUpdatedTime()); + sb.append(delimiter).append(getUpdatedBy()); + sb.append(delimiter).append(getDeletedTime()); + sb.append(delimiter).append(getDeletedBy()); + sb.append(delimiter).append(getVersionno()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : NotNull : VARCHAR(255)} */ + public static final String roleId_COLUMN = "ROLE_ID"; + + /** + * ROLE_ID: {PK : NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'ROLE_ID'. (Nullable) + */ + public String getRoleId() { + return _roleId; + } + + /** + * ROLE_ID: {PK : NotNull : VARCHAR(255)} <br /> + * + * @param roleId The value of the column 'ROLE_ID'. (Nullable) + */ + public void setRoleId(String roleId) { + _modifiedProperties.addPropertyName("roleId"); + this._roleId = roleId; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String name_COLUMN = "NAME"; + + /** + * NAME: {VARCHAR(100)} <br /> + * + * @return The value of the column 'NAME'. (Nullable) + */ + public String getName() { + return _name; + } + + /** + * NAME: {VARCHAR(100)} <br /> + * + * @param name The value of the column 'NAME'. (Nullable) + */ + public void setName(String name) { + _modifiedProperties.addPropertyName("name"); + this._name = name; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String description_COLUMN = "DESCRIPTION"; + + /** + * DESCRIPTION: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DESCRIPTION'. (Nullable) + */ + public String getDescription() { + return _description; + } + + /** + * DESCRIPTION: {VARCHAR(255)} <br /> + * + * @param description The value of the column 'DESCRIPTION'. (Nullable) + */ + public void setDescription(String description) { + _modifiedProperties.addPropertyName("description"); + this._description = description; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String email_COLUMN = "EMAIL"; + + /** + * EMAIL: {VARCHAR(255)} <br /> + * + * @return The value of the column 'EMAIL'. (Nullable) + */ + public String getEmail() { + return _email; + } + + /** + * EMAIL: {VARCHAR(255)} <br /> + * + * @param email The value of the column 'EMAIL'. (Nullable) + */ + public void setEmail(String email) { + _modifiedProperties.addPropertyName("email"); + this._email = email; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String url_COLUMN = "URL"; + + /** + * URL: {VARCHAR(255)} <br /> + * + * @return The value of the column 'URL'. (Nullable) + */ + public String getUrl() { + return _url; + } + + /** + * URL: {VARCHAR(255)} <br /> + * + * @param url The value of the column 'URL'. (Nullable) + */ + public void setUrl(String url) { + _modifiedProperties.addPropertyName("url"); + this._url = url; + } + + /** The column annotation for S2Dao. {VARCHAR(40)} */ + public static final String telephone_COLUMN = "TELEPHONE"; + + /** + * TELEPHONE: {VARCHAR(40)} <br /> + * + * @return The value of the column 'TELEPHONE'. (Nullable) + */ + public String getTelephone() { + return _telephone; + } + + /** + * TELEPHONE: {VARCHAR(40)} <br /> + * + * @param telephone The value of the column 'TELEPHONE'. (Nullable) + */ + public void setTelephone(String telephone) { + _modifiedProperties.addPropertyName("telephone"); + this._telephone = telephone; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String createdTime_COLUMN = "CREATED_TIME"; + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'CREATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getCreatedTime() { + return _createdTime; + } + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param createdTime The value of the column 'CREATED_TIME'. (Nullable) + */ + public void setCreatedTime(java.sql.Timestamp createdTime) { + _modifiedProperties.addPropertyName("createdTime"); + this._createdTime = createdTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String createdBy_COLUMN = "CREATED_BY"; + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'CREATED_BY'. (Nullable) + */ + public String getCreatedBy() { + return _createdBy; + } + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param createdBy The value of the column 'CREATED_BY'. (Nullable) + */ + public void setCreatedBy(String createdBy) { + _modifiedProperties.addPropertyName("createdBy"); + this._createdBy = createdBy; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String updatedTime_COLUMN = "UPDATED_TIME"; + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'UPDATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getUpdatedTime() { + return _updatedTime; + } + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param updatedTime The value of the column 'UPDATED_TIME'. (Nullable) + */ + public void setUpdatedTime(java.sql.Timestamp updatedTime) { + _modifiedProperties.addPropertyName("updatedTime"); + this._updatedTime = updatedTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String updatedBy_COLUMN = "UPDATED_BY"; + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'UPDATED_BY'. (Nullable) + */ + public String getUpdatedBy() { + return _updatedBy; + } + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param updatedBy The value of the column 'UPDATED_BY'. (Nullable) + */ + public void setUpdatedBy(String updatedBy) { + _modifiedProperties.addPropertyName("updatedBy"); + this._updatedBy = updatedBy; + } + + /** The column annotation for S2Dao. {TIMESTAMP} */ + public static final String deletedTime_COLUMN = "DELETED_TIME"; + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @return The value of the column 'DELETED_TIME'. (Nullable) + */ + public java.sql.Timestamp getDeletedTime() { + return _deletedTime; + } + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @param deletedTime The value of the column 'DELETED_TIME'. (Nullable) + */ + public void setDeletedTime(java.sql.Timestamp deletedTime) { + _modifiedProperties.addPropertyName("deletedTime"); + this._deletedTime = deletedTime; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String deletedBy_COLUMN = "DELETED_BY"; + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DELETED_BY'. (Nullable) + */ + public String getDeletedBy() { + return _deletedBy; + } + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @param deletedBy The value of the column 'DELETED_BY'. (Nullable) + */ + public void setDeletedBy(String deletedBy) { + _modifiedProperties.addPropertyName("deletedBy"); + this._deletedBy = deletedBy; + } + + /** The column annotation for S2Dao. {NotNull : INTEGER} */ + public static final String versionno_COLUMN = "VERSIONNO"; + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @return The value of the column 'VERSIONNO'. (Nullable) + */ + public Integer getVersionno() { + return _versionno; + } + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @param versionno The value of the column 'VERSIONNO'. (Nullable) + */ + public void setVersionno(Integer versionno) { + _modifiedProperties.addPropertyName("versionno"); + this._versionno = versionno; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,356 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The entity of ROLE_MAPPING that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, USER_ID, ROLE_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * ROLE_INFO, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * roleInfo, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsRoleMapping implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ROLE_MAPPING. */ + public static final String TABLE = "ROLE_MAPPING"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : INTEGER} */ + protected Integer _id; + + /** USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} */ + protected String _userId; + + /** ROLE_ID: {NotNull : VARCHAR(255) : FK to ROLE_INFO} */ + protected String _roleId; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoleMapping() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROLE_MAPPING"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "roleMapping"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [roleInfo] + // * * * * * * * * */ + public static final int roleInfo_RELNO = 0; + + public static final String roleInfo_RELKEYS = "ROLE_ID:ROLE_ID"; + + /** ROLE_INFO as 'roleInfo'. */ + protected RoleInfo _parentRoleInfo; + + /** + * ROLE_INFO as 'roleInfo'. {without lazy-load} + * + * @return The entity of foreign property 'roleInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public RoleInfo getRoleInfo() { + return _parentRoleInfo; + } + + /** + * ROLE_INFO as 'roleInfo'. + * + * @param roleInfo The entity of foreign property 'roleInfo'. (Nullable) + */ + public void setRoleInfo(RoleInfo roleInfo) { + _parentRoleInfo = roleInfo; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [userInfo] + // * * * * * * * * */ + public static final int userInfo_RELNO = 1; + + public static final String userInfo_RELKEYS = "USER_ID:USER_ID"; + + /** USER_INFO as 'userInfo'. */ + protected UserInfo _parentUserInfo; + + /** + * USER_INFO as 'userInfo'. {without lazy-load} + * + * @return The entity of foreign property 'userInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public UserInfo getUserInfo() { + return _parentUserInfo; + } + + /** + * USER_INFO as 'userInfo'. + * + * @param userInfo The entity of foreign property 'userInfo'. (Nullable) + */ + public void setUserInfo(UserInfo userInfo) { + _parentUserInfo = userInfo; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsRoleMapping)) { + return false; + } + BsRoleMapping otherEntity = (BsRoleMapping) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getUserId()); + sb.append(delimiter).append(getRoleId()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : ID : NotNull : INTEGER} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : INTEGER} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Integer getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : INTEGER} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Integer id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** + * The column annotation for S2Dao. {NotNull : VARCHAR(255) : FK to + * USER_INFO} + */ + public static final String userId_COLUMN = "USER_ID"; + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @return The value of the column 'USER_ID'. (Nullable) + */ + public String getUserId() { + return _userId; + } + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @param userId The value of the column 'USER_ID'. (Nullable) + */ + public void setUserId(String userId) { + _modifiedProperties.addPropertyName("userId"); + this._userId = userId; + } + + /** + * The column annotation for S2Dao. {NotNull : VARCHAR(255) : FK to + * ROLE_INFO} + */ + public static final String roleId_COLUMN = "ROLE_ID"; + + /** + * ROLE_ID: {NotNull : VARCHAR(255) : FK to ROLE_INFO} <br /> + * + * @return The value of the column 'ROLE_ID'. (Nullable) + */ + public String getRoleId() { + return _roleId; + } + + /** + * ROLE_ID: {NotNull : VARCHAR(255) : FK to ROLE_INFO} <br /> + * + * @param roleId The value of the column 'ROLE_ID'. (Nullable) + */ + public void setRoleId(String roleId) { + _modifiedProperties.addPropertyName("roleId"); + this._roleId = roleId; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoleMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineSchedule.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineSchedule.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineSchedule.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,673 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; + +/** + * The entity of ROUTINE_SCHEDULE that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, TITLE, LOCATION, START_DATE, START_TIME, END_DATE, END_TIME, TYPE, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * ROUTINE_SCHEDULE_CONTENT, ROUTINE_SCHEDULE_MAPPING + * + * [foreign-property] + * routineScheduleContentAsOne + * + * [referrer-property] + * routineScheduleMappingList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsRoutineSchedule implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ROUTINE_SCHEDULE. */ + public static final String TABLE = "ROUTINE_SCHEDULE"; + + /** VERSION_NO-Annotation */ + public static final String VERSION_NO_PROPERTY = "versionno"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : BIGINT} */ + protected Long _id; + + /** TITLE: {NotNull : VARCHAR(100)} */ + protected String _title; + + /** LOCATION: {VARCHAR(100)} */ + protected String _location; + + /** START_DATE: {NotNull : DATE} */ + protected java.util.Date _startDate; + + /** START_TIME: {TIME} */ + protected java.sql.Time _startTime; + + /** END_DATE: {DATE} */ + protected java.util.Date _endDate; + + /** END_TIME: {TIME} */ + protected java.sql.Time _endTime; + + /** TYPE: {NotNull : VARCHAR(10)} */ + protected String _type; + + /** CREATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _createdTime; + + /** CREATED_BY: {NotNull : VARCHAR(255)} */ + protected String _createdBy; + + /** UPDATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _updatedTime; + + /** UPDATED_BY: {NotNull : VARCHAR(255)} */ + protected String _updatedBy; + + /** DELETED_TIME: {TIMESTAMP} */ + protected java.sql.Timestamp _deletedTime; + + /** DELETED_BY: {VARCHAR(255)} */ + protected String _deletedBy; + + /** VERSIONNO: {NotNull : INTEGER} */ + protected Integer _versionno; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoutineSchedule() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "routineSchedule"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [routineScheduleContentAsOne] + // * * * * * * * * */ + public static final int routineScheduleContentAsOne_RELNO = 0; + + public static final String routineScheduleContentAsOne_RELKEYS = "ID:ID"; + + /** ROUTINE_SCHEDULE_CONTENT as 'routineScheduleContentAsOne'. */ + protected RoutineScheduleContent _childrenroutineScheduleContentAsOne; + + /** + * ROUTINE_SCHEDULE_CONTENT as 'routineScheduleContentAsOne'. {without + * lazy-load} <br /> + * + * @return the entity of foreign property(referrer-as-one) + * 'routineScheduleContentAsOne'. (Nullable: If the foreign key does + * not have 'NotNull' constraint, please check null.) + */ + public RoutineScheduleContent getRoutineScheduleContentAsOne() { + return _childrenroutineScheduleContentAsOne; + } + + /** + * ROUTINE_SCHEDULE_CONTENT as 'routineScheduleContentAsOne'. + * + * @param routineScheduleContentAsOne The entity of foreign + * property(referrer-as-one) 'routineScheduleContentAsOne'. + * (Nullable) + */ + public void setRoutineScheduleContentAsOne( + RoutineScheduleContent routineScheduleContentAsOne) { + _childrenroutineScheduleContentAsOne = routineScheduleContentAsOne; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [routineScheduleMappingList] + // * * * * * * * * */ + /** ROUTINE_SCHEDULE_MAPPING as 'routineScheduleMappingList'. */ + protected List<RoutineScheduleMapping> _childrenRoutineScheduleMappingList; + + /** + * ROUTINE_SCHEDULE_MAPPING as 'routineScheduleMappingList'. {without + * lazy-load} <br /> + * + * @return The entity list of referrer property + * 'routineScheduleMappingList'. (NotNull: If it's not loaded yet, + * initializes the list instance of referrer as empty and returns + * it.) + */ + public List<RoutineScheduleMapping> getRoutineScheduleMappingList() { + if (_childrenRoutineScheduleMappingList == null) { + _childrenRoutineScheduleMappingList = new ArrayList<RoutineScheduleMapping>(); + } + return _childrenRoutineScheduleMappingList; + } + + /** + * ROUTINE_SCHEDULE_MAPPING as 'routineScheduleMappingList'. + * + * @param routineScheduleMappingList The entity list of referrer property + * 'routineScheduleMappingList'. (Nullable) + */ + public void setRoutineScheduleMappingList( + List<RoutineScheduleMapping> routineScheduleMappingList) { + _childrenRoutineScheduleMappingList = routineScheduleMappingList; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsRoutineSchedule)) { + return false; + } + BsRoutineSchedule otherEntity = (BsRoutineSchedule) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getTitle()); + sb.append(delimiter).append(getLocation()); + sb.append(delimiter).append(getStartDate()); + sb.append(delimiter).append(getStartTime()); + sb.append(delimiter).append(getEndDate()); + sb.append(delimiter).append(getEndTime()); + sb.append(delimiter).append(getType()); + sb.append(delimiter).append(getCreatedTime()); + sb.append(delimiter).append(getCreatedBy()); + sb.append(delimiter).append(getUpdatedTime()); + sb.append(delimiter).append(getUpdatedBy()); + sb.append(delimiter).append(getDeletedTime()); + sb.append(delimiter).append(getDeletedBy()); + sb.append(delimiter).append(getVersionno()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : ID : NotNull : BIGINT} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Long id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(100)} */ + public static final String title_COLUMN = "TITLE"; + + /** + * TITLE: {NotNull : VARCHAR(100)} <br /> + * + * @return The value of the column 'TITLE'. (Nullable) + */ + public String getTitle() { + return _title; + } + + /** + * TITLE: {NotNull : VARCHAR(100)} <br /> + * + * @param title The value of the column 'TITLE'. (Nullable) + */ + public void setTitle(String title) { + _modifiedProperties.addPropertyName("title"); + this._title = title; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String location_COLUMN = "LOCATION"; + + /** + * LOCATION: {VARCHAR(100)} <br /> + * + * @return The value of the column 'LOCATION'. (Nullable) + */ + public String getLocation() { + return _location; + } + + /** + * LOCATION: {VARCHAR(100)} <br /> + * + * @param location The value of the column 'LOCATION'. (Nullable) + */ + public void setLocation(String location) { + _modifiedProperties.addPropertyName("location"); + this._location = location; + } + + /** The column annotation for S2Dao. {NotNull : DATE} */ + public static final String startDate_COLUMN = "START_DATE"; + + /** + * START_DATE: {NotNull : DATE} <br /> + * + * @return The value of the column 'START_DATE'. (Nullable) + */ + public java.util.Date getStartDate() { + return _startDate; + } + + /** + * START_DATE: {NotNull : DATE} <br /> + * + * @param startDate The value of the column 'START_DATE'. (Nullable) + */ + public void setStartDate(java.util.Date startDate) { + _modifiedProperties.addPropertyName("startDate"); + this._startDate = startDate; + } + + /** The column annotation for S2Dao. {TIME} */ + public static final String startTime_COLUMN = "START_TIME"; + + /** + * START_TIME: {TIME} <br /> + * + * @return The value of the column 'START_TIME'. (Nullable) + */ + public java.sql.Time getStartTime() { + return _startTime; + } + + /** + * START_TIME: {TIME} <br /> + * + * @param startTime The value of the column 'START_TIME'. (Nullable) + */ + public void setStartTime(java.sql.Time startTime) { + _modifiedProperties.addPropertyName("startTime"); + this._startTime = startTime; + } + + /** The column annotation for S2Dao. {DATE} */ + public static final String endDate_COLUMN = "END_DATE"; + + /** + * END_DATE: {DATE} <br /> + * + * @return The value of the column 'END_DATE'. (Nullable) + */ + public java.util.Date getEndDate() { + return _endDate; + } + + /** + * END_DATE: {DATE} <br /> + * + * @param endDate The value of the column 'END_DATE'. (Nullable) + */ + public void setEndDate(java.util.Date endDate) { + _modifiedProperties.addPropertyName("endDate"); + this._endDate = endDate; + } + + /** The column annotation for S2Dao. {TIME} */ + public static final String endTime_COLUMN = "END_TIME"; + + /** + * END_TIME: {TIME} <br /> + * + * @return The value of the column 'END_TIME'. (Nullable) + */ + public java.sql.Time getEndTime() { + return _endTime; + } + + /** + * END_TIME: {TIME} <br /> + * + * @param endTime The value of the column 'END_TIME'. (Nullable) + */ + public void setEndTime(java.sql.Time endTime) { + _modifiedProperties.addPropertyName("endTime"); + this._endTime = endTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(10)} */ + public static final String type_COLUMN = "TYPE"; + + /** + * TYPE: {NotNull : VARCHAR(10)} <br /> + * + * @return The value of the column 'TYPE'. (Nullable) + */ + public String getType() { + return _type; + } + + /** + * TYPE: {NotNull : VARCHAR(10)} <br /> + * + * @param type The value of the column 'TYPE'. (Nullable) + */ + public void setType(String type) { + _modifiedProperties.addPropertyName("type"); + this._type = type; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String createdTime_COLUMN = "CREATED_TIME"; + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'CREATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getCreatedTime() { + return _createdTime; + } + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param createdTime The value of the column 'CREATED_TIME'. (Nullable) + */ + public void setCreatedTime(java.sql.Timestamp createdTime) { + _modifiedProperties.addPropertyName("createdTime"); + this._createdTime = createdTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String createdBy_COLUMN = "CREATED_BY"; + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'CREATED_BY'. (Nullable) + */ + public String getCreatedBy() { + return _createdBy; + } + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param createdBy The value of the column 'CREATED_BY'. (Nullable) + */ + public void setCreatedBy(String createdBy) { + _modifiedProperties.addPropertyName("createdBy"); + this._createdBy = createdBy; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String updatedTime_COLUMN = "UPDATED_TIME"; + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'UPDATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getUpdatedTime() { + return _updatedTime; + } + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param updatedTime The value of the column 'UPDATED_TIME'. (Nullable) + */ + public void setUpdatedTime(java.sql.Timestamp updatedTime) { + _modifiedProperties.addPropertyName("updatedTime"); + this._updatedTime = updatedTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String updatedBy_COLUMN = "UPDATED_BY"; + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'UPDATED_BY'. (Nullable) + */ + public String getUpdatedBy() { + return _updatedBy; + } + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param updatedBy The value of the column 'UPDATED_BY'. (Nullable) + */ + public void setUpdatedBy(String updatedBy) { + _modifiedProperties.addPropertyName("updatedBy"); + this._updatedBy = updatedBy; + } + + /** The column annotation for S2Dao. {TIMESTAMP} */ + public static final String deletedTime_COLUMN = "DELETED_TIME"; + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @return The value of the column 'DELETED_TIME'. (Nullable) + */ + public java.sql.Timestamp getDeletedTime() { + return _deletedTime; + } + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @param deletedTime The value of the column 'DELETED_TIME'. (Nullable) + */ + public void setDeletedTime(java.sql.Timestamp deletedTime) { + _modifiedProperties.addPropertyName("deletedTime"); + this._deletedTime = deletedTime; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String deletedBy_COLUMN = "DELETED_BY"; + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DELETED_BY'. (Nullable) + */ + public String getDeletedBy() { + return _deletedBy; + } + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @param deletedBy The value of the column 'DELETED_BY'. (Nullable) + */ + public void setDeletedBy(String deletedBy) { + _modifiedProperties.addPropertyName("deletedBy"); + this._deletedBy = deletedBy; + } + + /** The column annotation for S2Dao. {NotNull : INTEGER} */ + public static final String versionno_COLUMN = "VERSIONNO"; + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @return The value of the column 'VERSIONNO'. (Nullable) + */ + public Integer getVersionno() { + return _versionno; + } + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @param versionno The value of the column 'VERSIONNO'. (Nullable) + */ + public void setVersionno(Integer versionno) { + _modifiedProperties.addPropertyName("versionno"); + this._versionno = versionno; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineSchedule.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleContent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleContent.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleContent.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,295 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; + +/** + * The entity of ROUTINE_SCHEDULE_CONTENT that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, CONTENT + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * + * + * [foreign-table] + * ROUTINE_SCHEDULE + * + * [referrer-table] + * + * + * [foreign-property] + * routineSchedule + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsRoutineScheduleContent implements Entity, + java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ROUTINE_SCHEDULE_CONTENT. */ + public static final String TABLE = "ROUTINE_SCHEDULE_CONTENT"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : NotNull : BIGINT : FK to ROUTINE_SCHEDULE} */ + protected Long _id; + + /** CONTENT: {VARCHAR(1000)} */ + protected String _content; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoutineScheduleContent() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "routineScheduleContent"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [routineSchedule] + // * * * * * * * * */ + public static final int routineSchedule_RELNO = 0; + + public static final String routineSchedule_RELKEYS = "ID:ID"; + + /** ROUTINE_SCHEDULE as 'routineSchedule'. */ + protected RoutineSchedule _parentRoutineSchedule; + + /** + * ROUTINE_SCHEDULE as 'routineSchedule'. {without lazy-load} + * + * @return The entity of foreign property 'routineSchedule'. (Nullable: If + * the foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public RoutineSchedule getRoutineSchedule() { + return _parentRoutineSchedule; + } + + /** + * ROUTINE_SCHEDULE as 'routineSchedule'. + * + * @param routineSchedule The entity of foreign property 'routineSchedule'. + * (Nullable) + */ + public void setRoutineSchedule(RoutineSchedule routineSchedule) { + _parentRoutineSchedule = routineSchedule; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsRoutineScheduleContent)) { + return false; + } + BsRoutineScheduleContent otherEntity = (BsRoutineScheduleContent) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getContent()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** + * The column annotation for S2Dao. {PK : NotNull : BIGINT : FK to + * ROUTINE_SCHEDULE} + */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : NotNull : BIGINT : FK to ROUTINE_SCHEDULE} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : NotNull : BIGINT : FK to ROUTINE_SCHEDULE} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Long id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** The column annotation for S2Dao. {VARCHAR(1000)} */ + public static final String content_COLUMN = "CONTENT"; + + /** + * CONTENT: {VARCHAR(1000)} <br /> + * + * @return The value of the column 'CONTENT'. (Nullable) + */ + public String getContent() { + return _content; + } + + /** + * CONTENT: {VARCHAR(1000)} <br /> + * + * @param content The value of the column 'CONTENT'. (Nullable) + */ + public void setContent(String content) { + _modifiedProperties.addPropertyName("content"); + this._content = content; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleContent.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,358 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The entity of ROUTINE_SCHEDULE_MAPPING that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, SCHEDULE_ID, USER_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * ROUTINE_SCHEDULE, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * routineSchedule, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsRoutineScheduleMapping implements Entity, + java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is ROUTINE_SCHEDULE_MAPPING. */ + public static final String TABLE = "ROUTINE_SCHEDULE_MAPPING"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : BIGINT} */ + protected Long _id; + + /** SCHEDULE_ID: {NotNull : BIGINT : FK to ROUTINE_SCHEDULE} */ + protected Long _scheduleId; + + /** USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} */ + protected String _userId; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoutineScheduleMapping() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "routineScheduleMapping"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [routineSchedule] + // * * * * * * * * */ + public static final int routineSchedule_RELNO = 0; + + public static final String routineSchedule_RELKEYS = "SCHEDULE_ID:ID"; + + /** ROUTINE_SCHEDULE as 'routineSchedule'. */ + protected RoutineSchedule _parentRoutineSchedule; + + /** + * ROUTINE_SCHEDULE as 'routineSchedule'. {without lazy-load} + * + * @return The entity of foreign property 'routineSchedule'. (Nullable: If + * the foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public RoutineSchedule getRoutineSchedule() { + return _parentRoutineSchedule; + } + + /** + * ROUTINE_SCHEDULE as 'routineSchedule'. + * + * @param routineSchedule The entity of foreign property 'routineSchedule'. + * (Nullable) + */ + public void setRoutineSchedule(RoutineSchedule routineSchedule) { + _parentRoutineSchedule = routineSchedule; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [userInfo] + // * * * * * * * * */ + public static final int userInfo_RELNO = 1; + + public static final String userInfo_RELKEYS = "USER_ID:USER_ID"; + + /** USER_INFO as 'userInfo'. */ + protected UserInfo _parentUserInfo; + + /** + * USER_INFO as 'userInfo'. {without lazy-load} + * + * @return The entity of foreign property 'userInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public UserInfo getUserInfo() { + return _parentUserInfo; + } + + /** + * USER_INFO as 'userInfo'. + * + * @param userInfo The entity of foreign property 'userInfo'. (Nullable) + */ + public void setUserInfo(UserInfo userInfo) { + _parentUserInfo = userInfo; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsRoutineScheduleMapping)) { + return false; + } + BsRoutineScheduleMapping otherEntity = (BsRoutineScheduleMapping) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getScheduleId()); + sb.append(delimiter).append(getUserId()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : ID : NotNull : BIGINT} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Long id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** + * The column annotation for S2Dao. {NotNull : BIGINT : FK to + * ROUTINE_SCHEDULE} + */ + public static final String scheduleId_COLUMN = "SCHEDULE_ID"; + + /** + * SCHEDULE_ID: {NotNull : BIGINT : FK to ROUTINE_SCHEDULE} <br /> + * + * @return The value of the column 'SCHEDULE_ID'. (Nullable) + */ + public Long getScheduleId() { + return _scheduleId; + } + + /** + * SCHEDULE_ID: {NotNull : BIGINT : FK to ROUTINE_SCHEDULE} <br /> + * + * @param scheduleId The value of the column 'SCHEDULE_ID'. (Nullable) + */ + public void setScheduleId(Long scheduleId) { + _modifiedProperties.addPropertyName("scheduleId"); + this._scheduleId = scheduleId; + } + + /** + * The column annotation for S2Dao. {NotNull : VARCHAR(255) : FK to + * USER_INFO} + */ + public static final String userId_COLUMN = "USER_ID"; + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @return The value of the column 'USER_ID'. (Nullable) + */ + public String getUserId() { + return _userId; + } + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @param userId The value of the column 'USER_ID'. (Nullable) + */ + public void setUserId(String userId) { + _modifiedProperties.addPropertyName("userId"); + this._userId = userId; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsRoutineScheduleMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleSchedule.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleSchedule.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleSchedule.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,646 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleContent; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; + +/** + * The entity of SINGLE_SCHEDULE that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, TITLE, LOCATION, START_DATE, START_TIME, END_DATE, END_TIME, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * + * + * [referrer-table] + * SINGLE_SCHEDULE_CONTENT, SINGLE_SCHEDULE_MAPPING + * + * [foreign-property] + * singleScheduleContentAsOne + * + * [referrer-property] + * singleScheduleMappingList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsSingleSchedule implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is SINGLE_SCHEDULE. */ + public static final String TABLE = "SINGLE_SCHEDULE"; + + /** VERSION_NO-Annotation */ + public static final String VERSION_NO_PROPERTY = "versionno"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : BIGINT} */ + protected Long _id; + + /** TITLE: {NotNull : VARCHAR(100)} */ + protected String _title; + + /** LOCATION: {VARCHAR(100)} */ + protected String _location; + + /** START_DATE: {NotNull : DATE} */ + protected java.util.Date _startDate; + + /** START_TIME: {TIME} */ + protected java.sql.Time _startTime; + + /** END_DATE: {NotNull : DATE} */ + protected java.util.Date _endDate; + + /** END_TIME: {TIME} */ + protected java.sql.Time _endTime; + + /** CREATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _createdTime; + + /** CREATED_BY: {NotNull : VARCHAR(255)} */ + protected String _createdBy; + + /** UPDATED_TIME: {TIMESTAMP} */ + protected java.sql.Timestamp _updatedTime; + + /** UPDATED_BY: {VARCHAR(255)} */ + protected String _updatedBy; + + /** DELETED_TIME: {TIMESTAMP} */ + protected java.sql.Timestamp _deletedTime; + + /** DELETED_BY: {VARCHAR(255)} */ + protected String _deletedBy; + + /** VERSIONNO: {NotNull : INTEGER} */ + protected Integer _versionno; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsSingleSchedule() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "singleSchedule"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [singleScheduleContentAsOne] + // * * * * * * * * */ + public static final int singleScheduleContentAsOne_RELNO = 0; + + public static final String singleScheduleContentAsOne_RELKEYS = "ID:ID"; + + /** SINGLE_SCHEDULE_CONTENT as 'singleScheduleContentAsOne'. */ + protected SingleScheduleContent _childrensingleScheduleContentAsOne; + + /** + * SINGLE_SCHEDULE_CONTENT as 'singleScheduleContentAsOne'. {without + * lazy-load} <br /> + * + * @return the entity of foreign property(referrer-as-one) + * 'singleScheduleContentAsOne'. (Nullable: If the foreign key does + * not have 'NotNull' constraint, please check null.) + */ + public SingleScheduleContent getSingleScheduleContentAsOne() { + return _childrensingleScheduleContentAsOne; + } + + /** + * SINGLE_SCHEDULE_CONTENT as 'singleScheduleContentAsOne'. + * + * @param singleScheduleContentAsOne The entity of foreign + * property(referrer-as-one) 'singleScheduleContentAsOne'. + * (Nullable) + */ + public void setSingleScheduleContentAsOne( + SingleScheduleContent singleScheduleContentAsOne) { + _childrensingleScheduleContentAsOne = singleScheduleContentAsOne; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [singleScheduleMappingList] + // * * * * * * * * */ + /** SINGLE_SCHEDULE_MAPPING as 'singleScheduleMappingList'. */ + protected List<SingleScheduleMapping> _childrenSingleScheduleMappingList; + + /** + * SINGLE_SCHEDULE_MAPPING as 'singleScheduleMappingList'. {without + * lazy-load} <br /> + * + * @return The entity list of referrer property 'singleScheduleMappingList'. + * (NotNull: If it's not loaded yet, initializes the list instance + * of referrer as empty and returns it.) + */ + public List<SingleScheduleMapping> getSingleScheduleMappingList() { + if (_childrenSingleScheduleMappingList == null) { + _childrenSingleScheduleMappingList = new ArrayList<SingleScheduleMapping>(); + } + return _childrenSingleScheduleMappingList; + } + + /** + * SINGLE_SCHEDULE_MAPPING as 'singleScheduleMappingList'. + * + * @param singleScheduleMappingList The entity list of referrer property + * 'singleScheduleMappingList'. (Nullable) + */ + public void setSingleScheduleMappingList( + List<SingleScheduleMapping> singleScheduleMappingList) { + _childrenSingleScheduleMappingList = singleScheduleMappingList; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsSingleSchedule)) { + return false; + } + BsSingleSchedule otherEntity = (BsSingleSchedule) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getTitle()); + sb.append(delimiter).append(getLocation()); + sb.append(delimiter).append(getStartDate()); + sb.append(delimiter).append(getStartTime()); + sb.append(delimiter).append(getEndDate()); + sb.append(delimiter).append(getEndTime()); + sb.append(delimiter).append(getCreatedTime()); + sb.append(delimiter).append(getCreatedBy()); + sb.append(delimiter).append(getUpdatedTime()); + sb.append(delimiter).append(getUpdatedBy()); + sb.append(delimiter).append(getDeletedTime()); + sb.append(delimiter).append(getDeletedBy()); + sb.append(delimiter).append(getVersionno()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : ID : NotNull : BIGINT} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Long id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(100)} */ + public static final String title_COLUMN = "TITLE"; + + /** + * TITLE: {NotNull : VARCHAR(100)} <br /> + * + * @return The value of the column 'TITLE'. (Nullable) + */ + public String getTitle() { + return _title; + } + + /** + * TITLE: {NotNull : VARCHAR(100)} <br /> + * + * @param title The value of the column 'TITLE'. (Nullable) + */ + public void setTitle(String title) { + _modifiedProperties.addPropertyName("title"); + this._title = title; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String location_COLUMN = "LOCATION"; + + /** + * LOCATION: {VARCHAR(100)} <br /> + * + * @return The value of the column 'LOCATION'. (Nullable) + */ + public String getLocation() { + return _location; + } + + /** + * LOCATION: {VARCHAR(100)} <br /> + * + * @param location The value of the column 'LOCATION'. (Nullable) + */ + public void setLocation(String location) { + _modifiedProperties.addPropertyName("location"); + this._location = location; + } + + /** The column annotation for S2Dao. {NotNull : DATE} */ + public static final String startDate_COLUMN = "START_DATE"; + + /** + * START_DATE: {NotNull : DATE} <br /> + * + * @return The value of the column 'START_DATE'. (Nullable) + */ + public java.util.Date getStartDate() { + return _startDate; + } + + /** + * START_DATE: {NotNull : DATE} <br /> + * + * @param startDate The value of the column 'START_DATE'. (Nullable) + */ + public void setStartDate(java.util.Date startDate) { + _modifiedProperties.addPropertyName("startDate"); + this._startDate = startDate; + } + + /** The column annotation for S2Dao. {TIME} */ + public static final String startTime_COLUMN = "START_TIME"; + + /** + * START_TIME: {TIME} <br /> + * + * @return The value of the column 'START_TIME'. (Nullable) + */ + public java.sql.Time getStartTime() { + return _startTime; + } + + /** + * START_TIME: {TIME} <br /> + * + * @param startTime The value of the column 'START_TIME'. (Nullable) + */ + public void setStartTime(java.sql.Time startTime) { + _modifiedProperties.addPropertyName("startTime"); + this._startTime = startTime; + } + + /** The column annotation for S2Dao. {NotNull : DATE} */ + public static final String endDate_COLUMN = "END_DATE"; + + /** + * END_DATE: {NotNull : DATE} <br /> + * + * @return The value of the column 'END_DATE'. (Nullable) + */ + public java.util.Date getEndDate() { + return _endDate; + } + + /** + * END_DATE: {NotNull : DATE} <br /> + * + * @param endDate The value of the column 'END_DATE'. (Nullable) + */ + public void setEndDate(java.util.Date endDate) { + _modifiedProperties.addPropertyName("endDate"); + this._endDate = endDate; + } + + /** The column annotation for S2Dao. {TIME} */ + public static final String endTime_COLUMN = "END_TIME"; + + /** + * END_TIME: {TIME} <br /> + * + * @return The value of the column 'END_TIME'. (Nullable) + */ + public java.sql.Time getEndTime() { + return _endTime; + } + + /** + * END_TIME: {TIME} <br /> + * + * @param endTime The value of the column 'END_TIME'. (Nullable) + */ + public void setEndTime(java.sql.Time endTime) { + _modifiedProperties.addPropertyName("endTime"); + this._endTime = endTime; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String createdTime_COLUMN = "CREATED_TIME"; + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'CREATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getCreatedTime() { + return _createdTime; + } + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param createdTime The value of the column 'CREATED_TIME'. (Nullable) + */ + public void setCreatedTime(java.sql.Timestamp createdTime) { + _modifiedProperties.addPropertyName("createdTime"); + this._createdTime = createdTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String createdBy_COLUMN = "CREATED_BY"; + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'CREATED_BY'. (Nullable) + */ + public String getCreatedBy() { + return _createdBy; + } + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param createdBy The value of the column 'CREATED_BY'. (Nullable) + */ + public void setCreatedBy(String createdBy) { + _modifiedProperties.addPropertyName("createdBy"); + this._createdBy = createdBy; + } + + /** The column annotation for S2Dao. {TIMESTAMP} */ + public static final String updatedTime_COLUMN = "UPDATED_TIME"; + + /** + * UPDATED_TIME: {TIMESTAMP} <br /> + * + * @return The value of the column 'UPDATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getUpdatedTime() { + return _updatedTime; + } + + /** + * UPDATED_TIME: {TIMESTAMP} <br /> + * + * @param updatedTime The value of the column 'UPDATED_TIME'. (Nullable) + */ + public void setUpdatedTime(java.sql.Timestamp updatedTime) { + _modifiedProperties.addPropertyName("updatedTime"); + this._updatedTime = updatedTime; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String updatedBy_COLUMN = "UPDATED_BY"; + + /** + * UPDATED_BY: {VARCHAR(255)} <br /> + * + * @return The value of the column 'UPDATED_BY'. (Nullable) + */ + public String getUpdatedBy() { + return _updatedBy; + } + + /** + * UPDATED_BY: {VARCHAR(255)} <br /> + * + * @param updatedBy The value of the column 'UPDATED_BY'. (Nullable) + */ + public void setUpdatedBy(String updatedBy) { + _modifiedProperties.addPropertyName("updatedBy"); + this._updatedBy = updatedBy; + } + + /** The column annotation for S2Dao. {TIMESTAMP} */ + public static final String deletedTime_COLUMN = "DELETED_TIME"; + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @return The value of the column 'DELETED_TIME'. (Nullable) + */ + public java.sql.Timestamp getDeletedTime() { + return _deletedTime; + } + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @param deletedTime The value of the column 'DELETED_TIME'. (Nullable) + */ + public void setDeletedTime(java.sql.Timestamp deletedTime) { + _modifiedProperties.addPropertyName("deletedTime"); + this._deletedTime = deletedTime; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String deletedBy_COLUMN = "DELETED_BY"; + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DELETED_BY'. (Nullable) + */ + public String getDeletedBy() { + return _deletedBy; + } + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @param deletedBy The value of the column 'DELETED_BY'. (Nullable) + */ + public void setDeletedBy(String deletedBy) { + _modifiedProperties.addPropertyName("deletedBy"); + this._deletedBy = deletedBy; + } + + /** The column annotation for S2Dao. {NotNull : INTEGER} */ + public static final String versionno_COLUMN = "VERSIONNO"; + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @return The value of the column 'VERSIONNO'. (Nullable) + */ + public Integer getVersionno() { + return _versionno; + } + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @param versionno The value of the column 'VERSIONNO'. (Nullable) + */ + public void setVersionno(Integer versionno) { + _modifiedProperties.addPropertyName("versionno"); + this._versionno = versionno; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleSchedule.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleContent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleContent.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleContent.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,295 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; + +/** + * The entity of SINGLE_SCHEDULE_CONTENT that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, CONTENT + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * + * + * [foreign-table] + * SINGLE_SCHEDULE + * + * [referrer-table] + * + * + * [foreign-property] + * singleSchedule + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsSingleScheduleContent implements Entity, + java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is SINGLE_SCHEDULE_CONTENT. */ + public static final String TABLE = "SINGLE_SCHEDULE_CONTENT"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : NotNull : BIGINT : FK to SINGLE_SCHEDULE} */ + protected Long _id; + + /** CONTENT: {VARCHAR(1000)} */ + protected String _content; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsSingleScheduleContent() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "singleScheduleContent"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [singleSchedule] + // * * * * * * * * */ + public static final int singleSchedule_RELNO = 0; + + public static final String singleSchedule_RELKEYS = "ID:ID"; + + /** SINGLE_SCHEDULE as 'singleSchedule'. */ + protected SingleSchedule _parentSingleSchedule; + + /** + * SINGLE_SCHEDULE as 'singleSchedule'. {without lazy-load} + * + * @return The entity of foreign property 'singleSchedule'. (Nullable: If + * the foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public SingleSchedule getSingleSchedule() { + return _parentSingleSchedule; + } + + /** + * SINGLE_SCHEDULE as 'singleSchedule'. + * + * @param singleSchedule The entity of foreign property 'singleSchedule'. + * (Nullable) + */ + public void setSingleSchedule(SingleSchedule singleSchedule) { + _parentSingleSchedule = singleSchedule; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsSingleScheduleContent)) { + return false; + } + BsSingleScheduleContent otherEntity = (BsSingleScheduleContent) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getContent()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** + * The column annotation for S2Dao. {PK : NotNull : BIGINT : FK to + * SINGLE_SCHEDULE} + */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : NotNull : BIGINT : FK to SINGLE_SCHEDULE} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : NotNull : BIGINT : FK to SINGLE_SCHEDULE} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Long id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** The column annotation for S2Dao. {VARCHAR(1000)} */ + public static final String content_COLUMN = "CONTENT"; + + /** + * CONTENT: {VARCHAR(1000)} <br /> + * + * @return The value of the column 'CONTENT'. (Nullable) + */ + public String getContent() { + return _content; + } + + /** + * CONTENT: {VARCHAR(1000)} <br /> + * + * @param content The value of the column 'CONTENT'. (Nullable) + */ + public void setContent(String content) { + _modifiedProperties.addPropertyName("content"); + this._content = content; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleContent.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,358 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The entity of SINGLE_SCHEDULE_MAPPING that the type is TABLE. <br /> + * + * <pre> + * [primary-key] + * ID + * + * [column] + * ID, SCHEDULE_ID, USER_ID + * + * [sequence] + * + * + * [identity] + * ID + * + * [version-no] + * + * + * [foreign-table] + * SINGLE_SCHEDULE, USER_INFO + * + * [referrer-table] + * + * + * [foreign-property] + * singleSchedule, userInfo + * + * [referrer-property] + * + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsSingleScheduleMapping implements Entity, + java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is SINGLE_SCHEDULE_MAPPING. */ + public static final String TABLE = "SINGLE_SCHEDULE_MAPPING"; + + /** ID-Annotation */ + public static final String id_ID = "identity"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** ID: {PK : ID : NotNull : BIGINT} */ + protected Long _id; + + /** SCHEDULE_ID: {NotNull : BIGINT : FK to SINGLE_SCHEDULE} */ + protected Long _scheduleId; + + /** USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} */ + protected String _userId; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsSingleScheduleMapping() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "singleScheduleMapping"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [singleSchedule] + // * * * * * * * * */ + public static final int singleSchedule_RELNO = 0; + + public static final String singleSchedule_RELKEYS = "SCHEDULE_ID:ID"; + + /** SINGLE_SCHEDULE as 'singleSchedule'. */ + protected SingleSchedule _parentSingleSchedule; + + /** + * SINGLE_SCHEDULE as 'singleSchedule'. {without lazy-load} + * + * @return The entity of foreign property 'singleSchedule'. (Nullable: If + * the foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public SingleSchedule getSingleSchedule() { + return _parentSingleSchedule; + } + + /** + * SINGLE_SCHEDULE as 'singleSchedule'. + * + * @param singleSchedule The entity of foreign property 'singleSchedule'. + * (Nullable) + */ + public void setSingleSchedule(SingleSchedule singleSchedule) { + _parentSingleSchedule = singleSchedule; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [userInfo] + // * * * * * * * * */ + public static final int userInfo_RELNO = 1; + + public static final String userInfo_RELKEYS = "USER_ID:USER_ID"; + + /** USER_INFO as 'userInfo'. */ + protected UserInfo _parentUserInfo; + + /** + * USER_INFO as 'userInfo'. {without lazy-load} + * + * @return The entity of foreign property 'userInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public UserInfo getUserInfo() { + return _parentUserInfo; + } + + /** + * USER_INFO as 'userInfo'. + * + * @param userInfo The entity of foreign property 'userInfo'. (Nullable) + */ + public void setUserInfo(UserInfo userInfo) { + _parentUserInfo = userInfo; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_id == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsSingleScheduleMapping)) { + return false; + } + BsSingleScheduleMapping otherEntity = (BsSingleScheduleMapping) other; + if (!helpComparingValue(getId(), otherEntity.getId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getId() != null) { + result = result + getId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getId()); + sb.append(delimiter).append(getScheduleId()); + sb.append(delimiter).append(getUserId()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : ID : NotNull : BIGINT} */ + public static final String id_COLUMN = "ID"; + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @return The value of the column 'ID'. (Nullable) + */ + public Long getId() { + return _id; + } + + /** + * ID: {PK : ID : NotNull : BIGINT} <br /> + * + * @param id The value of the column 'ID'. (Nullable) + */ + public void setId(Long id) { + _modifiedProperties.addPropertyName("id"); + this._id = id; + } + + /** + * The column annotation for S2Dao. {NotNull : BIGINT : FK to + * SINGLE_SCHEDULE} + */ + public static final String scheduleId_COLUMN = "SCHEDULE_ID"; + + /** + * SCHEDULE_ID: {NotNull : BIGINT : FK to SINGLE_SCHEDULE} <br /> + * + * @return The value of the column 'SCHEDULE_ID'. (Nullable) + */ + public Long getScheduleId() { + return _scheduleId; + } + + /** + * SCHEDULE_ID: {NotNull : BIGINT : FK to SINGLE_SCHEDULE} <br /> + * + * @param scheduleId The value of the column 'SCHEDULE_ID'. (Nullable) + */ + public void setScheduleId(Long scheduleId) { + _modifiedProperties.addPropertyName("scheduleId"); + this._scheduleId = scheduleId; + } + + /** + * The column annotation for S2Dao. {NotNull : VARCHAR(255) : FK to + * USER_INFO} + */ + public static final String userId_COLUMN = "USER_ID"; + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @return The value of the column 'USER_ID'. (Nullable) + */ + public String getUserId() { + return _userId; + } + + /** + * USER_ID: {NotNull : VARCHAR(255) : FK to USER_INFO} <br /> + * + * @param userId The value of the column 'USER_ID'. (Nullable) + */ + public void setUserId(String userId) { + _modifiedProperties.addPropertyName("userId"); + this._userId = userId; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsSingleScheduleMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsUserInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsUserInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsUserInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,950 @@ +package jp.sf.pal.scheduler.db.bsentity; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.DBMetaInstanceHandler; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; + +/** + * The entity 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, ROLE_ID, GROUP_ID, CREATED_TIME, CREATED_BY, UPDATED_TIME, UPDATED_BY, DELETED_TIME, DELETED_BY, VERSIONNO + * + * [sequence] + * + * + * [identity] + * + * + * [version-no] + * VERSIONNO + * + * [foreign-table] + * GROUP_INFO, ROLE_INFO + * + * [referrer-table] + * GROUP_MAPPING, ROLE_MAPPING, ROUTINE_SCHEDULE_MAPPING, SINGLE_SCHEDULE_MAPPING + * + * [foreign-property] + * groupInfo, roleInfo + * + * [referrer-property] + * groupMappingList, roleMappingList, routineScheduleMappingList, singleScheduleMappingList + * </pre> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class BsUserInfo implements Entity, java.io.Serializable { + + //========================================================================== + // ========= + // Definition + // ========== + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + /** TABLE-Annotation for S2Dao. The value is USER_INFO. */ + public static final String TABLE = "USER_INFO"; + + /** VERSION_NO-Annotation */ + public static final String VERSION_NO_PROPERTY = "versionno"; + + //========================================================================== + // ========= + // Attribute + // ========= + // ----------------------------------------------------- + // Column + // ------ + /** USER_ID: {PK : NotNull : VARCHAR(255)} */ + protected String _userId; + + /** GIVEN_NAME: {VARCHAR(100)} */ + protected String _givenName; + + /** FAMILY_NAME: {VARCHAR(100)} */ + protected String _familyName; + + /** MIDDLE_NAME: {VARCHAR(50)} */ + protected String _middleName; + + /** GIVEN_NAME_DESC: {VARCHAR(100)} */ + protected String _givenNameDesc; + + /** FAMILY_NAME_DESC: {VARCHAR(100)} */ + protected String _familyNameDesc; + + /** NICKNAME: {VARCHAR(100)} */ + protected String _nickname; + + /** GENDER: {VARCHAR(1)} */ + protected String _gender; + + /** BIRTH_DATE: {DATE} */ + protected java.util.Date _birthDate; + + /** EMAIL: {VARCHAR(255)} */ + protected String _email; + + /** URL: {VARCHAR(255)} */ + protected String _url; + + /** TELEPHONE: {VARCHAR(40)} */ + protected String _telephone; + + /** ROLE_ID: {VARCHAR(255) : FK to ROLE_INFO} */ + protected String _roleId; + + /** GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} */ + protected String _groupId; + + /** CREATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _createdTime; + + /** CREATED_BY: {NotNull : VARCHAR(255)} */ + protected String _createdBy; + + /** UPDATED_TIME: {NotNull : TIMESTAMP} */ + protected java.sql.Timestamp _updatedTime; + + /** UPDATED_BY: {NotNull : VARCHAR(255)} */ + protected String _updatedBy; + + /** DELETED_TIME: {TIMESTAMP} */ + protected java.sql.Timestamp _deletedTime; + + /** DELETED_BY: {VARCHAR(255)} */ + protected String _deletedBy; + + /** VERSIONNO: {NotNull : INTEGER} */ + protected Integer _versionno; + + // ----------------------------------------------------- + // Internal + // -------- + /** The attribute of entity modified properties. (for S2Dao) */ + protected EntityModifiedProperties _modifiedProperties = newEntityModifiedProperties(); + + //========================================================================== + // ========= + // Constructor + // =========== + public BsUserInfo() { + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "USER_INFO"; + } + + public String getTablePropertyName() {// as JavaBeansRule + return "userInfo"; + } + + //========================================================================== + // ========= + // DBMeta + // ====== + public DBMeta getDBMeta() { + return DBMetaInstanceHandler.findDBMeta(getTableDbName()); + } + + //========================================================================== + // ========= + // Classification Classifying + // ========================== + //========================================================================== + // ========= + // Classification Determination + // ============================ + //========================================================================== + // ========= + // Classification Name/Alias + // ========================= + //========================================================================== + // ========= + // Foreign Property + // ================ + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [groupInfo] + // * * * * * * * * */ + public static final int groupInfo_RELNO = 0; + + public static final String groupInfo_RELKEYS = "GROUP_ID:GROUP_ID"; + + /** GROUP_INFO as 'groupInfo'. */ + protected GroupInfo _parentGroupInfo; + + /** + * GROUP_INFO as 'groupInfo'. {without lazy-load} + * + * @return The entity of foreign property 'groupInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public GroupInfo getGroupInfo() { + return _parentGroupInfo; + } + + /** + * GROUP_INFO as 'groupInfo'. + * + * @param groupInfo The entity of foreign property 'groupInfo'. (Nullable) + */ + public void setGroupInfo(GroupInfo groupInfo) { + _parentGroupInfo = groupInfo; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Foreign Property = [roleInfo] + // * * * * * * * * */ + public static final int roleInfo_RELNO = 1; + + public static final String roleInfo_RELKEYS = "ROLE_ID:ROLE_ID"; + + /** ROLE_INFO as 'roleInfo'. */ + protected RoleInfo _parentRoleInfo; + + /** + * ROLE_INFO as 'roleInfo'. {without lazy-load} + * + * @return The entity of foreign property 'roleInfo'. (Nullable: If the + * foreign key does not have 'NotNull' constraint, please check + * null.) + */ + public RoleInfo getRoleInfo() { + return _parentRoleInfo; + } + + /** + * ROLE_INFO as 'roleInfo'. + * + * @param roleInfo The entity of foreign property 'roleInfo'. (Nullable) + */ + public void setRoleInfo(RoleInfo roleInfo) { + _parentRoleInfo = roleInfo; + } + + //========================================================================== + // ========= + // Referrer Property + // ================= + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [groupMappingList] + // * * * * * * * * */ + /** GROUP_MAPPING as 'groupMappingList'. */ + protected List<GroupMapping> _childrenGroupMappingList; + + /** + * GROUP_MAPPING as 'groupMappingList'. {without lazy-load} <br /> + * + * @return The entity list of referrer property 'groupMappingList'. + * (NotNull: If it's not loaded yet, initializes the list instance + * of referrer as empty and returns it.) + */ + public List<GroupMapping> getGroupMappingList() { + if (_childrenGroupMappingList == null) { + _childrenGroupMappingList = new ArrayList<GroupMapping>(); + } + return _childrenGroupMappingList; + } + + /** + * GROUP_MAPPING as 'groupMappingList'. + * + * @param groupMappingList The entity list of referrer property + * 'groupMappingList'. (Nullable) + */ + public void setGroupMappingList(List<GroupMapping> groupMappingList) { + _childrenGroupMappingList = groupMappingList; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [roleMappingList] + // * * * * * * * * */ + /** ROLE_MAPPING as 'roleMappingList'. */ + protected List<RoleMapping> _childrenRoleMappingList; + + /** + * ROLE_MAPPING as 'roleMappingList'. {without lazy-load} <br /> + * + * @return The entity list of referrer property 'roleMappingList'. (NotNull: + * If it's not loaded yet, initializes the list instance of referrer + * as empty and returns it.) + */ + public List<RoleMapping> getRoleMappingList() { + if (_childrenRoleMappingList == null) { + _childrenRoleMappingList = new ArrayList<RoleMapping>(); + } + return _childrenRoleMappingList; + } + + /** + * ROLE_MAPPING as 'roleMappingList'. + * + * @param roleMappingList The entity list of referrer property + * 'roleMappingList'. (Nullable) + */ + public void setRoleMappingList(List<RoleMapping> roleMappingList) { + _childrenRoleMappingList = roleMappingList; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [routineScheduleMappingList] + // * * * * * * * * */ + /** ROUTINE_SCHEDULE_MAPPING as 'routineScheduleMappingList'. */ + protected List<RoutineScheduleMapping> _childrenRoutineScheduleMappingList; + + /** + * ROUTINE_SCHEDULE_MAPPING as 'routineScheduleMappingList'. {without + * lazy-load} <br /> + * + * @return The entity list of referrer property + * 'routineScheduleMappingList'. (NotNull: If it's not loaded yet, + * initializes the list instance of referrer as empty and returns + * it.) + */ + public List<RoutineScheduleMapping> getRoutineScheduleMappingList() { + if (_childrenRoutineScheduleMappingList == null) { + _childrenRoutineScheduleMappingList = new ArrayList<RoutineScheduleMapping>(); + } + return _childrenRoutineScheduleMappingList; + } + + /** + * ROUTINE_SCHEDULE_MAPPING as 'routineScheduleMappingList'. + * + * @param routineScheduleMappingList The entity list of referrer property + * 'routineScheduleMappingList'. (Nullable) + */ + public void setRoutineScheduleMappingList( + List<RoutineScheduleMapping> routineScheduleMappingList) { + _childrenRoutineScheduleMappingList = routineScheduleMappingList; + } + + // /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + // Referrer Property = [singleScheduleMappingList] + // * * * * * * * * */ + /** SINGLE_SCHEDULE_MAPPING as 'singleScheduleMappingList'. */ + protected List<SingleScheduleMapping> _childrenSingleScheduleMappingList; + + /** + * SINGLE_SCHEDULE_MAPPING as 'singleScheduleMappingList'. {without + * lazy-load} <br /> + * + * @return The entity list of referrer property 'singleScheduleMappingList'. + * (NotNull: If it's not loaded yet, initializes the list instance + * of referrer as empty and returns it.) + */ + public List<SingleScheduleMapping> getSingleScheduleMappingList() { + if (_childrenSingleScheduleMappingList == null) { + _childrenSingleScheduleMappingList = new ArrayList<SingleScheduleMapping>(); + } + return _childrenSingleScheduleMappingList; + } + + /** + * SINGLE_SCHEDULE_MAPPING as 'singleScheduleMappingList'. + * + * @param singleScheduleMappingList The entity list of referrer property + * 'singleScheduleMappingList'. (Nullable) + */ + public void setSingleScheduleMappingList( + List<SingleScheduleMapping> singleScheduleMappingList) { + _childrenSingleScheduleMappingList = singleScheduleMappingList; + } + + //========================================================================== + // ========= + // Determination + // ============= + public boolean hasPrimaryKeyValue() { + if (_userId == null) { + return false; + } + return true; + } + + //========================================================================== + // ========= + // Modified Properties + // =================== + public Set<String> getModifiedPropertyNames() { + return _modifiedProperties.getPropertyNames(); + } + + protected EntityModifiedProperties newEntityModifiedProperties() { + return new EntityModifiedProperties(); + } + + public void clearModifiedPropertyNames() { + _modifiedProperties.clear(); + } + + public boolean hasModification() { + return !_modifiedProperties.isEmpty(); + } + + //========================================================================== + // ========= + // Basic Override + // ============== + /** + * If the primary-key of the other is same as this one, returns true. + * + * @param other Other entity. + * @return Comparing result. + */ + public boolean equals(Object other) { + if (other == null || !(other instanceof BsUserInfo)) { + return false; + } + BsUserInfo otherEntity = (BsUserInfo) other; + if (!helpComparingValue(getUserId(), otherEntity.getUserId())) { + return false; + } + return true; + } + + protected boolean helpComparingValue(Object value1, Object value2) { + if (value1 == null && value2 == null) { + return true; + } + return value1 != null && value2 != null && value1.equals(value2); + } + + /** + * Calculates hash-code from primary-key. + * + * @return Hash-code from primary-keys. + */ + public int hashCode() { + int result = 17; + if (this.getUserId() != null) { + result = result + getUserId().hashCode(); + } + return result; + } + + /** + * @return The view string of columns. (NotNull) + */ + public String toString() { + String delimiter = ","; + StringBuilder sb = new StringBuilder(); + sb.append(delimiter).append(getUserId()); + sb.append(delimiter).append(getGivenName()); + sb.append(delimiter).append(getFamilyName()); + sb.append(delimiter).append(getMiddleName()); + sb.append(delimiter).append(getGivenNameDesc()); + sb.append(delimiter).append(getFamilyNameDesc()); + sb.append(delimiter).append(getNickname()); + sb.append(delimiter).append(getGender()); + sb.append(delimiter).append(getBirthDate()); + sb.append(delimiter).append(getEmail()); + sb.append(delimiter).append(getUrl()); + sb.append(delimiter).append(getTelephone()); + sb.append(delimiter).append(getRoleId()); + sb.append(delimiter).append(getGroupId()); + sb.append(delimiter).append(getCreatedTime()); + sb.append(delimiter).append(getCreatedBy()); + sb.append(delimiter).append(getUpdatedTime()); + sb.append(delimiter).append(getUpdatedBy()); + sb.append(delimiter).append(getDeletedTime()); + sb.append(delimiter).append(getDeletedBy()); + sb.append(delimiter).append(getVersionno()); + if (sb.length() > 0) { + sb.delete(0, delimiter.length()); + } + sb.insert(0, "{").append("}"); + return sb.toString(); + } + + //========================================================================== + // ========= + // Accessor + // ======== + + /** The column annotation for S2Dao. {PK : NotNull : VARCHAR(255)} */ + public static final String userId_COLUMN = "USER_ID"; + + /** + * USER_ID: {PK : NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'USER_ID'. (Nullable) + */ + public String getUserId() { + return _userId; + } + + /** + * USER_ID: {PK : NotNull : VARCHAR(255)} <br /> + * + * @param userId The value of the column 'USER_ID'. (Nullable) + */ + public void setUserId(String userId) { + _modifiedProperties.addPropertyName("userId"); + this._userId = userId; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String givenName_COLUMN = "GIVEN_NAME"; + + /** + * GIVEN_NAME: {VARCHAR(100)} <br /> + * + * @return The value of the column 'GIVEN_NAME'. (Nullable) + */ + public String getGivenName() { + return _givenName; + } + + /** + * GIVEN_NAME: {VARCHAR(100)} <br /> + * + * @param givenName The value of the column 'GIVEN_NAME'. (Nullable) + */ + public void setGivenName(String givenName) { + _modifiedProperties.addPropertyName("givenName"); + this._givenName = givenName; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String familyName_COLUMN = "FAMILY_NAME"; + + /** + * FAMILY_NAME: {VARCHAR(100)} <br /> + * + * @return The value of the column 'FAMILY_NAME'. (Nullable) + */ + public String getFamilyName() { + return _familyName; + } + + /** + * FAMILY_NAME: {VARCHAR(100)} <br /> + * + * @param familyName The value of the column 'FAMILY_NAME'. (Nullable) + */ + public void setFamilyName(String familyName) { + _modifiedProperties.addPropertyName("familyName"); + this._familyName = familyName; + } + + /** The column annotation for S2Dao. {VARCHAR(50)} */ + public static final String middleName_COLUMN = "MIDDLE_NAME"; + + /** + * MIDDLE_NAME: {VARCHAR(50)} <br /> + * + * @return The value of the column 'MIDDLE_NAME'. (Nullable) + */ + public String getMiddleName() { + return _middleName; + } + + /** + * MIDDLE_NAME: {VARCHAR(50)} <br /> + * + * @param middleName The value of the column 'MIDDLE_NAME'. (Nullable) + */ + public void setMiddleName(String middleName) { + _modifiedProperties.addPropertyName("middleName"); + this._middleName = middleName; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String givenNameDesc_COLUMN = "GIVEN_NAME_DESC"; + + /** + * GIVEN_NAME_DESC: {VARCHAR(100)} <br /> + * + * @return The value of the column 'GIVEN_NAME_DESC'. (Nullable) + */ + public String getGivenNameDesc() { + return _givenNameDesc; + } + + /** + * GIVEN_NAME_DESC: {VARCHAR(100)} <br /> + * + * @param givenNameDesc The value of the column 'GIVEN_NAME_DESC'. + * (Nullable) + */ + public void setGivenNameDesc(String givenNameDesc) { + _modifiedProperties.addPropertyName("givenNameDesc"); + this._givenNameDesc = givenNameDesc; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String familyNameDesc_COLUMN = "FAMILY_NAME_DESC"; + + /** + * FAMILY_NAME_DESC: {VARCHAR(100)} <br /> + * + * @return The value of the column 'FAMILY_NAME_DESC'. (Nullable) + */ + public String getFamilyNameDesc() { + return _familyNameDesc; + } + + /** + * FAMILY_NAME_DESC: {VARCHAR(100)} <br /> + * + * @param familyNameDesc The value of the column 'FAMILY_NAME_DESC'. + * (Nullable) + */ + public void setFamilyNameDesc(String familyNameDesc) { + _modifiedProperties.addPropertyName("familyNameDesc"); + this._familyNameDesc = familyNameDesc; + } + + /** The column annotation for S2Dao. {VARCHAR(100)} */ + public static final String nickname_COLUMN = "NICKNAME"; + + /** + * NICKNAME: {VARCHAR(100)} <br /> + * + * @return The value of the column 'NICKNAME'. (Nullable) + */ + public String getNickname() { + return _nickname; + } + + /** + * NICKNAME: {VARCHAR(100)} <br /> + * + * @param nickname The value of the column 'NICKNAME'. (Nullable) + */ + public void setNickname(String nickname) { + _modifiedProperties.addPropertyName("nickname"); + this._nickname = nickname; + } + + /** The column annotation for S2Dao. {VARCHAR(1)} */ + public static final String gender_COLUMN = "GENDER"; + + /** + * GENDER: {VARCHAR(1)} <br /> + * + * @return The value of the column 'GENDER'. (Nullable) + */ + public String getGender() { + return _gender; + } + + /** + * GENDER: {VARCHAR(1)} <br /> + * + * @param gender The value of the column 'GENDER'. (Nullable) + */ + public void setGender(String gender) { + _modifiedProperties.addPropertyName("gender"); + this._gender = gender; + } + + /** The column annotation for S2Dao. {DATE} */ + public static final String birthDate_COLUMN = "BIRTH_DATE"; + + /** + * BIRTH_DATE: {DATE} <br /> + * + * @return The value of the column 'BIRTH_DATE'. (Nullable) + */ + public java.util.Date getBirthDate() { + return _birthDate; + } + + /** + * BIRTH_DATE: {DATE} <br /> + * + * @param birthDate The value of the column 'BIRTH_DATE'. (Nullable) + */ + public void setBirthDate(java.util.Date birthDate) { + _modifiedProperties.addPropertyName("birthDate"); + this._birthDate = birthDate; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String email_COLUMN = "EMAIL"; + + /** + * EMAIL: {VARCHAR(255)} <br /> + * + * @return The value of the column 'EMAIL'. (Nullable) + */ + public String getEmail() { + return _email; + } + + /** + * EMAIL: {VARCHAR(255)} <br /> + * + * @param email The value of the column 'EMAIL'. (Nullable) + */ + public void setEmail(String email) { + _modifiedProperties.addPropertyName("email"); + this._email = email; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String url_COLUMN = "URL"; + + /** + * URL: {VARCHAR(255)} <br /> + * + * @return The value of the column 'URL'. (Nullable) + */ + public String getUrl() { + return _url; + } + + /** + * URL: {VARCHAR(255)} <br /> + * + * @param url The value of the column 'URL'. (Nullable) + */ + public void setUrl(String url) { + _modifiedProperties.addPropertyName("url"); + this._url = url; + } + + /** The column annotation for S2Dao. {VARCHAR(40)} */ + public static final String telephone_COLUMN = "TELEPHONE"; + + /** + * TELEPHONE: {VARCHAR(40)} <br /> + * + * @return The value of the column 'TELEPHONE'. (Nullable) + */ + public String getTelephone() { + return _telephone; + } + + /** + * TELEPHONE: {VARCHAR(40)} <br /> + * + * @param telephone The value of the column 'TELEPHONE'. (Nullable) + */ + public void setTelephone(String telephone) { + _modifiedProperties.addPropertyName("telephone"); + this._telephone = telephone; + } + + /** The column annotation for S2Dao. {VARCHAR(255) : FK to ROLE_INFO} */ + public static final String roleId_COLUMN = "ROLE_ID"; + + /** + * ROLE_ID: {VARCHAR(255) : FK to ROLE_INFO} <br /> + * + * @return The value of the column 'ROLE_ID'. (Nullable) + */ + public String getRoleId() { + return _roleId; + } + + /** + * ROLE_ID: {VARCHAR(255) : FK to ROLE_INFO} <br /> + * + * @param roleId The value of the column 'ROLE_ID'. (Nullable) + */ + public void setRoleId(String roleId) { + _modifiedProperties.addPropertyName("roleId"); + this._roleId = roleId; + } + + /** The column annotation for S2Dao. {VARCHAR(255) : FK to GROUP_INFO} */ + public static final String groupId_COLUMN = "GROUP_ID"; + + /** + * GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} <br /> + * + * @return The value of the column 'GROUP_ID'. (Nullable) + */ + public String getGroupId() { + return _groupId; + } + + /** + * GROUP_ID: {VARCHAR(255) : FK to GROUP_INFO} <br /> + * + * @param groupId The value of the column 'GROUP_ID'. (Nullable) + */ + public void setGroupId(String groupId) { + _modifiedProperties.addPropertyName("groupId"); + this._groupId = groupId; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String createdTime_COLUMN = "CREATED_TIME"; + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'CREATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getCreatedTime() { + return _createdTime; + } + + /** + * CREATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param createdTime The value of the column 'CREATED_TIME'. (Nullable) + */ + public void setCreatedTime(java.sql.Timestamp createdTime) { + _modifiedProperties.addPropertyName("createdTime"); + this._createdTime = createdTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String createdBy_COLUMN = "CREATED_BY"; + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'CREATED_BY'. (Nullable) + */ + public String getCreatedBy() { + return _createdBy; + } + + /** + * CREATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param createdBy The value of the column 'CREATED_BY'. (Nullable) + */ + public void setCreatedBy(String createdBy) { + _modifiedProperties.addPropertyName("createdBy"); + this._createdBy = createdBy; + } + + /** The column annotation for S2Dao. {NotNull : TIMESTAMP} */ + public static final String updatedTime_COLUMN = "UPDATED_TIME"; + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @return The value of the column 'UPDATED_TIME'. (Nullable) + */ + public java.sql.Timestamp getUpdatedTime() { + return _updatedTime; + } + + /** + * UPDATED_TIME: {NotNull : TIMESTAMP} <br /> + * + * @param updatedTime The value of the column 'UPDATED_TIME'. (Nullable) + */ + public void setUpdatedTime(java.sql.Timestamp updatedTime) { + _modifiedProperties.addPropertyName("updatedTime"); + this._updatedTime = updatedTime; + } + + /** The column annotation for S2Dao. {NotNull : VARCHAR(255)} */ + public static final String updatedBy_COLUMN = "UPDATED_BY"; + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @return The value of the column 'UPDATED_BY'. (Nullable) + */ + public String getUpdatedBy() { + return _updatedBy; + } + + /** + * UPDATED_BY: {NotNull : VARCHAR(255)} <br /> + * + * @param updatedBy The value of the column 'UPDATED_BY'. (Nullable) + */ + public void setUpdatedBy(String updatedBy) { + _modifiedProperties.addPropertyName("updatedBy"); + this._updatedBy = updatedBy; + } + + /** The column annotation for S2Dao. {TIMESTAMP} */ + public static final String deletedTime_COLUMN = "DELETED_TIME"; + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @return The value of the column 'DELETED_TIME'. (Nullable) + */ + public java.sql.Timestamp getDeletedTime() { + return _deletedTime; + } + + /** + * DELETED_TIME: {TIMESTAMP} <br /> + * + * @param deletedTime The value of the column 'DELETED_TIME'. (Nullable) + */ + public void setDeletedTime(java.sql.Timestamp deletedTime) { + _modifiedProperties.addPropertyName("deletedTime"); + this._deletedTime = deletedTime; + } + + /** The column annotation for S2Dao. {VARCHAR(255)} */ + public static final String deletedBy_COLUMN = "DELETED_BY"; + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @return The value of the column 'DELETED_BY'. (Nullable) + */ + public String getDeletedBy() { + return _deletedBy; + } + + /** + * DELETED_BY: {VARCHAR(255)} <br /> + * + * @param deletedBy The value of the column 'DELETED_BY'. (Nullable) + */ + public void setDeletedBy(String deletedBy) { + _modifiedProperties.addPropertyName("deletedBy"); + this._deletedBy = deletedBy; + } + + /** The column annotation for S2Dao. {NotNull : INTEGER} */ + public static final String versionno_COLUMN = "VERSIONNO"; + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @return The value of the column 'VERSIONNO'. (Nullable) + */ + public Integer getVersionno() { + return _versionno; + } + + /** + * VERSIONNO: {NotNull : INTEGER} <br /> + * + * @param versionno The value of the column 'VERSIONNO'. (Nullable) + */ + public void setVersionno(Integer versionno) { + _modifiedProperties.addPropertyName("versionno"); + this._versionno = versionno; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/BsUserInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupInfoDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupInfoDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupInfoDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,447 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.GroupInfo; + +/** + * The DB meta of GROUP_INFO. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfoDbm extends AbstractDBMeta { + + private static final GroupInfoDbm _instance = new GroupInfoDbm(); + + private GroupInfoDbm() { + } + + public static GroupInfoDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "GROUP_INFO"; + } + + public String getTablePropertyName() { + return "groupInfo"; + } + + public String getTableSqlName() { + return "GROUP_INFO"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", + String.class, true, 255, 0); + + protected ColumnInfo _columnName = cci("NAME", "name", String.class, false, + 100, 0); + + protected ColumnInfo _columnDescription = cci("DESCRIPTION", "description", + String.class, false, 255, 0); + + protected ColumnInfo _columnEmail = cci("EMAIL", "email", String.class, + false, 255, 0); + + protected ColumnInfo _columnUrl = cci("URL", "url", String.class, false, + 255, 0); + + protected ColumnInfo _columnTelephone = cci("TELEPHONE", "telephone", + String.class, false, 40, 0); + + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", + "createdTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnCreatedBy = cci("CREATED_BY", "createdBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnUpdatedTime = cci("UPDATED_TIME", + "updatedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnUpdatedBy = cci("UPDATED_BY", "updatedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnDeletedTime = cci("DELETED_TIME", + "deletedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnDeletedBy = cci("DELETED_BY", "deletedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnVersionno = cci("VERSIONNO", "versionno", + Integer.class, false, null, null, OptimisticLockType.VERSION_NO); + + public ColumnInfo columnGroupId() { + return _columnGroupId; + } + + public ColumnInfo columnName() { + return _columnName; + } + + public ColumnInfo columnDescription() { + return _columnDescription; + } + + public ColumnInfo columnEmail() { + return _columnEmail; + } + + public ColumnInfo columnUrl() { + return _columnUrl; + } + + public ColumnInfo columnTelephone() { + return _columnTelephone; + } + + public ColumnInfo columnCreatedTime() { + return _columnCreatedTime; + } + + public ColumnInfo columnCreatedBy() { + return _columnCreatedBy; + } + + public ColumnInfo columnUpdatedTime() { + return _columnUpdatedTime; + } + + public ColumnInfo columnUpdatedBy() { + return _columnUpdatedBy; + } + + public ColumnInfo columnDeletedTime() { + return _columnDeletedTime; + } + + public ColumnInfo columnDeletedBy() { + return _columnDeletedBy; + } + + public ColumnInfo columnVersionno() { + return _columnVersionno; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.GroupInfo"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.GroupInfoCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.GroupInfoDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.GroupInfoBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<GroupInfo> getEntityType() { + return GroupInfo.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public GroupInfo newMyEntity() { + return new GroupInfo(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnGroupId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + public ReferrerInfo referrerGroupMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnGroupId(), + GroupMappingDbm.getInstance().columnGroupId()); + return cri("groupMappingList", this, GroupMappingDbm.getInstance(), + map, false); + } + + public ReferrerInfo referrerUserInfoList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnGroupId(), + UserInfoDbm.getInstance().columnGroupId()); + return cri("userInfoList", this, UserInfoDbm.getInstance(), map, false); + } + + //========================================================================== + // ========= + // Various Info + // ============ + public boolean hasVersionNo() { + return true; + } + + public ColumnInfo getVersionNoColumnInfo() { + return _columnVersionno; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((GroupInfo) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((GroupInfo) entity, columnValueMap, _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<GroupInfo>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsName(), columnName()); + setupEps(_epsMap, new EpsDescription(), columnDescription()); + setupEps(_epsMap, new EpsEmail(), columnEmail()); + setupEps(_epsMap, new EpsUrl(), columnUrl()); + setupEps(_epsMap, new EpsTelephone(), columnTelephone()); + setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); + setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); + setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); + setupEps(_epsMap, new EpsUpdatedBy(), columnUpdatedBy()); + setupEps(_epsMap, new EpsDeletedTime(), columnDeletedTime()); + setupEps(_epsMap, new EpsDeletedBy(), columnDeletedBy()); + setupEps(_epsMap, new EpsVersionno(), columnVersionno()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((GroupInfo) entity, value); + } + + public static class EpsGroupId implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setGroupId((String) v); + } + } + + public static class EpsName implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setName((String) v); + } + } + + public static class EpsDescription implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setDescription((String) v); + } + } + + public static class EpsEmail implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setEmail((String) v); + } + } + + public static class EpsUrl implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setUrl((String) v); + } + } + + public static class EpsTelephone implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setTelephone((String) v); + } + } + + public static class EpsCreatedTime implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setCreatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsCreatedBy implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setCreatedBy((String) v); + } + } + + public static class EpsUpdatedTime implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setUpdatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsUpdatedBy implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setUpdatedBy((String) v); + } + } + + public static class EpsDeletedTime implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setDeletedTime((java.sql.Timestamp) v); + } + } + + public static class EpsDeletedBy implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setDeletedBy((String) v); + } + } + + public static class EpsVersionno implements Eps<GroupInfo> { + public void setup(GroupInfo e, Object v) { + e.setVersionno((Integer) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupInfoDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupMappingDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupMappingDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupMappingDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,299 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.GroupMapping; + +/** + * The DB meta of GROUP_MAPPING. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMappingDbm extends AbstractDBMeta { + + private static final GroupMappingDbm _instance = new GroupMappingDbm(); + + private GroupMappingDbm() { + } + + public static GroupMappingDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "GROUP_MAPPING"; + } + + public String getTablePropertyName() { + return "groupMapping"; + } + + public String getTableSqlName() { + return "GROUP_MAPPING"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Integer.class, true, null, + null); + + protected ColumnInfo _columnUserId = cci("USER_ID", "userId", String.class, + false, 255, 0); + + protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", + String.class, false, 255, 0); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnUserId() { + return _columnUserId; + } + + public ColumnInfo columnGroupId() { + return _columnGroupId; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.GroupMapping"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.GroupMappingCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.GroupMappingDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.GroupMappingBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<GroupMapping> getEntityType() { + return GroupMapping.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public GroupMapping newMyEntity() { + return new GroupMapping(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignGroupInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnGroupId(), + GroupInfoDbm.getInstance().columnGroupId()); + return cfi("groupInfo", this, GroupInfoDbm.getInstance(), map, 0, false); + } + + public ForeignInfo foreignUserInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + UserInfoDbm.getInstance().columnUserId()); + return cfi("userInfo", this, UserInfoDbm.getInstance(), map, 1, false); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((GroupMapping) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((GroupMapping) entity, columnValueMap, _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<GroupMapping>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsUserId(), columnUserId()); + setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((GroupMapping) entity, value); + } + + public static class EpsId implements Eps<GroupMapping> { + public void setup(GroupMapping e, Object v) { + e.setId((Integer) v); + } + } + + public static class EpsUserId implements Eps<GroupMapping> { + public void setup(GroupMapping e, Object v) { + e.setUserId((String) v); + } + } + + public static class EpsGroupId implements Eps<GroupMapping> { + public void setup(GroupMapping e, Object v) { + e.setGroupId((String) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/GroupMappingDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleInfoDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleInfoDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleInfoDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,447 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.RoleInfo; + +/** + * The DB meta of ROLE_INFO. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfoDbm extends AbstractDBMeta { + + private static final RoleInfoDbm _instance = new RoleInfoDbm(); + + private RoleInfoDbm() { + } + + public static RoleInfoDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "ROLE_INFO"; + } + + public String getTablePropertyName() { + return "roleInfo"; + } + + public String getTableSqlName() { + return "ROLE_INFO"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnRoleId = cci("ROLE_ID", "roleId", String.class, + true, 255, 0); + + protected ColumnInfo _columnName = cci("NAME", "name", String.class, false, + 100, 0); + + protected ColumnInfo _columnDescription = cci("DESCRIPTION", "description", + String.class, false, 255, 0); + + protected ColumnInfo _columnEmail = cci("EMAIL", "email", String.class, + false, 255, 0); + + protected ColumnInfo _columnUrl = cci("URL", "url", String.class, false, + 255, 0); + + protected ColumnInfo _columnTelephone = cci("TELEPHONE", "telephone", + String.class, false, 40, 0); + + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", + "createdTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnCreatedBy = cci("CREATED_BY", "createdBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnUpdatedTime = cci("UPDATED_TIME", + "updatedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnUpdatedBy = cci("UPDATED_BY", "updatedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnDeletedTime = cci("DELETED_TIME", + "deletedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnDeletedBy = cci("DELETED_BY", "deletedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnVersionno = cci("VERSIONNO", "versionno", + Integer.class, false, null, null, OptimisticLockType.VERSION_NO); + + public ColumnInfo columnRoleId() { + return _columnRoleId; + } + + public ColumnInfo columnName() { + return _columnName; + } + + public ColumnInfo columnDescription() { + return _columnDescription; + } + + public ColumnInfo columnEmail() { + return _columnEmail; + } + + public ColumnInfo columnUrl() { + return _columnUrl; + } + + public ColumnInfo columnTelephone() { + return _columnTelephone; + } + + public ColumnInfo columnCreatedTime() { + return _columnCreatedTime; + } + + public ColumnInfo columnCreatedBy() { + return _columnCreatedBy; + } + + public ColumnInfo columnUpdatedTime() { + return _columnUpdatedTime; + } + + public ColumnInfo columnUpdatedBy() { + return _columnUpdatedBy; + } + + public ColumnInfo columnDeletedTime() { + return _columnDeletedTime; + } + + public ColumnInfo columnDeletedBy() { + return _columnDeletedBy; + } + + public ColumnInfo columnVersionno() { + return _columnVersionno; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.RoleInfo"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.RoleInfoCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.RoleInfoDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.RoleInfoBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<RoleInfo> getEntityType() { + return RoleInfo.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public RoleInfo newMyEntity() { + return new RoleInfo(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnRoleId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + public ReferrerInfo referrerRoleMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnRoleId(), + RoleMappingDbm.getInstance().columnRoleId()); + return cri("roleMappingList", this, RoleMappingDbm.getInstance(), map, + false); + } + + public ReferrerInfo referrerUserInfoList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnRoleId(), + UserInfoDbm.getInstance().columnRoleId()); + return cri("userInfoList", this, UserInfoDbm.getInstance(), map, false); + } + + //========================================================================== + // ========= + // Various Info + // ============ + public boolean hasVersionNo() { + return true; + } + + public ColumnInfo getVersionNoColumnInfo() { + return _columnVersionno; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((RoleInfo) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((RoleInfo) entity, columnValueMap, _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<RoleInfo>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsRoleId(), columnRoleId()); + setupEps(_epsMap, new EpsName(), columnName()); + setupEps(_epsMap, new EpsDescription(), columnDescription()); + setupEps(_epsMap, new EpsEmail(), columnEmail()); + setupEps(_epsMap, new EpsUrl(), columnUrl()); + setupEps(_epsMap, new EpsTelephone(), columnTelephone()); + setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); + setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); + setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); + setupEps(_epsMap, new EpsUpdatedBy(), columnUpdatedBy()); + setupEps(_epsMap, new EpsDeletedTime(), columnDeletedTime()); + setupEps(_epsMap, new EpsDeletedBy(), columnDeletedBy()); + setupEps(_epsMap, new EpsVersionno(), columnVersionno()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((RoleInfo) entity, value); + } + + public static class EpsRoleId implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setRoleId((String) v); + } + } + + public static class EpsName implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setName((String) v); + } + } + + public static class EpsDescription implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setDescription((String) v); + } + } + + public static class EpsEmail implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setEmail((String) v); + } + } + + public static class EpsUrl implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setUrl((String) v); + } + } + + public static class EpsTelephone implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setTelephone((String) v); + } + } + + public static class EpsCreatedTime implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setCreatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsCreatedBy implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setCreatedBy((String) v); + } + } + + public static class EpsUpdatedTime implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setUpdatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsUpdatedBy implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setUpdatedBy((String) v); + } + } + + public static class EpsDeletedTime implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setDeletedTime((java.sql.Timestamp) v); + } + } + + public static class EpsDeletedBy implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setDeletedBy((String) v); + } + } + + public static class EpsVersionno implements Eps<RoleInfo> { + public void setup(RoleInfo e, Object v) { + e.setVersionno((Integer) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleInfoDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleMappingDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleMappingDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleMappingDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,299 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.RoleMapping; + +/** + * The DB meta of ROLE_MAPPING. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMappingDbm extends AbstractDBMeta { + + private static final RoleMappingDbm _instance = new RoleMappingDbm(); + + private RoleMappingDbm() { + } + + public static RoleMappingDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "ROLE_MAPPING"; + } + + public String getTablePropertyName() { + return "roleMapping"; + } + + public String getTableSqlName() { + return "ROLE_MAPPING"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Integer.class, true, null, + null); + + protected ColumnInfo _columnUserId = cci("USER_ID", "userId", String.class, + false, 255, 0); + + protected ColumnInfo _columnRoleId = cci("ROLE_ID", "roleId", String.class, + false, 255, 0); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnUserId() { + return _columnUserId; + } + + public ColumnInfo columnRoleId() { + return _columnRoleId; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.RoleMapping"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.RoleMappingCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.RoleMappingDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.RoleMappingBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<RoleMapping> getEntityType() { + return RoleMapping.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public RoleMapping newMyEntity() { + return new RoleMapping(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignRoleInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnRoleId(), + RoleInfoDbm.getInstance().columnRoleId()); + return cfi("roleInfo", this, RoleInfoDbm.getInstance(), map, 0, false); + } + + public ForeignInfo foreignUserInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + UserInfoDbm.getInstance().columnUserId()); + return cfi("userInfo", this, UserInfoDbm.getInstance(), map, 1, false); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((RoleMapping) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((RoleMapping) entity, columnValueMap, _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<RoleMapping>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsUserId(), columnUserId()); + setupEps(_epsMap, new EpsRoleId(), columnRoleId()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((RoleMapping) entity, value); + } + + public static class EpsId implements Eps<RoleMapping> { + public void setup(RoleMapping e, Object v) { + e.setId((Integer) v); + } + } + + public static class EpsUserId implements Eps<RoleMapping> { + public void setup(RoleMapping e, Object v) { + e.setUserId((String) v); + } + } + + public static class EpsRoleId implements Eps<RoleMapping> { + public void setup(RoleMapping e, Object v) { + e.setRoleId((String) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoleMappingDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleContentDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleContentDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleContentDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,283 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent; + +/** + * The DB meta of ROUTINE_SCHEDULE_CONTENT. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContentDbm extends AbstractDBMeta { + + private static final RoutineScheduleContentDbm _instance = new RoutineScheduleContentDbm(); + + private RoutineScheduleContentDbm() { + } + + public static RoutineScheduleContentDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + public String getTablePropertyName() { + return "routineScheduleContent"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnContent = cci("CONTENT", "content", + String.class, false, 1000, 0); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnContent() { + return _columnContent; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.RoutineScheduleContentCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.RoutineScheduleContentDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.RoutineScheduleContentBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<RoutineScheduleContent> getEntityType() { + return RoutineScheduleContent.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public RoutineScheduleContent newMyEntity() { + return new RoutineScheduleContent(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignRoutineSchedule() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnId(), + RoutineScheduleDbm.getInstance().columnId()); + return cfi("routineSchedule", this, RoutineScheduleDbm.getInstance(), + map, 0, true); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((RoutineScheduleContent) entity, primaryKeyMap, + _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((RoutineScheduleContent) entity, columnValueMap, + _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<RoutineScheduleContent>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsContent(), columnContent()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((RoutineScheduleContent) entity, + value); + } + + public static class EpsId implements Eps<RoutineScheduleContent> { + public void setup(RoutineScheduleContent e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsContent implements Eps<RoutineScheduleContent> { + public void setup(RoutineScheduleContent e, Object v) { + e.setContent((String) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleContentDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,477 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; + +/** + * The DB meta of ROUTINE_SCHEDULE. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleDbm extends AbstractDBMeta { + + private static final RoutineScheduleDbm _instance = new RoutineScheduleDbm(); + + private RoutineScheduleDbm() { + } + + public static RoutineScheduleDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE"; + } + + public String getTablePropertyName() { + return "routineSchedule"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnTitle = cci("TITLE", "title", String.class, + false, 100, 0); + + protected ColumnInfo _columnLocation = cci("LOCATION", "location", + String.class, false, 100, 0); + + protected ColumnInfo _columnStartDate = cci("START_DATE", "startDate", + java.util.Date.class, false, null, null); + + protected ColumnInfo _columnStartTime = cci("START_TIME", "startTime", + java.sql.Time.class, false, null, null); + + protected ColumnInfo _columnEndDate = cci("END_DATE", "endDate", + java.util.Date.class, false, null, null); + + protected ColumnInfo _columnEndTime = cci("END_TIME", "endTime", + java.sql.Time.class, false, null, null); + + protected ColumnInfo _columnType = cci("TYPE", "type", String.class, false, + 10, 0); + + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", + "createdTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnCreatedBy = cci("CREATED_BY", "createdBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnUpdatedTime = cci("UPDATED_TIME", + "updatedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnUpdatedBy = cci("UPDATED_BY", "updatedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnDeletedTime = cci("DELETED_TIME", + "deletedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnDeletedBy = cci("DELETED_BY", "deletedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnVersionno = cci("VERSIONNO", "versionno", + Integer.class, false, null, null, OptimisticLockType.VERSION_NO); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnTitle() { + return _columnTitle; + } + + public ColumnInfo columnLocation() { + return _columnLocation; + } + + public ColumnInfo columnStartDate() { + return _columnStartDate; + } + + public ColumnInfo columnStartTime() { + return _columnStartTime; + } + + public ColumnInfo columnEndDate() { + return _columnEndDate; + } + + public ColumnInfo columnEndTime() { + return _columnEndTime; + } + + public ColumnInfo columnType() { + return _columnType; + } + + public ColumnInfo columnCreatedTime() { + return _columnCreatedTime; + } + + public ColumnInfo columnCreatedBy() { + return _columnCreatedBy; + } + + public ColumnInfo columnUpdatedTime() { + return _columnUpdatedTime; + } + + public ColumnInfo columnUpdatedBy() { + return _columnUpdatedBy; + } + + public ColumnInfo columnDeletedTime() { + return _columnDeletedTime; + } + + public ColumnInfo columnDeletedBy() { + return _columnDeletedBy; + } + + public ColumnInfo columnVersionno() { + return _columnVersionno; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.RoutineSchedule"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.RoutineScheduleCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.RoutineScheduleDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.RoutineScheduleBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<RoutineSchedule> getEntityType() { + return RoutineSchedule.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public RoutineSchedule newMyEntity() { + return new RoutineSchedule(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignRoutineScheduleContentAsOne() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnId(), + RoutineScheduleContentDbm.getInstance().columnId()); + return cfi("routineScheduleContentAsOne", this, + RoutineScheduleContentDbm.getInstance(), map, 0, true); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + public ReferrerInfo referrerRoutineScheduleMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnId(), + RoutineScheduleMappingDbm.getInstance().columnScheduleId()); + return cri("routineScheduleMappingList", this, + RoutineScheduleMappingDbm.getInstance(), map, false); + } + + //========================================================================== + // ========= + // Various Info + // ============ + public boolean hasVersionNo() { + return true; + } + + public ColumnInfo getVersionNoColumnInfo() { + return _columnVersionno; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((RoutineSchedule) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((RoutineSchedule) entity, columnValueMap, + _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<RoutineSchedule>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsTitle(), columnTitle()); + setupEps(_epsMap, new EpsLocation(), columnLocation()); + setupEps(_epsMap, new EpsStartDate(), columnStartDate()); + setupEps(_epsMap, new EpsStartTime(), columnStartTime()); + setupEps(_epsMap, new EpsEndDate(), columnEndDate()); + setupEps(_epsMap, new EpsEndTime(), columnEndTime()); + setupEps(_epsMap, new EpsType(), columnType()); + setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); + setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); + setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); + setupEps(_epsMap, new EpsUpdatedBy(), columnUpdatedBy()); + setupEps(_epsMap, new EpsDeletedTime(), columnDeletedTime()); + setupEps(_epsMap, new EpsDeletedBy(), columnDeletedBy()); + setupEps(_epsMap, new EpsVersionno(), columnVersionno()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((RoutineSchedule) entity, value); + } + + public static class EpsId implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsTitle implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setTitle((String) v); + } + } + + public static class EpsLocation implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setLocation((String) v); + } + } + + public static class EpsStartDate implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setStartDate((java.util.Date) v); + } + } + + public static class EpsStartTime implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setStartTime((java.sql.Time) v); + } + } + + public static class EpsEndDate implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setEndDate((java.util.Date) v); + } + } + + public static class EpsEndTime implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setEndTime((java.sql.Time) v); + } + } + + public static class EpsType implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setType((String) v); + } + } + + public static class EpsCreatedTime implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setCreatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsCreatedBy implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setCreatedBy((String) v); + } + } + + public static class EpsUpdatedTime implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setUpdatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsUpdatedBy implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setUpdatedBy((String) v); + } + } + + public static class EpsDeletedTime implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setDeletedTime((java.sql.Timestamp) v); + } + } + + public static class EpsDeletedBy implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setDeletedBy((String) v); + } + } + + public static class EpsVersionno implements Eps<RoutineSchedule> { + public void setup(RoutineSchedule e, Object v) { + e.setVersionno((Integer) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleMappingDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleMappingDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleMappingDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,303 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; + +/** + * The DB meta of ROUTINE_SCHEDULE_MAPPING. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMappingDbm extends AbstractDBMeta { + + private static final RoutineScheduleMappingDbm _instance = new RoutineScheduleMappingDbm(); + + private RoutineScheduleMappingDbm() { + } + + public static RoutineScheduleMappingDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + public String getTablePropertyName() { + return "routineScheduleMapping"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnScheduleId = cci("SCHEDULE_ID", "scheduleId", + Long.class, false, null, null); + + protected ColumnInfo _columnUserId = cci("USER_ID", "userId", String.class, + false, 255, 0); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnScheduleId() { + return _columnScheduleId; + } + + public ColumnInfo columnUserId() { + return _columnUserId; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.RoutineScheduleMappingCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.RoutineScheduleMappingDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.RoutineScheduleMappingBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<RoutineScheduleMapping> getEntityType() { + return RoutineScheduleMapping.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public RoutineScheduleMapping newMyEntity() { + return new RoutineScheduleMapping(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignRoutineSchedule() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnScheduleId(), + RoutineScheduleDbm.getInstance().columnId()); + return cfi("routineSchedule", this, RoutineScheduleDbm.getInstance(), + map, 0, false); + } + + public ForeignInfo foreignUserInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + UserInfoDbm.getInstance().columnUserId()); + return cfi("userInfo", this, UserInfoDbm.getInstance(), map, 1, false); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((RoutineScheduleMapping) entity, primaryKeyMap, + _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((RoutineScheduleMapping) entity, columnValueMap, + _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<RoutineScheduleMapping>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsScheduleId(), columnScheduleId()); + setupEps(_epsMap, new EpsUserId(), columnUserId()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((RoutineScheduleMapping) entity, + value); + } + + public static class EpsId implements Eps<RoutineScheduleMapping> { + public void setup(RoutineScheduleMapping e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsScheduleId implements Eps<RoutineScheduleMapping> { + public void setup(RoutineScheduleMapping e, Object v) { + e.setScheduleId((Long) v); + } + } + + public static class EpsUserId implements Eps<RoutineScheduleMapping> { + public void setup(RoutineScheduleMapping e, Object v) { + e.setUserId((String) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/RoutineScheduleMappingDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleContentDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleContentDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleContentDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,283 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleContent; + +/** + * The DB meta of SINGLE_SCHEDULE_CONTENT. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContentDbm extends AbstractDBMeta { + + private static final SingleScheduleContentDbm _instance = new SingleScheduleContentDbm(); + + private SingleScheduleContentDbm() { + } + + public static SingleScheduleContentDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + public String getTablePropertyName() { + return "singleScheduleContent"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnContent = cci("CONTENT", "content", + String.class, false, 1000, 0); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnContent() { + return _columnContent; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.SingleScheduleContent"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.SingleScheduleContentCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.SingleScheduleContentDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.SingleScheduleContentBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<SingleScheduleContent> getEntityType() { + return SingleScheduleContent.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public SingleScheduleContent newMyEntity() { + return new SingleScheduleContent(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignSingleSchedule() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnId(), + SingleScheduleDbm.getInstance().columnId()); + return cfi("singleSchedule", this, SingleScheduleDbm.getInstance(), + map, 0, true); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((SingleScheduleContent) entity, primaryKeyMap, + _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((SingleScheduleContent) entity, columnValueMap, + _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<SingleScheduleContent>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsContent(), columnContent()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((SingleScheduleContent) entity, + value); + } + + public static class EpsId implements Eps<SingleScheduleContent> { + public void setup(SingleScheduleContent e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsContent implements Eps<SingleScheduleContent> { + public void setup(SingleScheduleContent e, Object v) { + e.setContent((String) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleContentDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,462 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; + +/** + * The DB meta of SINGLE_SCHEDULE. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleDbm extends AbstractDBMeta { + + private static final SingleScheduleDbm _instance = new SingleScheduleDbm(); + + private SingleScheduleDbm() { + } + + public static SingleScheduleDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE"; + } + + public String getTablePropertyName() { + return "singleSchedule"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnTitle = cci("TITLE", "title", String.class, + false, 100, 0); + + protected ColumnInfo _columnLocation = cci("LOCATION", "location", + String.class, false, 100, 0); + + protected ColumnInfo _columnStartDate = cci("START_DATE", "startDate", + java.util.Date.class, false, null, null); + + protected ColumnInfo _columnStartTime = cci("START_TIME", "startTime", + java.sql.Time.class, false, null, null); + + protected ColumnInfo _columnEndDate = cci("END_DATE", "endDate", + java.util.Date.class, false, null, null); + + protected ColumnInfo _columnEndTime = cci("END_TIME", "endTime", + java.sql.Time.class, false, null, null); + + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", + "createdTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnCreatedBy = cci("CREATED_BY", "createdBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnUpdatedTime = cci("UPDATED_TIME", + "updatedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnUpdatedBy = cci("UPDATED_BY", "updatedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnDeletedTime = cci("DELETED_TIME", + "deletedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnDeletedBy = cci("DELETED_BY", "deletedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnVersionno = cci("VERSIONNO", "versionno", + Integer.class, false, null, null, OptimisticLockType.VERSION_NO); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnTitle() { + return _columnTitle; + } + + public ColumnInfo columnLocation() { + return _columnLocation; + } + + public ColumnInfo columnStartDate() { + return _columnStartDate; + } + + public ColumnInfo columnStartTime() { + return _columnStartTime; + } + + public ColumnInfo columnEndDate() { + return _columnEndDate; + } + + public ColumnInfo columnEndTime() { + return _columnEndTime; + } + + public ColumnInfo columnCreatedTime() { + return _columnCreatedTime; + } + + public ColumnInfo columnCreatedBy() { + return _columnCreatedBy; + } + + public ColumnInfo columnUpdatedTime() { + return _columnUpdatedTime; + } + + public ColumnInfo columnUpdatedBy() { + return _columnUpdatedBy; + } + + public ColumnInfo columnDeletedTime() { + return _columnDeletedTime; + } + + public ColumnInfo columnDeletedBy() { + return _columnDeletedBy; + } + + public ColumnInfo columnVersionno() { + return _columnVersionno; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.SingleSchedule"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.SingleScheduleCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.SingleScheduleDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.SingleScheduleBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<SingleSchedule> getEntityType() { + return SingleSchedule.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public SingleSchedule newMyEntity() { + return new SingleSchedule(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignSingleScheduleContentAsOne() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnId(), + SingleScheduleContentDbm.getInstance().columnId()); + return cfi("singleScheduleContentAsOne", this, SingleScheduleContentDbm + .getInstance(), map, 0, true); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + public ReferrerInfo referrerSingleScheduleMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnId(), + SingleScheduleMappingDbm.getInstance().columnScheduleId()); + return cri("singleScheduleMappingList", this, SingleScheduleMappingDbm + .getInstance(), map, false); + } + + //========================================================================== + // ========= + // Various Info + // ============ + public boolean hasVersionNo() { + return true; + } + + public ColumnInfo getVersionNoColumnInfo() { + return _columnVersionno; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((SingleSchedule) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((SingleSchedule) entity, columnValueMap, _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<SingleSchedule>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsTitle(), columnTitle()); + setupEps(_epsMap, new EpsLocation(), columnLocation()); + setupEps(_epsMap, new EpsStartDate(), columnStartDate()); + setupEps(_epsMap, new EpsStartTime(), columnStartTime()); + setupEps(_epsMap, new EpsEndDate(), columnEndDate()); + setupEps(_epsMap, new EpsEndTime(), columnEndTime()); + setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); + setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); + setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); + setupEps(_epsMap, new EpsUpdatedBy(), columnUpdatedBy()); + setupEps(_epsMap, new EpsDeletedTime(), columnDeletedTime()); + setupEps(_epsMap, new EpsDeletedBy(), columnDeletedBy()); + setupEps(_epsMap, new EpsVersionno(), columnVersionno()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((SingleSchedule) entity, value); + } + + public static class EpsId implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsTitle implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setTitle((String) v); + } + } + + public static class EpsLocation implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setLocation((String) v); + } + } + + public static class EpsStartDate implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setStartDate((java.util.Date) v); + } + } + + public static class EpsStartTime implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setStartTime((java.sql.Time) v); + } + } + + public static class EpsEndDate implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setEndDate((java.util.Date) v); + } + } + + public static class EpsEndTime implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setEndTime((java.sql.Time) v); + } + } + + public static class EpsCreatedTime implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setCreatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsCreatedBy implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setCreatedBy((String) v); + } + } + + public static class EpsUpdatedTime implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setUpdatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsUpdatedBy implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setUpdatedBy((String) v); + } + } + + public static class EpsDeletedTime implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setDeletedTime((java.sql.Timestamp) v); + } + } + + public static class EpsDeletedBy implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setDeletedBy((String) v); + } + } + + public static class EpsVersionno implements Eps<SingleSchedule> { + public void setup(SingleSchedule e, Object v) { + e.setVersionno((Integer) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleMappingDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleMappingDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleMappingDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,303 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; + +/** + * The DB meta of SINGLE_SCHEDULE_MAPPING. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMappingDbm extends AbstractDBMeta { + + private static final SingleScheduleMappingDbm _instance = new SingleScheduleMappingDbm(); + + private SingleScheduleMappingDbm() { + } + + public static SingleScheduleMappingDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + public String getTablePropertyName() { + return "singleScheduleMapping"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnId = cci("ID", "id", Long.class, true, null, + null); + + protected ColumnInfo _columnScheduleId = cci("SCHEDULE_ID", "scheduleId", + Long.class, false, null, null); + + protected ColumnInfo _columnUserId = cci("USER_ID", "userId", String.class, + false, 255, 0); + + public ColumnInfo columnId() { + return _columnId; + } + + public ColumnInfo columnScheduleId() { + return _columnScheduleId; + } + + public ColumnInfo columnUserId() { + return _columnUserId; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.SingleScheduleMappingCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.SingleScheduleMappingDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.SingleScheduleMappingBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<SingleScheduleMapping> getEntityType() { + return SingleScheduleMapping.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public SingleScheduleMapping newMyEntity() { + return new SingleScheduleMapping(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignSingleSchedule() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnScheduleId(), + SingleScheduleDbm.getInstance().columnId()); + return cfi("singleSchedule", this, SingleScheduleDbm.getInstance(), + map, 0, false); + } + + public ForeignInfo foreignUserInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + UserInfoDbm.getInstance().columnUserId()); + return cfi("userInfo", this, UserInfoDbm.getInstance(), map, 1, false); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + + //========================================================================== + // ========= + // Various Info + // ============ + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((SingleScheduleMapping) entity, primaryKeyMap, + _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((SingleScheduleMapping) entity, columnValueMap, + _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<SingleScheduleMapping>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsId(), columnId()); + setupEps(_epsMap, new EpsScheduleId(), columnScheduleId()); + setupEps(_epsMap, new EpsUserId(), columnUserId()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((SingleScheduleMapping) entity, + value); + } + + public static class EpsId implements Eps<SingleScheduleMapping> { + public void setup(SingleScheduleMapping e, Object v) { + e.setId((Long) v); + } + } + + public static class EpsScheduleId implements Eps<SingleScheduleMapping> { + public void setup(SingleScheduleMapping e, Object v) { + e.setScheduleId((Long) v); + } + } + + public static class EpsUserId implements Eps<SingleScheduleMapping> { + public void setup(SingleScheduleMapping e, Object v) { + e.setUserId((String) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/SingleScheduleMappingDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/UserInfoDbm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/UserInfoDbm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/UserInfoDbm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,586 @@ +package jp.sf.pal.scheduler.db.bsentity.dbmeta; + +import java.util.List; +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.Entity; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.AbstractDBMeta; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ColumnInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ForeignInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.ReferrerInfo; +import jp.sf.pal.scheduler.db.allcommon.dbmeta.info.UniqueInfo; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +/** + * The DB meta of USER_INFO. (Singleton) + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfoDbm extends AbstractDBMeta { + + private static final UserInfoDbm _instance = new UserInfoDbm(); + + private UserInfoDbm() { + } + + public static UserInfoDbm getInstance() { + return _instance; + } + + //========================================================================== + // ========= + // Table Info + // ========== + public String getTableDbName() { + return "USER_INFO"; + } + + public String getTablePropertyName() { + return "userInfo"; + } + + public String getTableSqlName() { + return "USER_INFO"; + } + + //========================================================================== + // ========= + // Column Info + // =========== + protected ColumnInfo _columnUserId = cci("USER_ID", "userId", String.class, + true, 255, 0); + + protected ColumnInfo _columnGivenName = cci("GIVEN_NAME", "givenName", + String.class, false, 100, 0); + + protected ColumnInfo _columnFamilyName = cci("FAMILY_NAME", "familyName", + String.class, false, 100, 0); + + protected ColumnInfo _columnMiddleName = cci("MIDDLE_NAME", "middleName", + String.class, false, 50, 0); + + protected ColumnInfo _columnGivenNameDesc = cci("GIVEN_NAME_DESC", + "givenNameDesc", String.class, false, 100, 0); + + protected ColumnInfo _columnFamilyNameDesc = cci("FAMILY_NAME_DESC", + "familyNameDesc", String.class, false, 100, 0); + + protected ColumnInfo _columnNickname = cci("NICKNAME", "nickname", + String.class, false, 100, 0); + + protected ColumnInfo _columnGender = cci("GENDER", "gender", String.class, + false, 1, 0); + + protected ColumnInfo _columnBirthDate = cci("BIRTH_DATE", "birthDate", + java.util.Date.class, false, null, null); + + protected ColumnInfo _columnEmail = cci("EMAIL", "email", String.class, + false, 255, 0); + + protected ColumnInfo _columnUrl = cci("URL", "url", String.class, false, + 255, 0); + + protected ColumnInfo _columnTelephone = cci("TELEPHONE", "telephone", + String.class, false, 40, 0); + + protected ColumnInfo _columnRoleId = cci("ROLE_ID", "roleId", String.class, + false, 255, 0); + + protected ColumnInfo _columnGroupId = cci("GROUP_ID", "groupId", + String.class, false, 255, 0); + + protected ColumnInfo _columnCreatedTime = cci("CREATED_TIME", + "createdTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnCreatedBy = cci("CREATED_BY", "createdBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnUpdatedTime = cci("UPDATED_TIME", + "updatedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnUpdatedBy = cci("UPDATED_BY", "updatedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnDeletedTime = cci("DELETED_TIME", + "deletedTime", java.sql.Timestamp.class, false, null, null); + + protected ColumnInfo _columnDeletedBy = cci("DELETED_BY", "deletedBy", + String.class, false, 255, 0); + + protected ColumnInfo _columnVersionno = cci("VERSIONNO", "versionno", + Integer.class, false, null, null, OptimisticLockType.VERSION_NO); + + public ColumnInfo columnUserId() { + return _columnUserId; + } + + public ColumnInfo columnGivenName() { + return _columnGivenName; + } + + public ColumnInfo columnFamilyName() { + return _columnFamilyName; + } + + public ColumnInfo columnMiddleName() { + return _columnMiddleName; + } + + public ColumnInfo columnGivenNameDesc() { + return _columnGivenNameDesc; + } + + public ColumnInfo columnFamilyNameDesc() { + return _columnFamilyNameDesc; + } + + public ColumnInfo columnNickname() { + return _columnNickname; + } + + public ColumnInfo columnGender() { + return _columnGender; + } + + public ColumnInfo columnBirthDate() { + return _columnBirthDate; + } + + public ColumnInfo columnEmail() { + return _columnEmail; + } + + public ColumnInfo columnUrl() { + return _columnUrl; + } + + public ColumnInfo columnTelephone() { + return _columnTelephone; + } + + public ColumnInfo columnRoleId() { + return _columnRoleId; + } + + public ColumnInfo columnGroupId() { + return _columnGroupId; + } + + public ColumnInfo columnCreatedTime() { + return _columnCreatedTime; + } + + public ColumnInfo columnCreatedBy() { + return _columnCreatedBy; + } + + public ColumnInfo columnUpdatedTime() { + return _columnUpdatedTime; + } + + public ColumnInfo columnUpdatedBy() { + return _columnUpdatedBy; + } + + public ColumnInfo columnDeletedTime() { + return _columnDeletedTime; + } + + public ColumnInfo columnDeletedBy() { + return _columnDeletedBy; + } + + public ColumnInfo columnVersionno() { + return _columnVersionno; + } + + { + initializeColumnInfoList(); + } + + //========================================================================== + // ========= + // Name Map + // ======== + public Map<String, String> getDbNamePropertyNameKeyToLowerMap() { + return createDbNamePropertyNameKeyToLowerMap(); + } + + 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 + // ========= + public String getEntityTypeName() { + return "jp.sf.pal.scheduler.db.exentity.UserInfo"; + } + + public String getConditionBeanTypeName() { + return "jp.sf.pal.scheduler.db.cbean.bs.UserInfoCB"; + } + + public String getDaoTypeName() { + return "jp.sf.pal.scheduler.db.exdao.UserInfoDao"; + } + + public String getBehaviorTypeName() { + return "jp.sf.pal.scheduler.db.exbhv.UserInfoBhv"; + } + + //========================================================================== + // ========= + // Object Type + // =========== + public Class<UserInfo> getEntityType() { + return UserInfo.class; + } + + //========================================================================== + // ========= + // Object Instance + // =============== + public Entity newEntity() { + return newMyEntity(); + } + + public UserInfo newMyEntity() { + return new UserInfo(); + } + + //========================================================================== + // ========= + // Unique Info + // =========== + // ----------------------------------------------------- + // Primary Element + // --------------- + public UniqueInfo getPrimaryUniqueInfo() { + return createPrimaryUniqueInfo(columnUserId()); + } + + public boolean hasPrimaryKey() { + return true; + } + + public boolean hasTwoOrMorePrimaryKeys() { + return false; + } + + //========================================================================== + // ========= + // Relation Info + // ============= + // ----------------------------------------------------- + // Foreign Property + // ---------------- + public ForeignInfo foreignGroupInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnGroupId(), + GroupInfoDbm.getInstance().columnGroupId()); + return cfi("groupInfo", this, GroupInfoDbm.getInstance(), map, 0, false); + } + + public ForeignInfo foreignRoleInfo() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnRoleId(), + RoleInfoDbm.getInstance().columnRoleId()); + return cfi("roleInfo", this, RoleInfoDbm.getInstance(), map, 1, false); + } + + // ----------------------------------------------------- + // Referrer Property + // ----------------- + public ReferrerInfo referrerGroupMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + GroupMappingDbm.getInstance().columnUserId()); + return cri("groupMappingList", this, GroupMappingDbm.getInstance(), + map, false); + } + + public ReferrerInfo referrerRoleMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + RoleMappingDbm.getInstance().columnUserId()); + return cri("roleMappingList", this, RoleMappingDbm.getInstance(), map, + false); + } + + public ReferrerInfo referrerRoutineScheduleMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + RoutineScheduleMappingDbm.getInstance().columnUserId()); + return cri("routineScheduleMappingList", this, + RoutineScheduleMappingDbm.getInstance(), map, false); + } + + public ReferrerInfo referrerSingleScheduleMappingList() { + Map<ColumnInfo, ColumnInfo> map = newLinkedHashMap(columnUserId(), + SingleScheduleMappingDbm.getInstance().columnUserId()); + return cri("singleScheduleMappingList", this, SingleScheduleMappingDbm + .getInstance(), map, false); + } + + //========================================================================== + // ========= + // Various Info + // ============ + public boolean hasVersionNo() { + return true; + } + + public ColumnInfo getVersionNoColumnInfo() { + return _columnVersionno; + } + + //========================================================================== + // ========= + // Entity Handling + // =============== + // ----------------------------------------------------- + // Accept + // ------ + public void acceptPrimaryKeyMap(Entity entity, + Map<String, ? extends Object> primaryKeyMap) { + doAcceptPrimaryKeyMap((UserInfo) entity, primaryKeyMap, _epsMap); + } + + public void acceptPrimaryKeyMapString(Entity entity, + String primaryKeyMapString) { + MapStringUtil.acceptPrimaryKeyMapString(primaryKeyMapString, entity); + } + + public void acceptColumnValueMap(Entity entity, + Map<String, ? extends Object> columnValueMap) { + doAcceptColumnValueMap((UserInfo) entity, columnValueMap, _epsMap); + } + + public void acceptColumnValueMapString(Entity entity, + String columnValueMapString) { + MapStringUtil.acceptColumnValueMapString(columnValueMapString, entity); + } + + // ----------------------------------------------------- + // Extract + // ------- + public String extractPrimaryKeyMapString(Entity entity) { + return MapStringUtil.extractPrimaryKeyMapString(entity); + } + + public String extractPrimaryKeyMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractPrimaryKeyMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + public String extractColumnValueMapString(Entity entity) { + return MapStringUtil.extractColumnValueMapString(entity); + } + + public String extractColumnValueMapString(Entity entity, String startBrace, + String endBrace, String delimiter, String equal) { + return doExtractColumnValueMapString(entity, startBrace, endBrace, + delimiter, equal); + } + + // ----------------------------------------------------- + // Convert + // ------- + public List<Object> convertToColumnValueList(Entity entity) { + return newArrayList(convertToColumnValueMap(entity).values()); + } + + public Map<String, Object> convertToColumnValueMap(Entity entity) { + return doConvertToColumnValueMap(entity); + } + + public List<String> convertToColumnStringValueList(Entity entity) { + return newArrayList(convertToColumnStringValueMap(entity).values()); + } + + public Map<String, String> convertToColumnStringValueMap(Entity entity) { + return doConvertToColumnStringValueMap(entity); + } + + //========================================================================== + // ========= + // Entity Property Setup + // ===================== + // It's very INTERNAL! + protected Map<String, Eps<UserInfo>> _epsMap = newHashMap(); + { + setupEps(_epsMap, new EpsUserId(), columnUserId()); + setupEps(_epsMap, new EpsGivenName(), columnGivenName()); + setupEps(_epsMap, new EpsFamilyName(), columnFamilyName()); + setupEps(_epsMap, new EpsMiddleName(), columnMiddleName()); + setupEps(_epsMap, new EpsGivenNameDesc(), columnGivenNameDesc()); + setupEps(_epsMap, new EpsFamilyNameDesc(), columnFamilyNameDesc()); + setupEps(_epsMap, new EpsNickname(), columnNickname()); + setupEps(_epsMap, new EpsGender(), columnGender()); + setupEps(_epsMap, new EpsBirthDate(), columnBirthDate()); + setupEps(_epsMap, new EpsEmail(), columnEmail()); + setupEps(_epsMap, new EpsUrl(), columnUrl()); + setupEps(_epsMap, new EpsTelephone(), columnTelephone()); + setupEps(_epsMap, new EpsRoleId(), columnRoleId()); + setupEps(_epsMap, new EpsGroupId(), columnGroupId()); + setupEps(_epsMap, new EpsCreatedTime(), columnCreatedTime()); + setupEps(_epsMap, new EpsCreatedBy(), columnCreatedBy()); + setupEps(_epsMap, new EpsUpdatedTime(), columnUpdatedTime()); + setupEps(_epsMap, new EpsUpdatedBy(), columnUpdatedBy()); + setupEps(_epsMap, new EpsDeletedTime(), columnDeletedTime()); + setupEps(_epsMap, new EpsDeletedBy(), columnDeletedBy()); + setupEps(_epsMap, new EpsVersionno(), columnVersionno()); + } + + public boolean hasEntityPropertySetupper(String propertyName) { + return _epsMap.containsKey(propertyName); + } + + public void setupEntityProperty(String propertyName, Object entity, + Object value) { + findEps(_epsMap, propertyName).setup((UserInfo) entity, value); + } + + public static class EpsUserId implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setUserId((String) v); + } + } + + public static class EpsGivenName implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setGivenName((String) v); + } + } + + public static class EpsFamilyName implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setFamilyName((String) v); + } + } + + public static class EpsMiddleName implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setMiddleName((String) v); + } + } + + public static class EpsGivenNameDesc implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setGivenNameDesc((String) v); + } + } + + public static class EpsFamilyNameDesc implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setFamilyNameDesc((String) v); + } + } + + public static class EpsNickname implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setNickname((String) v); + } + } + + public static class EpsGender implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setGender((String) v); + } + } + + public static class EpsBirthDate implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setBirthDate((java.util.Date) v); + } + } + + public static class EpsEmail implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setEmail((String) v); + } + } + + public static class EpsUrl implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setUrl((String) v); + } + } + + public static class EpsTelephone implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setTelephone((String) v); + } + } + + public static class EpsRoleId implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setRoleId((String) v); + } + } + + public static class EpsGroupId implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setGroupId((String) v); + } + } + + public static class EpsCreatedTime implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setCreatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsCreatedBy implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setCreatedBy((String) v); + } + } + + public static class EpsUpdatedTime implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setUpdatedTime((java.sql.Timestamp) v); + } + } + + public static class EpsUpdatedBy implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setUpdatedBy((String) v); + } + } + + public static class EpsDeletedTime implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setDeletedTime((java.sql.Timestamp) v); + } + } + + public static class EpsDeletedBy implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setDeletedBy((String) v); + } + } + + public static class EpsVersionno implements Eps<UserInfo> { + public void setup(UserInfo e, Object v) { + e.setVersionno((Integer) v); + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/bsentity/dbmeta/UserInfoDbm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupInfoCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupInfoCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupInfoCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of GROUP_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfoCB extends jp.sf.pal.scheduler.db.cbean.bs.BsGroupInfoCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupInfoCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of GROUP_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMappingCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsGroupMappingCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/GroupMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleInfoCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleInfoCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleInfoCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of ROLE_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfoCB extends jp.sf.pal.scheduler.db.cbean.bs.BsRoleInfoCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleInfoCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of ROLE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMappingCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsRoleMappingCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoleMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of ROUTINE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsRoutineScheduleCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleContentCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleContentCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleContentCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of ROUTINE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContentCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsRoutineScheduleContentCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleContentCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of ROUTINE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMappingCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsRoutineScheduleMappingCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/RoutineScheduleMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of SINGLE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsSingleScheduleCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleContentCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleContentCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleContentCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of SINGLE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContentCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsSingleScheduleContentCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleContentCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of SINGLE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMappingCB extends + jp.sf.pal.scheduler.db.cbean.bs.BsSingleScheduleMappingCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/SingleScheduleMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/UserInfoCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/UserInfoCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/UserInfoCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.cbean; + +/** + * The condition-bean of USER_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfoCB extends jp.sf.pal.scheduler.db.cbean.bs.BsUserInfoCB { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/UserInfoCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupInfoCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupInfoCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupInfoCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,295 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; + +/** + * The base condition-bean of GROUP_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsGroupInfoCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected GroupInfoCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "GROUP_INFO"; + } + + public String getTableSqlName() { + return "GROUP_INFO"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("GROUP_ID"); + if (obj instanceof String) { + query().setGroupId_Equal((String) obj); + } else { + checkTypeString(obj, "groupId", "String"); + query().setGroupId_Equal((String) obj); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_GroupId_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_GroupId_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public GroupInfoCQ query() { + return getConditionQuery(); + } + + public GroupInfoCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new GroupInfoCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<GroupInfoCB>() { + * public void query(GroupInfoCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<GroupInfoCB> unionQuery) { + final GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final GroupInfoCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<GroupInfoCB>() { + * public void query(GroupInfoCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<GroupInfoCB> unionQuery) { + final GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final GroupInfoCQ cq = cb.query(); + 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(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<GroupInfoCQ>() { + public boolean has() { + return true; + } + + public GroupInfoCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<GroupInfoCQ> { + protected SpQyCall<GroupInfoCQ> _myQyCall; + + public Specification(ConditionBean baseCB, + SpQyCall<GroupInfoCQ> qyCall, boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnGroupId() { + doColumn("GROUP_ID"); + } + + public void columnName() { + doColumn("NAME"); + } + + public void columnDescription() { + doColumn("DESCRIPTION"); + } + + public void columnEmail() { + doColumn("EMAIL"); + } + + public void columnUrl() { + doColumn("URL"); + } + + public void columnTelephone() { + doColumn("TELEPHONE"); + } + + public void columnCreatedTime() { + doColumn("CREATED_TIME"); + } + + public void columnCreatedBy() { + doColumn("CREATED_BY"); + } + + public void columnUpdatedTime() { + doColumn("UPDATED_TIME"); + } + + public void columnUpdatedBy() { + doColumn("UPDATED_BY"); + } + + public void columnDeletedTime() { + doColumn("DELETED_TIME"); + } + + public void columnDeletedBy() { + doColumn("DELETED_BY"); + } + + public void columnVersionno() { + doColumn("VERSIONNO"); + } + + protected void doSpecifyRequiredColumn() { + columnGroupId();// PK + } + + protected String getTableDbName() { + return "GROUP_INFO"; + } + + public RAFunction<GroupMappingCB, GroupInfoCQ> derivedGroupMappingList() { + return new RAFunction<GroupMappingCB, GroupInfoCQ>(_baseCB, + _myQyCall.qy(), + new RAQSetupper<GroupMappingCB, GroupInfoCQ>() { + public void setup(String function, + SubQuery<GroupMappingCB> subQuery, + GroupInfoCQ cq, String aliasName) { + cq.xderiveGroupMappingList(function, subQuery, + aliasName); + } + }); + } + + public RAFunction<UserInfoCB, GroupInfoCQ> derivedUserInfoList() { + return new RAFunction<UserInfoCB, GroupInfoCQ>(_baseCB, _myQyCall + .qy(), new RAQSetupper<UserInfoCB, GroupInfoCQ>() { + public void setup(String function, + SubQuery<UserInfoCB> subQuery, GroupInfoCQ cq, + String aliasName) { + cq.xderiveUserInfoList(function, subQuery, aliasName); + } + }); + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return GroupInfoCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupInfoCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,325 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.nss.GroupInfoNss; +import jp.sf.pal.scheduler.db.cbean.nss.UserInfoNss; + +/** + * The base condition-bean of GROUP_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsGroupMappingCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected GroupMappingCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "GROUP_MAPPING"; + } + + public String getTableSqlName() { + return "GROUP_MAPPING"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Integer) { + query().setId_Equal((Integer) obj); + } else { + query().setId_Equal(new Integer((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public GroupMappingCQ query() { + return getConditionQuery(); + } + + public GroupMappingCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new GroupMappingCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<GroupMappingCB>() { + * public void query(GroupMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<GroupMappingCB> unionQuery) { + final GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final GroupMappingCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<GroupMappingCB>() { + * public void query(GroupMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<GroupMappingCB> unionQuery) { + final GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final GroupMappingCQ cq = cb.query(); + 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(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected GroupInfoNss _nssGroupInfo; + + public GroupInfoNss getNssGroupInfo() { + if (_nssGroupInfo == null) { + _nssGroupInfo = new GroupInfoNss(null); + } + return _nssGroupInfo; + } + + public GroupInfoNss setupSelect_GroupInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryGroupInfo(); + } + }); + if (_nssGroupInfo == null || !_nssGroupInfo.hasConditionQuery()) { + _nssGroupInfo = new GroupInfoNss(query().queryGroupInfo()); + } + return _nssGroupInfo; + } + + protected UserInfoNss _nssUserInfo; + + public UserInfoNss getNssUserInfo() { + if (_nssUserInfo == null) { + _nssUserInfo = new UserInfoNss(null); + } + return _nssUserInfo; + } + + public UserInfoNss setupSelect_UserInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryUserInfo(); + } + }); + if (_nssUserInfo == null || !_nssUserInfo.hasConditionQuery()) { + _nssUserInfo = new UserInfoNss(query().queryUserInfo()); + } + return _nssUserInfo; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<GroupMappingCQ>() { + public boolean has() { + return true; + } + + public GroupMappingCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<GroupMappingCQ> { + protected SpQyCall<GroupMappingCQ> _myQyCall; + + protected GroupInfoCB.Specification _groupInfo; + + protected UserInfoCB.Specification _userInfo; + + public Specification(ConditionBean baseCB, + SpQyCall<GroupMappingCQ> qyCall, boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnUserId() { + doColumn("USER_ID"); + } + + public void columnGroupId() { + doColumn("GROUP_ID"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQueryGroupInfo()) { + columnGroupId();// FK + } + if (_myQyCall.qy().hasConditionQueryUserInfo()) { + columnUserId();// FK + } + } + + protected String getTableDbName() { + return "GROUP_MAPPING"; + } + + public GroupInfoCB.Specification specifyGroupInfo() { + assertForeign("groupInfo"); + if (_groupInfo == null) { + _groupInfo = new GroupInfoCB.Specification(_baseCB, + new SpQyCall<GroupInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryGroupInfo(); + } + + public GroupInfoCQ qy() { + return _myQyCall.qy().queryGroupInfo(); + } + }, _forDeriveReferrer); + } + return _groupInfo; + } + + public UserInfoCB.Specification specifyUserInfo() { + assertForeign("userInfo"); + if (_userInfo == null) { + _userInfo = new UserInfoCB.Specification(_baseCB, + new SpQyCall<UserInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryUserInfo(); + } + + public UserInfoCQ qy() { + return _myQyCall.qy().queryUserInfo(); + } + }, _forDeriveReferrer); + } + return _userInfo; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return GroupMappingCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsGroupMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleInfoCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleInfoCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleInfoCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,292 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; + +/** + * The base condition-bean of ROLE_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoleInfoCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoleInfoCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROLE_INFO"; + } + + public String getTableSqlName() { + return "ROLE_INFO"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ROLE_ID"); + if (obj instanceof String) { + query().setRoleId_Equal((String) obj); + } else { + checkTypeString(obj, "roleId", "String"); + query().setRoleId_Equal((String) obj); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_RoleId_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_RoleId_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public RoleInfoCQ query() { + return getConditionQuery(); + } + + public RoleInfoCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new RoleInfoCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<RoleInfoCB>() { + * public void query(RoleInfoCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<RoleInfoCB> unionQuery) { + final RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoleInfoCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<RoleInfoCB>() { + * public void query(RoleInfoCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<RoleInfoCB> unionQuery) { + final RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoleInfoCQ cq = cb.query(); + 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(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<RoleInfoCQ>() { + public boolean has() { + return true; + } + + public RoleInfoCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends AbstractSpecification<RoleInfoCQ> { + protected SpQyCall<RoleInfoCQ> _myQyCall; + + public Specification(ConditionBean baseCB, SpQyCall<RoleInfoCQ> qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnRoleId() { + doColumn("ROLE_ID"); + } + + public void columnName() { + doColumn("NAME"); + } + + public void columnDescription() { + doColumn("DESCRIPTION"); + } + + public void columnEmail() { + doColumn("EMAIL"); + } + + public void columnUrl() { + doColumn("URL"); + } + + public void columnTelephone() { + doColumn("TELEPHONE"); + } + + public void columnCreatedTime() { + doColumn("CREATED_TIME"); + } + + public void columnCreatedBy() { + doColumn("CREATED_BY"); + } + + public void columnUpdatedTime() { + doColumn("UPDATED_TIME"); + } + + public void columnUpdatedBy() { + doColumn("UPDATED_BY"); + } + + public void columnDeletedTime() { + doColumn("DELETED_TIME"); + } + + public void columnDeletedBy() { + doColumn("DELETED_BY"); + } + + public void columnVersionno() { + doColumn("VERSIONNO"); + } + + protected void doSpecifyRequiredColumn() { + columnRoleId();// PK + } + + protected String getTableDbName() { + return "ROLE_INFO"; + } + + public RAFunction<RoleMappingCB, RoleInfoCQ> derivedRoleMappingList() { + return new RAFunction<RoleMappingCB, RoleInfoCQ>(_baseCB, _myQyCall + .qy(), new RAQSetupper<RoleMappingCB, RoleInfoCQ>() { + public void setup(String function, + SubQuery<RoleMappingCB> subQuery, RoleInfoCQ cq, + String aliasName) { + cq.xderiveRoleMappingList(function, subQuery, aliasName); + } + }); + } + + public RAFunction<UserInfoCB, RoleInfoCQ> derivedUserInfoList() { + return new RAFunction<UserInfoCB, RoleInfoCQ>(_baseCB, _myQyCall + .qy(), new RAQSetupper<UserInfoCB, RoleInfoCQ>() { + public void setup(String function, + SubQuery<UserInfoCB> subQuery, RoleInfoCQ cq, + String aliasName) { + cq.xderiveUserInfoList(function, subQuery, aliasName); + } + }); + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoleInfoCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleInfoCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,325 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.nss.RoleInfoNss; +import jp.sf.pal.scheduler.db.cbean.nss.UserInfoNss; + +/** + * The base condition-bean of ROLE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoleMappingCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoleMappingCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROLE_MAPPING"; + } + + public String getTableSqlName() { + return "ROLE_MAPPING"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Integer) { + query().setId_Equal((Integer) obj); + } else { + query().setId_Equal(new Integer((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public RoleMappingCQ query() { + return getConditionQuery(); + } + + public RoleMappingCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new RoleMappingCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<RoleMappingCB>() { + * public void query(RoleMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<RoleMappingCB> unionQuery) { + final RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoleMappingCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<RoleMappingCB>() { + * public void query(RoleMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<RoleMappingCB> unionQuery) { + final RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoleMappingCQ cq = cb.query(); + 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(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected RoleInfoNss _nssRoleInfo; + + public RoleInfoNss getNssRoleInfo() { + if (_nssRoleInfo == null) { + _nssRoleInfo = new RoleInfoNss(null); + } + return _nssRoleInfo; + } + + public RoleInfoNss setupSelect_RoleInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryRoleInfo(); + } + }); + if (_nssRoleInfo == null || !_nssRoleInfo.hasConditionQuery()) { + _nssRoleInfo = new RoleInfoNss(query().queryRoleInfo()); + } + return _nssRoleInfo; + } + + protected UserInfoNss _nssUserInfo; + + public UserInfoNss getNssUserInfo() { + if (_nssUserInfo == null) { + _nssUserInfo = new UserInfoNss(null); + } + return _nssUserInfo; + } + + public UserInfoNss setupSelect_UserInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryUserInfo(); + } + }); + if (_nssUserInfo == null || !_nssUserInfo.hasConditionQuery()) { + _nssUserInfo = new UserInfoNss(query().queryUserInfo()); + } + return _nssUserInfo; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<RoleMappingCQ>() { + public boolean has() { + return true; + } + + public RoleMappingCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<RoleMappingCQ> { + protected SpQyCall<RoleMappingCQ> _myQyCall; + + protected RoleInfoCB.Specification _roleInfo; + + protected UserInfoCB.Specification _userInfo; + + public Specification(ConditionBean baseCB, + SpQyCall<RoleMappingCQ> qyCall, boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnUserId() { + doColumn("USER_ID"); + } + + public void columnRoleId() { + doColumn("ROLE_ID"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQueryRoleInfo()) { + columnRoleId();// FK + } + if (_myQyCall.qy().hasConditionQueryUserInfo()) { + columnUserId();// FK + } + } + + protected String getTableDbName() { + return "ROLE_MAPPING"; + } + + public RoleInfoCB.Specification specifyRoleInfo() { + assertForeign("roleInfo"); + if (_roleInfo == null) { + _roleInfo = new RoleInfoCB.Specification(_baseCB, + new SpQyCall<RoleInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryRoleInfo(); + } + + public RoleInfoCQ qy() { + return _myQyCall.qy().queryRoleInfo(); + } + }, _forDeriveReferrer); + } + return _roleInfo; + } + + public UserInfoCB.Specification specifyUserInfo() { + assertForeign("userInfo"); + if (_userInfo == null) { + _userInfo = new UserInfoCB.Specification(_baseCB, + new SpQyCall<UserInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryUserInfo(); + } + + public UserInfoCQ qy() { + return _myQyCall.qy().queryUserInfo(); + } + }, _forDeriveReferrer); + } + return _userInfo; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoleMappingCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoleMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,342 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.nss.RoutineScheduleContentNss; + +/** + * The base condition-bean of ROUTINE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoutineScheduleCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Long) { + query().setId_Equal((Long) obj); + } else { + query().setId_Equal(new Long((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public RoutineScheduleCQ query() { + return getConditionQuery(); + } + + public RoutineScheduleCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new RoutineScheduleCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<RoutineScheduleCB>() { + * public void query(RoutineScheduleCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<RoutineScheduleCB> unionQuery) { + final RoutineScheduleCB cb = new RoutineScheduleCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoutineScheduleCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<RoutineScheduleCB>() { + * public void query(RoutineScheduleCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<RoutineScheduleCB> unionQuery) { + final RoutineScheduleCB cb = new RoutineScheduleCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoutineScheduleCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery<RoutineScheduleCB> + * unionQuery). + */ + public void union(RoutineScheduleCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use unionAll(UnionQuery<RoutineScheduleCB> + * unionQuery). + */ + public void unionAll(RoutineScheduleCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected RoutineScheduleContentNss _nssRoutineScheduleContentAsOne; + + public RoutineScheduleContentNss getNssRoutineScheduleContentAsOne() { + if (_nssRoutineScheduleContentAsOne == null) { + _nssRoutineScheduleContentAsOne = new RoutineScheduleContentNss( + null); + } + return _nssRoutineScheduleContentAsOne; + } + + public RoutineScheduleContentNss setupSelect_RoutineScheduleContentAsOne() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryRoutineScheduleContentAsOne(); + } + }); + if (_nssRoutineScheduleContentAsOne == null + || !_nssRoutineScheduleContentAsOne.hasConditionQuery()) { + _nssRoutineScheduleContentAsOne = new RoutineScheduleContentNss( + query().queryRoutineScheduleContentAsOne()); + } + return _nssRoutineScheduleContentAsOne; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<RoutineScheduleCQ>() { + public boolean has() { + return true; + } + + public RoutineScheduleCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<RoutineScheduleCQ> { + protected SpQyCall<RoutineScheduleCQ> _myQyCall; + + protected RoutineScheduleContentCB.Specification _routineScheduleContentAsOne; + + public Specification(ConditionBean baseCB, + SpQyCall<RoutineScheduleCQ> qyCall, boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnTitle() { + doColumn("TITLE"); + } + + public void columnLocation() { + doColumn("LOCATION"); + } + + public void columnStartDate() { + doColumn("START_DATE"); + } + + public void columnStartTime() { + doColumn("START_TIME"); + } + + public void columnEndDate() { + doColumn("END_DATE"); + } + + public void columnEndTime() { + doColumn("END_TIME"); + } + + public void columnType() { + doColumn("TYPE"); + } + + public void columnCreatedTime() { + doColumn("CREATED_TIME"); + } + + public void columnCreatedBy() { + doColumn("CREATED_BY"); + } + + public void columnUpdatedTime() { + doColumn("UPDATED_TIME"); + } + + public void columnUpdatedBy() { + doColumn("UPDATED_BY"); + } + + public void columnDeletedTime() { + doColumn("DELETED_TIME"); + } + + public void columnDeletedBy() { + doColumn("DELETED_BY"); + } + + public void columnVersionno() { + doColumn("VERSIONNO"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + } + + protected String getTableDbName() { + return "ROUTINE_SCHEDULE"; + } + + public RoutineScheduleContentCB.Specification specifyRoutineScheduleContentAsOne() { + assertForeign("routineScheduleContentAsOne"); + if (_routineScheduleContentAsOne == null) { + _routineScheduleContentAsOne = new RoutineScheduleContentCB.Specification( + _baseCB, new SpQyCall<RoutineScheduleContentCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQueryRoutineScheduleContentAsOne(); + } + + public RoutineScheduleContentCQ qy() { + return _myQyCall.qy() + .queryRoutineScheduleContentAsOne(); + } + }, _forDeriveReferrer); + } + return _routineScheduleContentAsOne; + } + + public RAFunction<RoutineScheduleMappingCB, RoutineScheduleCQ> derivedRoutineScheduleMappingList() { + return new RAFunction<RoutineScheduleMappingCB, RoutineScheduleCQ>( + _baseCB, + _myQyCall.qy(), + new RAQSetupper<RoutineScheduleMappingCB, RoutineScheduleCQ>() { + public void setup(String function, + SubQuery<RoutineScheduleMappingCB> subQuery, + RoutineScheduleCQ cq, String aliasName) { + cq.xderiveRoutineScheduleMappingList(function, + subQuery, aliasName); + } + }); + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoutineScheduleCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleContentCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleContentCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleContentCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,276 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.nss.RoutineScheduleNss; + +/** + * The base condition-bean of ROUTINE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoutineScheduleContentCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleContentCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Long) { + query().setId_Equal((Long) obj); + } else { + query().setId_Equal(new Long((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public RoutineScheduleContentCQ query() { + return getConditionQuery(); + } + + public RoutineScheduleContentCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new RoutineScheduleContentCQ(null, + getSqlClause(), getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<RoutineScheduleContentCB>() { + * public void query(RoutineScheduleContentCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<RoutineScheduleContentCB> unionQuery) { + final RoutineScheduleContentCB cb = new RoutineScheduleContentCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoutineScheduleContentCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<RoutineScheduleContentCB>() { + * public void query(RoutineScheduleContentCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<RoutineScheduleContentCB> unionQuery) { + final RoutineScheduleContentCB cb = new RoutineScheduleContentCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoutineScheduleContentCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery<RoutineScheduleContentCB> + * unionQuery). + */ + public void union(RoutineScheduleContentCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use + * unionAll(UnionQuery<RoutineScheduleContentCB> unionQuery). + */ + public void unionAll(RoutineScheduleContentCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected RoutineScheduleNss _nssRoutineSchedule; + + public RoutineScheduleNss getNssRoutineSchedule() { + if (_nssRoutineSchedule == null) { + _nssRoutineSchedule = new RoutineScheduleNss(null); + } + return _nssRoutineSchedule; + } + + public RoutineScheduleNss setupSelect_RoutineSchedule() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryRoutineSchedule(); + } + }); + if (_nssRoutineSchedule == null + || !_nssRoutineSchedule.hasConditionQuery()) { + _nssRoutineSchedule = new RoutineScheduleNss(query() + .queryRoutineSchedule()); + } + return _nssRoutineSchedule; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<RoutineScheduleContentCQ>() { + public boolean has() { + return true; + } + + public RoutineScheduleContentCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<RoutineScheduleContentCQ> { + protected SpQyCall<RoutineScheduleContentCQ> _myQyCall; + + protected RoutineScheduleCB.Specification _routineSchedule; + + public Specification(ConditionBean baseCB, + SpQyCall<RoutineScheduleContentCQ> qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnContent() { + doColumn("CONTENT"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQueryRoutineSchedule()) { + } + } + + protected String getTableDbName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + public RoutineScheduleCB.Specification specifyRoutineSchedule() { + assertForeign("routineSchedule"); + if (_routineSchedule == null) { + _routineSchedule = new RoutineScheduleCB.Specification(_baseCB, + new SpQyCall<RoutineScheduleCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQueryRoutineSchedule(); + } + + public RoutineScheduleCQ qy() { + return _myQyCall.qy().queryRoutineSchedule(); + } + }, _forDeriveReferrer); + } + return _routineSchedule; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoutineScheduleContentCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleContentCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleContentCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,329 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.nss.RoutineScheduleNss; +import jp.sf.pal.scheduler.db.cbean.nss.UserInfoNss; + +/** + * The base condition-bean of ROUTINE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoutineScheduleMappingCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleMappingCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Long) { + query().setId_Equal((Long) obj); + } else { + query().setId_Equal(new Long((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public RoutineScheduleMappingCQ query() { + return getConditionQuery(); + } + + public RoutineScheduleMappingCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new RoutineScheduleMappingCQ(null, + getSqlClause(), getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<RoutineScheduleMappingCB>() { + * public void query(RoutineScheduleMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<RoutineScheduleMappingCB> unionQuery) { + final RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoutineScheduleMappingCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<RoutineScheduleMappingCB>() { + * public void query(RoutineScheduleMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<RoutineScheduleMappingCB> unionQuery) { + final RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final RoutineScheduleMappingCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery<RoutineScheduleMappingCB> + * unionQuery). + */ + public void union(RoutineScheduleMappingCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use + * unionAll(UnionQuery<RoutineScheduleMappingCB> unionQuery). + */ + public void unionAll(RoutineScheduleMappingCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected RoutineScheduleNss _nssRoutineSchedule; + + public RoutineScheduleNss getNssRoutineSchedule() { + if (_nssRoutineSchedule == null) { + _nssRoutineSchedule = new RoutineScheduleNss(null); + } + return _nssRoutineSchedule; + } + + public RoutineScheduleNss setupSelect_RoutineSchedule() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryRoutineSchedule(); + } + }); + if (_nssRoutineSchedule == null + || !_nssRoutineSchedule.hasConditionQuery()) { + _nssRoutineSchedule = new RoutineScheduleNss(query() + .queryRoutineSchedule()); + } + return _nssRoutineSchedule; + } + + protected UserInfoNss _nssUserInfo; + + public UserInfoNss getNssUserInfo() { + if (_nssUserInfo == null) { + _nssUserInfo = new UserInfoNss(null); + } + return _nssUserInfo; + } + + public UserInfoNss setupSelect_UserInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryUserInfo(); + } + }); + if (_nssUserInfo == null || !_nssUserInfo.hasConditionQuery()) { + _nssUserInfo = new UserInfoNss(query().queryUserInfo()); + } + return _nssUserInfo; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<RoutineScheduleMappingCQ>() { + public boolean has() { + return true; + } + + public RoutineScheduleMappingCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<RoutineScheduleMappingCQ> { + protected SpQyCall<RoutineScheduleMappingCQ> _myQyCall; + + protected RoutineScheduleCB.Specification _routineSchedule; + + protected UserInfoCB.Specification _userInfo; + + public Specification(ConditionBean baseCB, + SpQyCall<RoutineScheduleMappingCQ> qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnScheduleId() { + doColumn("SCHEDULE_ID"); + } + + public void columnUserId() { + doColumn("USER_ID"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQueryRoutineSchedule()) { + columnScheduleId();// FK + } + if (_myQyCall.qy().hasConditionQueryUserInfo()) { + columnUserId();// FK + } + } + + protected String getTableDbName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + public RoutineScheduleCB.Specification specifyRoutineSchedule() { + assertForeign("routineSchedule"); + if (_routineSchedule == null) { + _routineSchedule = new RoutineScheduleCB.Specification(_baseCB, + new SpQyCall<RoutineScheduleCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQueryRoutineSchedule(); + } + + public RoutineScheduleCQ qy() { + return _myQyCall.qy().queryRoutineSchedule(); + } + }, _forDeriveReferrer); + } + return _routineSchedule; + } + + public UserInfoCB.Specification specifyUserInfo() { + assertForeign("userInfo"); + if (_userInfo == null) { + _userInfo = new UserInfoCB.Specification(_baseCB, + new SpQyCall<UserInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryUserInfo(); + } + + public UserInfoCQ qy() { + return _myQyCall.qy().queryUserInfo(); + } + }, _forDeriveReferrer); + } + return _userInfo; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoutineScheduleMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleMappingCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsRoutineScheduleMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,337 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.nss.SingleScheduleContentNss; + +/** + * The base condition-bean of SINGLE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsSingleScheduleCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Long) { + query().setId_Equal((Long) obj); + } else { + query().setId_Equal(new Long((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public SingleScheduleCQ query() { + return getConditionQuery(); + } + + public SingleScheduleCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new SingleScheduleCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<SingleScheduleCB>() { + * public void query(SingleScheduleCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<SingleScheduleCB> unionQuery) { + final SingleScheduleCB cb = new SingleScheduleCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final SingleScheduleCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<SingleScheduleCB>() { + * public void query(SingleScheduleCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<SingleScheduleCB> unionQuery) { + final SingleScheduleCB cb = new SingleScheduleCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final SingleScheduleCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery<SingleScheduleCB> + * unionQuery). + */ + public void union(SingleScheduleCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use unionAll(UnionQuery<SingleScheduleCB> + * unionQuery). + */ + public void unionAll(SingleScheduleCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected SingleScheduleContentNss _nssSingleScheduleContentAsOne; + + public SingleScheduleContentNss getNssSingleScheduleContentAsOne() { + if (_nssSingleScheduleContentAsOne == null) { + _nssSingleScheduleContentAsOne = new SingleScheduleContentNss(null); + } + return _nssSingleScheduleContentAsOne; + } + + public SingleScheduleContentNss setupSelect_SingleScheduleContentAsOne() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().querySingleScheduleContentAsOne(); + } + }); + if (_nssSingleScheduleContentAsOne == null + || !_nssSingleScheduleContentAsOne.hasConditionQuery()) { + _nssSingleScheduleContentAsOne = new SingleScheduleContentNss( + query().querySingleScheduleContentAsOne()); + } + return _nssSingleScheduleContentAsOne; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<SingleScheduleCQ>() { + public boolean has() { + return true; + } + + public SingleScheduleCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<SingleScheduleCQ> { + protected SpQyCall<SingleScheduleCQ> _myQyCall; + + protected SingleScheduleContentCB.Specification _singleScheduleContentAsOne; + + public Specification(ConditionBean baseCB, + SpQyCall<SingleScheduleCQ> qyCall, boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnTitle() { + doColumn("TITLE"); + } + + public void columnLocation() { + doColumn("LOCATION"); + } + + public void columnStartDate() { + doColumn("START_DATE"); + } + + public void columnStartTime() { + doColumn("START_TIME"); + } + + public void columnEndDate() { + doColumn("END_DATE"); + } + + public void columnEndTime() { + doColumn("END_TIME"); + } + + public void columnCreatedTime() { + doColumn("CREATED_TIME"); + } + + public void columnCreatedBy() { + doColumn("CREATED_BY"); + } + + public void columnUpdatedTime() { + doColumn("UPDATED_TIME"); + } + + public void columnUpdatedBy() { + doColumn("UPDATED_BY"); + } + + public void columnDeletedTime() { + doColumn("DELETED_TIME"); + } + + public void columnDeletedBy() { + doColumn("DELETED_BY"); + } + + public void columnVersionno() { + doColumn("VERSIONNO"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + } + + protected String getTableDbName() { + return "SINGLE_SCHEDULE"; + } + + public SingleScheduleContentCB.Specification specifySingleScheduleContentAsOne() { + assertForeign("singleScheduleContentAsOne"); + if (_singleScheduleContentAsOne == null) { + _singleScheduleContentAsOne = new SingleScheduleContentCB.Specification( + _baseCB, new SpQyCall<SingleScheduleContentCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQuerySingleScheduleContentAsOne(); + } + + public SingleScheduleContentCQ qy() { + return _myQyCall.qy() + .querySingleScheduleContentAsOne(); + } + }, _forDeriveReferrer); + } + return _singleScheduleContentAsOne; + } + + public RAFunction<SingleScheduleMappingCB, SingleScheduleCQ> derivedSingleScheduleMappingList() { + return new RAFunction<SingleScheduleMappingCB, SingleScheduleCQ>( + _baseCB, + _myQyCall.qy(), + new RAQSetupper<SingleScheduleMappingCB, SingleScheduleCQ>() { + public void setup(String function, + SubQuery<SingleScheduleMappingCB> subQuery, + SingleScheduleCQ cq, String aliasName) { + cq.xderiveSingleScheduleMappingList(function, + subQuery, aliasName); + } + }); + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return SingleScheduleCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleContentCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleContentCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleContentCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,276 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.nss.SingleScheduleNss; + +/** + * The base condition-bean of SINGLE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsSingleScheduleContentCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleContentCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Long) { + query().setId_Equal((Long) obj); + } else { + query().setId_Equal(new Long((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public SingleScheduleContentCQ query() { + return getConditionQuery(); + } + + public SingleScheduleContentCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new SingleScheduleContentCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<SingleScheduleContentCB>() { + * public void query(SingleScheduleContentCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<SingleScheduleContentCB> unionQuery) { + final SingleScheduleContentCB cb = new SingleScheduleContentCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final SingleScheduleContentCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<SingleScheduleContentCB>() { + * public void query(SingleScheduleContentCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<SingleScheduleContentCB> unionQuery) { + final SingleScheduleContentCB cb = new SingleScheduleContentCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final SingleScheduleContentCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery<SingleScheduleContentCB> + * unionQuery). + */ + public void union(SingleScheduleContentCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use + * unionAll(UnionQuery<SingleScheduleContentCB> unionQuery). + */ + public void unionAll(SingleScheduleContentCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected SingleScheduleNss _nssSingleSchedule; + + public SingleScheduleNss getNssSingleSchedule() { + if (_nssSingleSchedule == null) { + _nssSingleSchedule = new SingleScheduleNss(null); + } + return _nssSingleSchedule; + } + + public SingleScheduleNss setupSelect_SingleSchedule() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().querySingleSchedule(); + } + }); + if (_nssSingleSchedule == null + || !_nssSingleSchedule.hasConditionQuery()) { + _nssSingleSchedule = new SingleScheduleNss(query() + .querySingleSchedule()); + } + return _nssSingleSchedule; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<SingleScheduleContentCQ>() { + public boolean has() { + return true; + } + + public SingleScheduleContentCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<SingleScheduleContentCQ> { + protected SpQyCall<SingleScheduleContentCQ> _myQyCall; + + protected SingleScheduleCB.Specification _singleSchedule; + + public Specification(ConditionBean baseCB, + SpQyCall<SingleScheduleContentCQ> qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnContent() { + doColumn("CONTENT"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQuerySingleSchedule()) { + } + } + + protected String getTableDbName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + public SingleScheduleCB.Specification specifySingleSchedule() { + assertForeign("singleSchedule"); + if (_singleSchedule == null) { + _singleSchedule = new SingleScheduleCB.Specification(_baseCB, + new SpQyCall<SingleScheduleCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQuerySingleSchedule(); + } + + public SingleScheduleCQ qy() { + return _myQyCall.qy().querySingleSchedule(); + } + }, _forDeriveReferrer); + } + return _singleSchedule; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return SingleScheduleContentCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleContentCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleContentCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleMappingCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleMappingCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleMappingCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,329 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.nss.SingleScheduleNss; +import jp.sf.pal.scheduler.db.cbean.nss.UserInfoNss; + +/** + * The base condition-bean of SINGLE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsSingleScheduleMappingCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleMappingCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("ID"); + if (obj instanceof Long) { + query().setId_Equal((Long) obj); + } else { + query().setId_Equal(new Long((String) obj)); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_Id_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_Id_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public SingleScheduleMappingCQ query() { + return getConditionQuery(); + } + + public SingleScheduleMappingCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new SingleScheduleMappingCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<SingleScheduleMappingCB>() { + * public void query(SingleScheduleMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<SingleScheduleMappingCB> unionQuery) { + final SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final SingleScheduleMappingCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<SingleScheduleMappingCB>() { + * public void query(SingleScheduleMappingCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<SingleScheduleMappingCB> unionQuery) { + final SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final SingleScheduleMappingCQ cq = cb.query(); + query().xsetUnionAllQuery(cq); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use union(UnionQuery<SingleScheduleMappingCB> + * unionQuery). + */ + public void union(SingleScheduleMappingCQ unionQuery) { + query().xsetUnionQuery(unionQuery); + } + + /** + * @param unionQuery The query of 'union'. (NotNull) + * @deprecated Sorry! Please use + * unionAll(UnionQuery<SingleScheduleMappingCB> unionQuery). + */ + public void unionAll(SingleScheduleMappingCQ unionQuery) { + query().xsetUnionAllQuery(unionQuery); + } + + public boolean hasUnionQueryOrUnionAllQuery() { + return query().hasUnionQueryOrUnionAllQuery(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected SingleScheduleNss _nssSingleSchedule; + + public SingleScheduleNss getNssSingleSchedule() { + if (_nssSingleSchedule == null) { + _nssSingleSchedule = new SingleScheduleNss(null); + } + return _nssSingleSchedule; + } + + public SingleScheduleNss setupSelect_SingleSchedule() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().querySingleSchedule(); + } + }); + if (_nssSingleSchedule == null + || !_nssSingleSchedule.hasConditionQuery()) { + _nssSingleSchedule = new SingleScheduleNss(query() + .querySingleSchedule()); + } + return _nssSingleSchedule; + } + + protected UserInfoNss _nssUserInfo; + + public UserInfoNss getNssUserInfo() { + if (_nssUserInfo == null) { + _nssUserInfo = new UserInfoNss(null); + } + return _nssUserInfo; + } + + public UserInfoNss setupSelect_UserInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryUserInfo(); + } + }); + if (_nssUserInfo == null || !_nssUserInfo.hasConditionQuery()) { + _nssUserInfo = new UserInfoNss(query().queryUserInfo()); + } + return _nssUserInfo; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<SingleScheduleMappingCQ>() { + public boolean has() { + return true; + } + + public SingleScheduleMappingCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends + AbstractSpecification<SingleScheduleMappingCQ> { + protected SpQyCall<SingleScheduleMappingCQ> _myQyCall; + + protected SingleScheduleCB.Specification _singleSchedule; + + protected UserInfoCB.Specification _userInfo; + + public Specification(ConditionBean baseCB, + SpQyCall<SingleScheduleMappingCQ> qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnId() { + doColumn("ID"); + } + + public void columnScheduleId() { + doColumn("SCHEDULE_ID"); + } + + public void columnUserId() { + doColumn("USER_ID"); + } + + protected void doSpecifyRequiredColumn() { + columnId();// PK + if (_myQyCall.qy().hasConditionQuerySingleSchedule()) { + columnScheduleId();// FK + } + if (_myQyCall.qy().hasConditionQueryUserInfo()) { + columnUserId();// FK + } + } + + protected String getTableDbName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + public SingleScheduleCB.Specification specifySingleSchedule() { + assertForeign("singleSchedule"); + if (_singleSchedule == null) { + _singleSchedule = new SingleScheduleCB.Specification(_baseCB, + new SpQyCall<SingleScheduleCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall + .qy() + .hasConditionQuerySingleSchedule(); + } + + public SingleScheduleCQ qy() { + return _myQyCall.qy().querySingleSchedule(); + } + }, _forDeriveReferrer); + } + return _singleSchedule; + } + + public UserInfoCB.Specification specifyUserInfo() { + assertForeign("userInfo"); + if (_userInfo == null) { + _userInfo = new UserInfoCB.Specification(_baseCB, + new SpQyCall<UserInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryUserInfo(); + } + + public UserInfoCQ qy() { + return _myQyCall.qy().queryUserInfo(); + } + }, _forDeriveReferrer); + } + return _userInfo; + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return SingleScheduleMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleMappingCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsSingleScheduleMappingCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsUserInfoCB.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsUserInfoCB.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsUserInfoCB.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,450 @@ +package jp.sf.pal.scheduler.db.cbean.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionBean; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.UnionQuery; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.nss.GroupInfoNss; +import jp.sf.pal.scheduler.db.cbean.nss.RoleInfoNss; + +/** + * The base condition-bean of USER_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsUserInfoCB extends AbstractConditionBean { + + //========================================================================== + // ========= + // Attribute + // ========= + protected UserInfoCQ _conditionQuery; + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "USER_INFO"; + } + + public String getTableSqlName() { + return "USER_INFO"; + } + + //========================================================================== + // ========= + // PrimaryKey Map + // ============== + public void acceptPrimaryKeyMap(Map<String, ? extends Object> primaryKeyMap) { + assertPrimaryKeyMap(primaryKeyMap); + { + Object obj = primaryKeyMap.get("USER_ID"); + if (obj instanceof String) { + query().setUserId_Equal((String) obj); + } else { + checkTypeString(obj, "userId", "String"); + query().setUserId_Equal((String) obj); + } + } + + } + + //========================================================================== + // ========= + // OrderBy Setting + // =============== + public ConditionBean addOrderBy_PK_Asc() { + query().addOrderBy_UserId_Asc(); + return this; + } + + public ConditionBean addOrderBy_PK_Desc() { + query().addOrderBy_UserId_Desc(); + return this; + } + + //========================================================================== + // ========= + // Query + // ===== + public UserInfoCQ query() { + return getConditionQuery(); + } + + public UserInfoCQ getConditionQuery() { + if (_conditionQuery == null) { + _conditionQuery = new UserInfoCQ(null, getSqlClause(), + getSqlClause().getLocalTableAliasName(), 0); + } + return _conditionQuery; + } + + public ConditionQuery getConditionQueryAsInterface() { + return getConditionQuery(); + } + + //========================================================================== + // ========= + // Union + // ===== + /** + * Set up 'union'. + * + * <pre> + * cb.query().union(new UnionQuery<UserInfoCB>() { + * public void query(UserInfoCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void union(UnionQuery<UserInfoCB> unionQuery) { + final UserInfoCB cb = new UserInfoCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final UserInfoCQ cq = cb.query(); + query().xsetUnionQuery(cq); + } + + /** + * Set up 'union all'. + * + * <pre> + * cb.query().unionAll(new UnionQuery<UserInfoCB>() { + * public void query(UserInfoCB unionCB) { + * unionCB.query().setXxx... + * } + * }); + * </pre> + * + * @param unionQuery The query of 'union'. (NotNull) + */ + public void unionAll(UnionQuery<UserInfoCB> unionQuery) { + final UserInfoCB cb = new UserInfoCB(); + cb.xsetupForUnion(); + unionQuery.query(cb); + final UserInfoCQ cq = cb.query(); + 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(); + } + + //========================================================================== + // ========= + // Setup Select + // ============ + + protected GroupInfoNss _nssGroupInfo; + + public GroupInfoNss getNssGroupInfo() { + if (_nssGroupInfo == null) { + _nssGroupInfo = new GroupInfoNss(null); + } + return _nssGroupInfo; + } + + public GroupInfoNss setupSelect_GroupInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryGroupInfo(); + } + }); + if (_nssGroupInfo == null || !_nssGroupInfo.hasConditionQuery()) { + _nssGroupInfo = new GroupInfoNss(query().queryGroupInfo()); + } + return _nssGroupInfo; + } + + protected RoleInfoNss _nssRoleInfo; + + public RoleInfoNss getNssRoleInfo() { + if (_nssRoleInfo == null) { + _nssRoleInfo = new RoleInfoNss(null); + } + return _nssRoleInfo; + } + + public RoleInfoNss setupSelect_RoleInfo() { + doSetupSelect(new SsCall() { + public ConditionQuery qf() { + return query().queryRoleInfo(); + } + }); + if (_nssRoleInfo == null || !_nssRoleInfo.hasConditionQuery()) { + _nssRoleInfo = new RoleInfoNss(query().queryRoleInfo()); + } + return _nssRoleInfo; + } + + // [DBFlute-0.7.4] + //========================================================================== + // ========= + // Specify + // ======= + protected Specification _specification; + + public Specification specify() { + if (_specification == null) { + _specification = new Specification(this, + new SpQyCall<UserInfoCQ>() { + public boolean has() { + return true; + } + + public UserInfoCQ qy() { + return query(); + } + }, _forDeriveReferrer); + } + return _specification; + } + + public static class Specification extends AbstractSpecification<UserInfoCQ> { + protected SpQyCall<UserInfoCQ> _myQyCall; + + protected GroupInfoCB.Specification _groupInfo; + + protected RoleInfoCB.Specification _roleInfo; + + public Specification(ConditionBean baseCB, SpQyCall<UserInfoCQ> qyCall, + boolean forDeriveReferrer) { + super(baseCB, qyCall, forDeriveReferrer); + _myQyCall = qyCall; + } + + public void columnUserId() { + doColumn("USER_ID"); + } + + public void columnGivenName() { + doColumn("GIVEN_NAME"); + } + + public void columnFamilyName() { + doColumn("FAMILY_NAME"); + } + + public void columnMiddleName() { + doColumn("MIDDLE_NAME"); + } + + public void columnGivenNameDesc() { + doColumn("GIVEN_NAME_DESC"); + } + + public void columnFamilyNameDesc() { + doColumn("FAMILY_NAME_DESC"); + } + + public void columnNickname() { + doColumn("NICKNAME"); + } + + public void columnGender() { + doColumn("GENDER"); + } + + public void columnBirthDate() { + doColumn("BIRTH_DATE"); + } + + public void columnEmail() { + doColumn("EMAIL"); + } + + public void columnUrl() { + doColumn("URL"); + } + + public void columnTelephone() { + doColumn("TELEPHONE"); + } + + public void columnRoleId() { + doColumn("ROLE_ID"); + } + + public void columnGroupId() { + doColumn("GROUP_ID"); + } + + public void columnCreatedTime() { + doColumn("CREATED_TIME"); + } + + public void columnCreatedBy() { + doColumn("CREATED_BY"); + } + + public void columnUpdatedTime() { + doColumn("UPDATED_TIME"); + } + + public void columnUpdatedBy() { + doColumn("UPDATED_BY"); + } + + public void columnDeletedTime() { + doColumn("DELETED_TIME"); + } + + public void columnDeletedBy() { + doColumn("DELETED_BY"); + } + + public void columnVersionno() { + doColumn("VERSIONNO"); + } + + protected void doSpecifyRequiredColumn() { + columnUserId();// PK + if (_myQyCall.qy().hasConditionQueryGroupInfo()) { + columnGroupId();// FK + } + if (_myQyCall.qy().hasConditionQueryRoleInfo()) { + columnRoleId();// FK + } + } + + protected String getTableDbName() { + return "USER_INFO"; + } + + public GroupInfoCB.Specification specifyGroupInfo() { + assertForeign("groupInfo"); + if (_groupInfo == null) { + _groupInfo = new GroupInfoCB.Specification(_baseCB, + new SpQyCall<GroupInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryGroupInfo(); + } + + public GroupInfoCQ qy() { + return _myQyCall.qy().queryGroupInfo(); + } + }, _forDeriveReferrer); + } + return _groupInfo; + } + + public RoleInfoCB.Specification specifyRoleInfo() { + assertForeign("roleInfo"); + if (_roleInfo == null) { + _roleInfo = new RoleInfoCB.Specification(_baseCB, + new SpQyCall<RoleInfoCQ>() { + public boolean has() { + return _myQyCall.has() + && _myQyCall.qy() + .hasConditionQueryRoleInfo(); + } + + public RoleInfoCQ qy() { + return _myQyCall.qy().queryRoleInfo(); + } + }, _forDeriveReferrer); + } + return _roleInfo; + } + + public RAFunction<GroupMappingCB, UserInfoCQ> derivedGroupMappingList() { + return new RAFunction<GroupMappingCB, UserInfoCQ>(_baseCB, + _myQyCall.qy(), + new RAQSetupper<GroupMappingCB, UserInfoCQ>() { + public void setup(String function, + SubQuery<GroupMappingCB> subQuery, + UserInfoCQ cq, String aliasName) { + cq.xderiveGroupMappingList(function, subQuery, + aliasName); + } + }); + } + + public RAFunction<RoleMappingCB, UserInfoCQ> derivedRoleMappingList() { + return new RAFunction<RoleMappingCB, UserInfoCQ>(_baseCB, _myQyCall + .qy(), new RAQSetupper<RoleMappingCB, UserInfoCQ>() { + public void setup(String function, + SubQuery<RoleMappingCB> subQuery, UserInfoCQ cq, + String aliasName) { + cq.xderiveRoleMappingList(function, subQuery, aliasName); + } + }); + } + + public RAFunction<RoutineScheduleMappingCB, UserInfoCQ> derivedRoutineScheduleMappingList() { + return new RAFunction<RoutineScheduleMappingCB, UserInfoCQ>( + _baseCB, _myQyCall.qy(), + new RAQSetupper<RoutineScheduleMappingCB, UserInfoCQ>() { + public void setup(String function, + SubQuery<RoutineScheduleMappingCB> subQuery, + UserInfoCQ cq, String aliasName) { + cq.xderiveRoutineScheduleMappingList(function, + subQuery, aliasName); + } + }); + } + + public RAFunction<SingleScheduleMappingCB, UserInfoCQ> derivedSingleScheduleMappingList() { + return new RAFunction<SingleScheduleMappingCB, UserInfoCQ>(_baseCB, + _myQyCall.qy(), + new RAQSetupper<SingleScheduleMappingCB, UserInfoCQ>() { + public void setup(String function, + SubQuery<SingleScheduleMappingCB> subQuery, + UserInfoCQ cq, String aliasName) { + cq.xderiveSingleScheduleMappingList(function, + subQuery, aliasName); + } + }); + } + } + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return UserInfoCQ.class.getName(); + } + + protected String getSubQueryClassNameInternally() { + return SubQuery.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/bs/BsUserInfoCB.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsGroupInfoCQ; + +/** + * The condition-query of GROUP_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfoCQ extends BsGroupInfoCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public GroupInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsGroupMappingCQ; + +/** + * The condition-query of GROUP_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMappingCQ extends BsGroupMappingCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public GroupMappingCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/GroupMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoleInfoCQ; + +/** + * The condition-query of ROLE_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfoCQ extends BsRoleInfoCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public RoleInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoleMappingCQ; + +/** + * The condition-query of ROLE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMappingCQ extends BsRoleMappingCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public RoleMappingCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoutineScheduleCQ; + +/** + * The condition-query of ROUTINE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleCQ extends BsRoutineScheduleCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public RoutineScheduleCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleContentCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleContentCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoutineScheduleContentCQ; + +/** + * The condition-query of ROUTINE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContentCQ extends BsRoutineScheduleContentCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public RoutineScheduleContentCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleContentCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoutineScheduleMappingCQ; + +/** + * The condition-query of ROUTINE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMappingCQ extends BsRoutineScheduleMappingCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public RoutineScheduleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/RoutineScheduleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsSingleScheduleCQ; + +/** + * The condition-query of SINGLE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleCQ extends BsSingleScheduleCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public SingleScheduleCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleContentCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleContentCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsSingleScheduleContentCQ; + +/** + * The condition-query of SINGLE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContentCQ extends BsSingleScheduleContentCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public SingleScheduleContentCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleContentCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsSingleScheduleMappingCQ; + +/** + * The condition-query of SINGLE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMappingCQ extends BsSingleScheduleMappingCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public SingleScheduleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/SingleScheduleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/UserInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/UserInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/UserInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,45 @@ +package jp.sf.pal.scheduler.db.cbean.cq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsUserInfoCQ; + +/** + * The condition-query of USER_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfoCQ extends BsUserInfoCQ { + + //========================================================================== + // ========= + // Constructor + // =========== + /** + * Constructor. + * + * @param childQuery Child query as abstract class. (Nullable: If null, this + * is base instance.) + * @param sqlClause SQL clause instance. (NotNull) + * @param aliasName My alias name. (NotNull) + * @param nestLevel Nest level. + */ + public UserInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Arrange Method + // ============== + // You can make original arrange query methods here. + // public void arranegeXxx() { + // ... + // } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/UserInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1896 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of GROUP_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsGroupInfoCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsGroupInfoCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "GROUP_INFO"; + } + + public String getTableSqlName() { + return "GROUP_INFO"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * VARCHAR(255)} + * + * @param groupId The value of groupId as equal. + */ + public void setGroupId_Equal(String groupId) { + regGroupId(CK_EQ, fRES(groupId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as notEqual. + */ + public void setGroupId_NotEqual(String groupId) { + regGroupId(CK_NE, fRES(groupId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as greaterThan. + */ + public void setGroupId_GreaterThan(String groupId) { + regGroupId(CK_GT, fRES(groupId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as lessThan. + */ + public void setGroupId_LessThan(String groupId) { + regGroupId(CK_LT, fRES(groupId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as greaterEqual. + */ + public void setGroupId_GreaterEqual(String groupId) { + regGroupId(CK_GE, fRES(groupId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as lessEqual. + */ + public void setGroupId_LessEqual(String groupId) { + regGroupId(CK_LE, fRES(groupId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as prefixSearch. + */ + public void setGroupId_PrefixSearch(String groupId) { + regGroupId(CK_PS, fRES(groupId)); + } + + /** + * 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.scheduler.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. + * + * @param groupIdList The collection of groupId as inScope. + */ + public void setGroupId_InScope(Collection<String> groupIdList) { + regGroupId(CK_INS, cTL(groupIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param groupId The collection of groupId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setGroupId_InScope( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), + "GROUP_ID", "GroupId", "groupId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param groupIdList The collection of groupId as notInScope. + */ + public void setGroupId_NotInScope(Collection<String> groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); + } + + /** + * @param groupMappingCBquery Query. + * @deprecated Please use inScopeGroupMappingList(subQuery) method. + */ + 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 inScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public 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. + registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public String keepGroupId_InScopeSubQuery_UserInfoList( + UserInfoCQ subQuery); + + public void notInScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery); + + public void notInScopeUserInfoList(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_NotInScopeSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public 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 ...)} + * + * @param subQuery The sub-query of GroupId_ExistsSubQuery_GroupMappingList + * for 'exists'. (NotNull) + */ + public void existsGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_ExistsSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public 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 + * ...)} + * + * @param subQuery The sub-query of GroupId_ExistsSubQuery_UserInfoList for + * 'exists'. (NotNull) + */ + public void existsUserInfoList(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_ExistsSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public String keepGroupId_ExistsSubQuery_UserInfoList( + UserInfoCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select GROUP_ID from + * GROUP_MAPPING where ...)} + * + * @param subQuery The sub-query of + * GroupId_NotExistsSubQuery_GroupMappingList for 'not exists'. + * (NotNull) + */ + public void notExistsGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_NotExistsSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public String keepGroupId_NotExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select GROUP_ID from + * USER_INFO where ...)} + * + * @param subQuery The sub-query of GroupId_NotExistsSubQuery_UserInfoList + * for 'not exists'. (NotNull) + */ + public void notExistsUserInfoList(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_NotExistsSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public 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(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_DeriveSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepGroupId_DeriveSubQuery_GroupMappingList( + GroupMappingCQ subQuery); + + public void xderiveUserInfoList(String function, + SubQuery<UserInfoCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_DeriveSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepGroupId_DeriveSubQuery_UserInfoList( + UserInfoCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setGroupId_IsNull() { + regGroupId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setGroupId_IsNotNull() { + regGroupId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regGroupId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId"); + } + + protected void registerInlineGroupId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId"); + } + + abstract protected ConditionValue getCValueGroupId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param name The value of name as equal. + */ + public void setName_Equal(String name) { + regName(CK_EQ, fRES(name)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as notEqual. + */ + public void setName_NotEqual(String name) { + regName(CK_NE, fRES(name)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as greaterThan. + */ + public void setName_GreaterThan(String name) { + regName(CK_GT, fRES(name)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as lessThan. + */ + public void setName_LessThan(String name) { + regName(CK_LT, fRES(name)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as greaterEqual. + */ + public void setName_GreaterEqual(String name) { + regName(CK_GE, fRES(name)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as lessEqual. + */ + public void setName_LessEqual(String name) { + regName(CK_LE, fRES(name)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as prefixSearch. + */ + public void setName_PrefixSearch(String name) { + regName(CK_PS, fRES(name)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", + "Name", "name", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nameList The collection of name as inScope. + */ + public void setName_InScope(Collection<String> nameList) { + regName(CK_INS, cTL(nameList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param name The collection of name as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setName_InScope( + String name, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", + "Name", "name", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nameList The collection of name as notInScope. + */ + public void setName_NotInScope(Collection<String> nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setName_IsNull() { + regName(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setName_IsNotNull() { + regName(CK_ISNN, DUMMY_OBJECT); + } + + protected void regName(ConditionKey key, Object value) { + registerQuery(key, value, getCValueName(), "NAME", "Name", "name"); + } + + protected void registerInlineName(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueName(), "NAME", "Name", "name"); + } + + abstract protected ConditionValue getCValueName(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param description The value of description as equal. + */ + public void setDescription_Equal(String description) { + regDescription(CK_EQ, fRES(description)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as notEqual. + */ + public void setDescription_NotEqual(String description) { + regDescription(CK_NE, fRES(description)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as greaterThan. + */ + public void setDescription_GreaterThan(String description) { + regDescription(CK_GT, fRES(description)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as lessThan. + */ + public void setDescription_LessThan(String description) { + regDescription(CK_LT, fRES(description)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as greaterEqual. + */ + public void setDescription_GreaterEqual(String description) { + regDescription(CK_GE, fRES(description)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as lessEqual. + */ + public void setDescription_LessEqual(String description) { + regDescription(CK_LE, fRES(description)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as prefixSearch. + */ + public void setDescription_PrefixSearch(String description) { + regDescription(CK_PS, fRES(description)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(description), + getCValueDescription(), "DESCRIPTION", "Description", + "description", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param descriptionList The collection of description as inScope. + */ + public void setDescription_InScope(Collection<String> descriptionList) { + regDescription(CK_INS, cTL(descriptionList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param description The collection of description as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDescription_InScope( + String description, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param descriptionList The collection of description as notInScope. + */ + public void setDescription_NotInScope(Collection<String> descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDescription_IsNull() { + regDescription(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDescription_IsNotNull() { + regDescription(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDescription(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDescription(), "DESCRIPTION", + "Description", "description"); + } + + protected void registerInlineDescription(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDescription(), "DESCRIPTION", + "Description", "description"); + } + + abstract protected ConditionValue getCValueDescription(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param email The value of email as equal. + */ + public void setEmail_Equal(String email) { + regEmail(CK_EQ, fRES(email)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as notEqual. + */ + public void setEmail_NotEqual(String email) { + regEmail(CK_NE, fRES(email)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as greaterThan. + */ + public void setEmail_GreaterThan(String email) { + regEmail(CK_GT, fRES(email)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as lessThan. + */ + public void setEmail_LessThan(String email) { + regEmail(CK_LT, fRES(email)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as greaterEqual. + */ + public void setEmail_GreaterEqual(String email) { + regEmail(CK_GE, fRES(email)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as lessEqual. + */ + public void setEmail_LessEqual(String email) { + regEmail(CK_LE, fRES(email)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as prefixSearch. + */ + public void setEmail_PrefixSearch(String email) { + regEmail(CK_PS, fRES(email)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", + "Email", "email", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param emailList The collection of email as inScope. + */ + public void setEmail_InScope(Collection<String> emailList) { + regEmail(CK_INS, cTL(emailList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param email The collection of email as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setEmail_InScope( + String email, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", + "Email", "email", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param emailList The collection of email as notInScope. + */ + public void setEmail_NotInScope(Collection<String> emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setEmail_IsNull() { + regEmail(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setEmail_IsNotNull() { + regEmail(CK_ISNN, DUMMY_OBJECT); + } + + protected void regEmail(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEmail(), "EMAIL", "Email", "email"); + } + + protected void registerInlineEmail(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEmail(), "EMAIL", "Email", + "email"); + } + + abstract protected ConditionValue getCValueEmail(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param url The value of url as equal. + */ + public void setUrl_Equal(String url) { + regUrl(CK_EQ, fRES(url)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as notEqual. + */ + public void setUrl_NotEqual(String url) { + regUrl(CK_NE, fRES(url)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as greaterThan. + */ + public void setUrl_GreaterThan(String url) { + regUrl(CK_GT, fRES(url)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as lessThan. + */ + public void setUrl_LessThan(String url) { + regUrl(CK_LT, fRES(url)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as greaterEqual. + */ + public void setUrl_GreaterEqual(String url) { + regUrl(CK_GE, fRES(url)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as lessEqual. + */ + public void setUrl_LessEqual(String url) { + regUrl(CK_LE, fRES(url)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as prefixSearch. + */ + public void setUrl_PrefixSearch(String url) { + regUrl(CK_PS, fRES(url)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", + "url", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param urlList The collection of url as inScope. + */ + public void setUrl_InScope(Collection<String> urlList) { + regUrl(CK_INS, cTL(urlList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param url The collection of url as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUrl_InScope( + String url, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", + "url", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param urlList The collection of url as notInScope. + */ + public void setUrl_NotInScope(Collection<String> urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setUrl_IsNull() { + regUrl(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setUrl_IsNotNull() { + regUrl(CK_ISNN, DUMMY_OBJECT); + } + + protected void regUrl(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUrl(), "URL", "Url", "url"); + } + + protected void registerInlineUrl(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUrl(), "URL", "Url", "url"); + } + + abstract protected ConditionValue getCValueUrl(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * + * @param telephone The value of telephone as equal. + */ + public void setTelephone_Equal(String telephone) { + regTelephone(CK_EQ, fRES(telephone)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as notEqual. + */ + public void setTelephone_NotEqual(String telephone) { + regTelephone(CK_NE, fRES(telephone)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as greaterThan. + */ + public void setTelephone_GreaterThan(String telephone) { + regTelephone(CK_GT, fRES(telephone)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as lessThan. + */ + public void setTelephone_LessThan(String telephone) { + regTelephone(CK_LT, fRES(telephone)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as greaterEqual. + */ + public void setTelephone_GreaterEqual(String telephone) { + regTelephone(CK_GE, fRES(telephone)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as lessEqual. + */ + public void setTelephone_LessEqual(String telephone) { + regTelephone(CK_LE, fRES(telephone)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as prefixSearch. + */ + public void setTelephone_PrefixSearch(String telephone) { + regTelephone(CK_PS, fRES(telephone)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), + "TELEPHONE", "Telephone", "telephone", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephoneList The collection of telephone as inScope. + */ + public void setTelephone_InScope(Collection<String> telephoneList) { + regTelephone(CK_INS, cTL(telephoneList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephone The collection of telephone as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setTelephone_InScope( + String telephone, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), + "TELEPHONE", "Telephone", "telephone", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephoneList The collection of telephone as notInScope. + */ + public void setTelephone_NotInScope(Collection<String> telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setTelephone_IsNull() { + regTelephone(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setTelephone_IsNotNull() { + regTelephone(CK_ISNN, DUMMY_OBJECT); + } + + protected void regTelephone(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone"); + } + + protected void registerInlineTelephone(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone"); + } + + abstract protected ConditionValue getCValueTelephone(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param createdTime The value of createdTime as equal. + */ + public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { + regCreatedTime(CK_EQ, createdTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as notEqual. + */ + public void setCreatedTime_NotEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_NE, createdTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterThan. + */ + public void setCreatedTime_GreaterThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GT, createdTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessThan. + */ + public void setCreatedTime_LessThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LT, createdTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterEqual. + */ + public void setCreatedTime_GreaterEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GE, createdTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessEqual. + */ + public void setCreatedTime_LessEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LE, createdTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setCreatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueCreatedTime(), + "CREATED_TIME", "CreatedTime", "createdTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + */ + public void setCreatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setCreatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regCreatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + protected void registerInlineCreatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + abstract protected ConditionValue getCValueCreatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param createdBy The value of createdBy as equal. + */ + public void setCreatedBy_Equal(String createdBy) { + regCreatedBy(CK_EQ, fRES(createdBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as notEqual. + */ + public void setCreatedBy_NotEqual(String createdBy) { + regCreatedBy(CK_NE, fRES(createdBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterThan. + */ + public void setCreatedBy_GreaterThan(String createdBy) { + regCreatedBy(CK_GT, fRES(createdBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessThan. + */ + public void setCreatedBy_LessThan(String createdBy) { + regCreatedBy(CK_LT, fRES(createdBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterEqual. + */ + public void setCreatedBy_GreaterEqual(String createdBy) { + regCreatedBy(CK_GE, fRES(createdBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessEqual. + */ + public void setCreatedBy_LessEqual(String createdBy) { + regCreatedBy(CK_LE, fRES(createdBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as prefixSearch. + */ + public void setCreatedBy_PrefixSearch(String createdBy) { + regCreatedBy(CK_PS, fRES(createdBy)); + } + + /** + * 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.scheduler.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. + * + * @param createdByList The collection of createdBy as inScope. + */ + public void setCreatedBy_InScope(Collection<String> createdByList) { + regCreatedBy(CK_INS, cTL(createdByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdBy The collection of createdBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setCreatedBy_InScope( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), + "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdByList The collection of createdBy as notInScope. + */ + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + protected void regCreatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + protected void registerInlineCreatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + abstract protected ConditionValue getCValueCreatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param updatedTime The value of updatedTime as equal. + */ + public void setUpdatedTime_Equal(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_EQ, updatedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as notEqual. + */ + public void setUpdatedTime_NotEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_NE, updatedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterThan. + */ + public void setUpdatedTime_GreaterThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GT, updatedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessThan. + */ + public void setUpdatedTime_LessThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LT, updatedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterEqual. + */ + public void setUpdatedTime_GreaterEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GE, updatedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessEqual. + */ + public void setUpdatedTime_LessEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LE, updatedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setUpdatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueUpdatedTime(), + "UPDATED_TIME", "UpdatedTime", "updatedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + */ + public void setUpdatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setUpdatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regUpdatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + protected void registerInlineUpdatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + abstract protected ConditionValue getCValueUpdatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param updatedBy The value of updatedBy as equal. + */ + public void setUpdatedBy_Equal(String updatedBy) { + regUpdatedBy(CK_EQ, fRES(updatedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as notEqual. + */ + public void setUpdatedBy_NotEqual(String updatedBy) { + regUpdatedBy(CK_NE, fRES(updatedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterThan. + */ + public void setUpdatedBy_GreaterThan(String updatedBy) { + regUpdatedBy(CK_GT, fRES(updatedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessThan. + */ + public void setUpdatedBy_LessThan(String updatedBy) { + regUpdatedBy(CK_LT, fRES(updatedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterEqual. + */ + public void setUpdatedBy_GreaterEqual(String updatedBy) { + regUpdatedBy(CK_GE, fRES(updatedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessEqual. + */ + public void setUpdatedBy_LessEqual(String updatedBy) { + regUpdatedBy(CK_LE, fRES(updatedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as prefixSearch. + */ + public void setUpdatedBy_PrefixSearch(String updatedBy) { + regUpdatedBy(CK_PS, fRES(updatedBy)); + } + + /** + * 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.scheduler.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. + * + * @param updatedByList The collection of updatedBy as inScope. + */ + public void setUpdatedBy_InScope(Collection<String> updatedByList) { + regUpdatedBy(CK_INS, cTL(updatedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedBy The collection of updatedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUpdatedBy_InScope( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), + "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedByList The collection of updatedBy as notInScope. + */ + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + protected void regUpdatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + protected void registerInlineUpdatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + abstract protected ConditionValue getCValueUpdatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * + * @param deletedTime The value of deletedTime as equal. + */ + public void setDeletedTime_Equal(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_EQ, deletedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as notEqual. + */ + public void setDeletedTime_NotEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_NE, deletedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterThan. + */ + public void setDeletedTime_GreaterThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GT, deletedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessThan. + */ + public void setDeletedTime_LessThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LT, deletedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterEqual. + */ + public void setDeletedTime_GreaterEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GE, deletedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessEqual. + */ + public void setDeletedTime_LessEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LE, deletedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setDeletedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueDeletedTime(), + "DELETED_TIME", "DeletedTime", "deletedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + */ + public void setDeletedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setDeletedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedTime_IsNull() { + regDeletedTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedTime_IsNotNull() { + regDeletedTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + protected void registerInlineDeletedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + abstract protected ConditionValue getCValueDeletedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param deletedBy The value of deletedBy as equal. + */ + public void setDeletedBy_Equal(String deletedBy) { + regDeletedBy(CK_EQ, fRES(deletedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as notEqual. + */ + public void setDeletedBy_NotEqual(String deletedBy) { + regDeletedBy(CK_NE, fRES(deletedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterThan. + */ + public void setDeletedBy_GreaterThan(String deletedBy) { + regDeletedBy(CK_GT, fRES(deletedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessThan. + */ + public void setDeletedBy_LessThan(String deletedBy) { + regDeletedBy(CK_LT, fRES(deletedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterEqual. + */ + public void setDeletedBy_GreaterEqual(String deletedBy) { + regDeletedBy(CK_GE, fRES(deletedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessEqual. + */ + public void setDeletedBy_LessEqual(String deletedBy) { + regDeletedBy(CK_LE, fRES(deletedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as prefixSearch. + */ + public void setDeletedBy_PrefixSearch(String deletedBy) { + regDeletedBy(CK_PS, fRES(deletedBy)); + } + + /** + * 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.scheduler.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. + * + * @param deletedByList The collection of deletedBy as inScope. + */ + public void setDeletedBy_InScope(Collection<String> deletedByList) { + regDeletedBy(CK_INS, cTL(deletedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedBy The collection of deletedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDeletedBy_InScope( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), + "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedByList The collection of deletedBy as notInScope. + */ + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedBy_IsNull() { + regDeletedBy(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedBy_IsNotNull() { + regDeletedBy(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + protected void registerInlineDeletedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + abstract protected ConditionValue getCValueDeletedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * + * @param versionno The value of versionno as equal. + */ + public void setVersionno_Equal(Integer versionno) { + regVersionno(CK_EQ, versionno); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as notEqual. + */ + public void setVersionno_NotEqual(Integer versionno) { + regVersionno(CK_NE, versionno); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterThan. + */ + public void setVersionno_GreaterThan(Integer versionno) { + regVersionno(CK_GT, versionno); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessThan. + */ + public void setVersionno_LessThan(Integer versionno) { + regVersionno(CK_LT, versionno); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterEqual. + */ + public void setVersionno_GreaterEqual(Integer versionno) { + regVersionno(CK_GE, versionno); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessEqual. + */ + public void setVersionno_LessEqual(Integer versionno) { + regVersionno(CK_LE, versionno); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as inScope. + */ + public void setVersionno_InScope(Collection<Integer> versionnoList) { + regVersionno(CK_INS, cTL(versionnoList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as notInScope. + */ + public void setVersionno_NotInScope(Collection<Integer> versionnoList) { + regVersionno(CK_NINS, cTL(versionnoList)); + } + + protected void regVersionno(ConditionKey key, Object value) { + registerQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + protected void registerInlineVersionno(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + abstract protected ConditionValue getCValueVersionno(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupInfoCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return GroupInfoCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,465 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of GROUP_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsGroupMappingCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsGroupMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "GROUP_MAPPING"; + } + + public String getTableSqlName() { + return "GROUP_MAPPING"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Integer id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Integer id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Integer id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Integer id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Integer id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Integer id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Integer> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Integer> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) + * : FK to USER_INFO} + * + * @param userId The value of userId as equal. + */ + public void setUserId_Equal(String userId) { + regUserId(CK_EQ, fRES(userId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as notEqual. + */ + public void setUserId_NotEqual(String userId) { + regUserId(CK_NE, fRES(userId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterThan. + */ + public void setUserId_GreaterThan(String userId) { + regUserId(CK_GT, fRES(userId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessThan. + */ + public void setUserId_LessThan(String userId) { + regUserId(CK_LT, fRES(userId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterEqual. + */ + public void setUserId_GreaterEqual(String userId) { + regUserId(CK_GE, fRES(userId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessEqual. + */ + public void setUserId_LessEqual(String userId) { + regUserId(CK_LE, fRES(userId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as prefixSearch. + */ + public void setUserId_PrefixSearch(String userId) { + regUserId(CK_PS, fRES(userId)); + } + + /** + * 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.scheduler.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. + * + * @param userIdList The collection of userId as inScope. + */ + public void setUserId_InScope(Collection<String> userIdList) { + regUserId(CK_INS, cTL(userIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userId The collection of userId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUserId_InScope( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), + "USER_ID", "UserId", "userId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userIdList The collection of userId as notInScope. + */ + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); + } + + /** + * @param userInfoCBquery Query. + * @deprecated Please use inScopeUserInfo(subQuery) method. + */ + 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 inScopeUserInfo(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_UserInfo( + jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); + + protected void regUserId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + protected void registerInlineUserId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + abstract protected ConditionValue getCValueUserId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) + * : FK to GROUP_INFO} + * + * @param groupId The value of groupId as equal. + */ + public void setGroupId_Equal(String groupId) { + regGroupId(CK_EQ, fRES(groupId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as notEqual. + */ + public void setGroupId_NotEqual(String groupId) { + regGroupId(CK_NE, fRES(groupId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as greaterThan. + */ + public void setGroupId_GreaterThan(String groupId) { + regGroupId(CK_GT, fRES(groupId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as lessThan. + */ + public void setGroupId_LessThan(String groupId) { + regGroupId(CK_LT, fRES(groupId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as greaterEqual. + */ + public void setGroupId_GreaterEqual(String groupId) { + regGroupId(CK_GE, fRES(groupId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as lessEqual. + */ + public void setGroupId_LessEqual(String groupId) { + regGroupId(CK_LE, fRES(groupId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as prefixSearch. + */ + public void setGroupId_PrefixSearch(String groupId) { + regGroupId(CK_PS, fRES(groupId)); + } + + /** + * 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.scheduler.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. + * + * @param groupIdList The collection of groupId as inScope. + */ + public void setGroupId_InScope(Collection<String> groupIdList) { + regGroupId(CK_INS, cTL(groupIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param groupId The collection of groupId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setGroupId_InScope( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), + "GROUP_ID", "GroupId", "groupId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param groupIdList The collection of groupId as notInScope. + */ + public void setGroupId_NotInScope(Collection<String> groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); + } + + /** + * @param groupInfoCBquery Query. + * @deprecated Please use inScopeGroupInfo(subQuery) method. + */ + 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 inScopeGroupInfo(SubQuery<GroupInfoCB> subQuery) { + assertObjectNotNull("subQuery<GroupInfoCB>", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ subQuery); + + protected void regGroupId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId"); + } + + protected void registerInlineGroupId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId"); + } + + abstract protected ConditionValue getCValueGroupId(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return GroupMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return GroupMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsGroupMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1894 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of ROLE_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsRoleInfoCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsRoleInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROLE_INFO"; + } + + public String getTableSqlName() { + return "ROLE_INFO"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * VARCHAR(255)} + * + * @param roleId The value of roleId as equal. + */ + public void setRoleId_Equal(String roleId) { + regRoleId(CK_EQ, fRES(roleId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as notEqual. + */ + public void setRoleId_NotEqual(String roleId) { + regRoleId(CK_NE, fRES(roleId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as greaterThan. + */ + public void setRoleId_GreaterThan(String roleId) { + regRoleId(CK_GT, fRES(roleId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as lessThan. + */ + public void setRoleId_LessThan(String roleId) { + regRoleId(CK_LT, fRES(roleId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as greaterEqual. + */ + public void setRoleId_GreaterEqual(String roleId) { + regRoleId(CK_GE, fRES(roleId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as lessEqual. + */ + public void setRoleId_LessEqual(String roleId) { + regRoleId(CK_LE, fRES(roleId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as prefixSearch. + */ + public void setRoleId_PrefixSearch(String roleId) { + regRoleId(CK_PS, fRES(roleId)); + } + + /** + * 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.scheduler.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. + * + * @param roleIdList The collection of roleId as inScope. + */ + public void setRoleId_InScope(Collection<String> roleIdList) { + regRoleId(CK_INS, cTL(roleIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param roleId The collection of roleId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setRoleId_InScope( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), + "ROLE_ID", "RoleId", "roleId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param roleIdList The collection of roleId as notInScope. + */ + public void setRoleId_NotInScope(Collection<String> roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); + } + + /** + * @param roleMappingCBquery Query. + * @deprecated Please use inScopeRoleMappingList(subQuery) method. + */ + 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 inScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public 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. + registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public String keepRoleId_InScopeSubQuery_UserInfoList( + UserInfoCQ subQuery); + + public void notInScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + public void notInScopeUserInfoList(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_NotInScopeSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public 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 ...)} + * + * @param subQuery The sub-query of RoleId_ExistsSubQuery_RoleMappingList + * for 'exists'. (NotNull) + */ + public void existsRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_ExistsSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public 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 + * ...)} + * + * @param subQuery The sub-query of RoleId_ExistsSubQuery_UserInfoList for + * 'exists'. (NotNull) + */ + public void existsUserInfoList(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_ExistsSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public String keepRoleId_ExistsSubQuery_UserInfoList( + UserInfoCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select ROLE_ID from + * ROLE_MAPPING where ...)} + * + * @param subQuery The sub-query of RoleId_NotExistsSubQuery_RoleMappingList + * for 'not exists'. (NotNull) + */ + public void notExistsRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_NotExistsSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public String keepRoleId_NotExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select ROLE_ID from USER_INFO + * where ...)} + * + * @param subQuery The sub-query of RoleId_NotExistsSubQuery_UserInfoList + * for 'not exists'. (NotNull) + */ + public void notExistsUserInfoList(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_NotExistsSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public 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(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_DeriveSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepRoleId_DeriveSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + public void xderiveUserInfoList(String function, + SubQuery<UserInfoCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_DeriveSubQuery_UserInfoList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepRoleId_DeriveSubQuery_UserInfoList( + UserInfoCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setRoleId_IsNull() { + regRoleId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setRoleId_IsNotNull() { + regRoleId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regRoleId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId"); + } + + protected void registerInlineRoleId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId"); + } + + abstract protected ConditionValue getCValueRoleId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param name The value of name as equal. + */ + public void setName_Equal(String name) { + regName(CK_EQ, fRES(name)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as notEqual. + */ + public void setName_NotEqual(String name) { + regName(CK_NE, fRES(name)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as greaterThan. + */ + public void setName_GreaterThan(String name) { + regName(CK_GT, fRES(name)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as lessThan. + */ + public void setName_LessThan(String name) { + regName(CK_LT, fRES(name)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as greaterEqual. + */ + public void setName_GreaterEqual(String name) { + regName(CK_GE, fRES(name)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as lessEqual. + */ + public void setName_LessEqual(String name) { + regName(CK_LE, fRES(name)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param name The value of name as prefixSearch. + */ + public void setName_PrefixSearch(String name) { + regName(CK_PS, fRES(name)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(name), getCValueName(), "NAME", + "Name", "name", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nameList The collection of name as inScope. + */ + public void setName_InScope(Collection<String> nameList) { + regName(CK_INS, cTL(nameList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param name The collection of name as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setName_InScope( + String name, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(name), getCValueName(), "NAME", + "Name", "name", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nameList The collection of name as notInScope. + */ + public void setName_NotInScope(Collection<String> nameList) { + regName(CK_NINS, cTL(nameList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setName_IsNull() { + regName(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setName_IsNotNull() { + regName(CK_ISNN, DUMMY_OBJECT); + } + + protected void regName(ConditionKey key, Object value) { + registerQuery(key, value, getCValueName(), "NAME", "Name", "name"); + } + + protected void registerInlineName(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueName(), "NAME", "Name", "name"); + } + + abstract protected ConditionValue getCValueName(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param description The value of description as equal. + */ + public void setDescription_Equal(String description) { + regDescription(CK_EQ, fRES(description)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as notEqual. + */ + public void setDescription_NotEqual(String description) { + regDescription(CK_NE, fRES(description)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as greaterThan. + */ + public void setDescription_GreaterThan(String description) { + regDescription(CK_GT, fRES(description)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as lessThan. + */ + public void setDescription_LessThan(String description) { + regDescription(CK_LT, fRES(description)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as greaterEqual. + */ + public void setDescription_GreaterEqual(String description) { + regDescription(CK_GE, fRES(description)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as lessEqual. + */ + public void setDescription_LessEqual(String description) { + regDescription(CK_LE, fRES(description)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param description The value of description as prefixSearch. + */ + public void setDescription_PrefixSearch(String description) { + regDescription(CK_PS, fRES(description)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(description), + getCValueDescription(), "DESCRIPTION", "Description", + "description", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param descriptionList The collection of description as inScope. + */ + public void setDescription_InScope(Collection<String> descriptionList) { + regDescription(CK_INS, cTL(descriptionList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param description The collection of description as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDescription_InScope( + String description, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(description), getCValueDescription(), + "DESCRIPTION", "Description", "description", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param descriptionList The collection of description as notInScope. + */ + public void setDescription_NotInScope(Collection<String> descriptionList) { + regDescription(CK_NINS, cTL(descriptionList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDescription_IsNull() { + regDescription(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDescription_IsNotNull() { + regDescription(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDescription(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDescription(), "DESCRIPTION", + "Description", "description"); + } + + protected void registerInlineDescription(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDescription(), "DESCRIPTION", + "Description", "description"); + } + + abstract protected ConditionValue getCValueDescription(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param email The value of email as equal. + */ + public void setEmail_Equal(String email) { + regEmail(CK_EQ, fRES(email)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as notEqual. + */ + public void setEmail_NotEqual(String email) { + regEmail(CK_NE, fRES(email)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as greaterThan. + */ + public void setEmail_GreaterThan(String email) { + regEmail(CK_GT, fRES(email)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as lessThan. + */ + public void setEmail_LessThan(String email) { + regEmail(CK_LT, fRES(email)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as greaterEqual. + */ + public void setEmail_GreaterEqual(String email) { + regEmail(CK_GE, fRES(email)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as lessEqual. + */ + public void setEmail_LessEqual(String email) { + regEmail(CK_LE, fRES(email)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as prefixSearch. + */ + public void setEmail_PrefixSearch(String email) { + regEmail(CK_PS, fRES(email)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", + "Email", "email", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param emailList The collection of email as inScope. + */ + public void setEmail_InScope(Collection<String> emailList) { + regEmail(CK_INS, cTL(emailList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param email The collection of email as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setEmail_InScope( + String email, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", + "Email", "email", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param emailList The collection of email as notInScope. + */ + public void setEmail_NotInScope(Collection<String> emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setEmail_IsNull() { + regEmail(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setEmail_IsNotNull() { + regEmail(CK_ISNN, DUMMY_OBJECT); + } + + protected void regEmail(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEmail(), "EMAIL", "Email", "email"); + } + + protected void registerInlineEmail(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEmail(), "EMAIL", "Email", + "email"); + } + + abstract protected ConditionValue getCValueEmail(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param url The value of url as equal. + */ + public void setUrl_Equal(String url) { + regUrl(CK_EQ, fRES(url)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as notEqual. + */ + public void setUrl_NotEqual(String url) { + regUrl(CK_NE, fRES(url)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as greaterThan. + */ + public void setUrl_GreaterThan(String url) { + regUrl(CK_GT, fRES(url)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as lessThan. + */ + public void setUrl_LessThan(String url) { + regUrl(CK_LT, fRES(url)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as greaterEqual. + */ + public void setUrl_GreaterEqual(String url) { + regUrl(CK_GE, fRES(url)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as lessEqual. + */ + public void setUrl_LessEqual(String url) { + regUrl(CK_LE, fRES(url)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as prefixSearch. + */ + public void setUrl_PrefixSearch(String url) { + regUrl(CK_PS, fRES(url)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", + "url", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param urlList The collection of url as inScope. + */ + public void setUrl_InScope(Collection<String> urlList) { + regUrl(CK_INS, cTL(urlList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param url The collection of url as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUrl_InScope( + String url, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", + "url", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param urlList The collection of url as notInScope. + */ + public void setUrl_NotInScope(Collection<String> urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setUrl_IsNull() { + regUrl(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setUrl_IsNotNull() { + regUrl(CK_ISNN, DUMMY_OBJECT); + } + + protected void regUrl(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUrl(), "URL", "Url", "url"); + } + + protected void registerInlineUrl(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUrl(), "URL", "Url", "url"); + } + + abstract protected ConditionValue getCValueUrl(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * + * @param telephone The value of telephone as equal. + */ + public void setTelephone_Equal(String telephone) { + regTelephone(CK_EQ, fRES(telephone)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as notEqual. + */ + public void setTelephone_NotEqual(String telephone) { + regTelephone(CK_NE, fRES(telephone)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as greaterThan. + */ + public void setTelephone_GreaterThan(String telephone) { + regTelephone(CK_GT, fRES(telephone)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as lessThan. + */ + public void setTelephone_LessThan(String telephone) { + regTelephone(CK_LT, fRES(telephone)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as greaterEqual. + */ + public void setTelephone_GreaterEqual(String telephone) { + regTelephone(CK_GE, fRES(telephone)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as lessEqual. + */ + public void setTelephone_LessEqual(String telephone) { + regTelephone(CK_LE, fRES(telephone)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as prefixSearch. + */ + public void setTelephone_PrefixSearch(String telephone) { + regTelephone(CK_PS, fRES(telephone)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), + "TELEPHONE", "Telephone", "telephone", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephoneList The collection of telephone as inScope. + */ + public void setTelephone_InScope(Collection<String> telephoneList) { + regTelephone(CK_INS, cTL(telephoneList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephone The collection of telephone as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setTelephone_InScope( + String telephone, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), + "TELEPHONE", "Telephone", "telephone", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephoneList The collection of telephone as notInScope. + */ + public void setTelephone_NotInScope(Collection<String> telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setTelephone_IsNull() { + regTelephone(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setTelephone_IsNotNull() { + regTelephone(CK_ISNN, DUMMY_OBJECT); + } + + protected void regTelephone(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone"); + } + + protected void registerInlineTelephone(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone"); + } + + abstract protected ConditionValue getCValueTelephone(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param createdTime The value of createdTime as equal. + */ + public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { + regCreatedTime(CK_EQ, createdTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as notEqual. + */ + public void setCreatedTime_NotEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_NE, createdTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterThan. + */ + public void setCreatedTime_GreaterThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GT, createdTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessThan. + */ + public void setCreatedTime_LessThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LT, createdTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterEqual. + */ + public void setCreatedTime_GreaterEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GE, createdTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessEqual. + */ + public void setCreatedTime_LessEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LE, createdTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setCreatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueCreatedTime(), + "CREATED_TIME", "CreatedTime", "createdTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + */ + public void setCreatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setCreatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regCreatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + protected void registerInlineCreatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + abstract protected ConditionValue getCValueCreatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param createdBy The value of createdBy as equal. + */ + public void setCreatedBy_Equal(String createdBy) { + regCreatedBy(CK_EQ, fRES(createdBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as notEqual. + */ + public void setCreatedBy_NotEqual(String createdBy) { + regCreatedBy(CK_NE, fRES(createdBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterThan. + */ + public void setCreatedBy_GreaterThan(String createdBy) { + regCreatedBy(CK_GT, fRES(createdBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessThan. + */ + public void setCreatedBy_LessThan(String createdBy) { + regCreatedBy(CK_LT, fRES(createdBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterEqual. + */ + public void setCreatedBy_GreaterEqual(String createdBy) { + regCreatedBy(CK_GE, fRES(createdBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessEqual. + */ + public void setCreatedBy_LessEqual(String createdBy) { + regCreatedBy(CK_LE, fRES(createdBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as prefixSearch. + */ + public void setCreatedBy_PrefixSearch(String createdBy) { + regCreatedBy(CK_PS, fRES(createdBy)); + } + + /** + * 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.scheduler.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. + * + * @param createdByList The collection of createdBy as inScope. + */ + public void setCreatedBy_InScope(Collection<String> createdByList) { + regCreatedBy(CK_INS, cTL(createdByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdBy The collection of createdBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setCreatedBy_InScope( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), + "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdByList The collection of createdBy as notInScope. + */ + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + protected void regCreatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + protected void registerInlineCreatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + abstract protected ConditionValue getCValueCreatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param updatedTime The value of updatedTime as equal. + */ + public void setUpdatedTime_Equal(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_EQ, updatedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as notEqual. + */ + public void setUpdatedTime_NotEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_NE, updatedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterThan. + */ + public void setUpdatedTime_GreaterThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GT, updatedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessThan. + */ + public void setUpdatedTime_LessThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LT, updatedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterEqual. + */ + public void setUpdatedTime_GreaterEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GE, updatedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessEqual. + */ + public void setUpdatedTime_LessEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LE, updatedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setUpdatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueUpdatedTime(), + "UPDATED_TIME", "UpdatedTime", "updatedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + */ + public void setUpdatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setUpdatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regUpdatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + protected void registerInlineUpdatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + abstract protected ConditionValue getCValueUpdatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param updatedBy The value of updatedBy as equal. + */ + public void setUpdatedBy_Equal(String updatedBy) { + regUpdatedBy(CK_EQ, fRES(updatedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as notEqual. + */ + public void setUpdatedBy_NotEqual(String updatedBy) { + regUpdatedBy(CK_NE, fRES(updatedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterThan. + */ + public void setUpdatedBy_GreaterThan(String updatedBy) { + regUpdatedBy(CK_GT, fRES(updatedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessThan. + */ + public void setUpdatedBy_LessThan(String updatedBy) { + regUpdatedBy(CK_LT, fRES(updatedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterEqual. + */ + public void setUpdatedBy_GreaterEqual(String updatedBy) { + regUpdatedBy(CK_GE, fRES(updatedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessEqual. + */ + public void setUpdatedBy_LessEqual(String updatedBy) { + regUpdatedBy(CK_LE, fRES(updatedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as prefixSearch. + */ + public void setUpdatedBy_PrefixSearch(String updatedBy) { + regUpdatedBy(CK_PS, fRES(updatedBy)); + } + + /** + * 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.scheduler.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. + * + * @param updatedByList The collection of updatedBy as inScope. + */ + public void setUpdatedBy_InScope(Collection<String> updatedByList) { + regUpdatedBy(CK_INS, cTL(updatedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedBy The collection of updatedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUpdatedBy_InScope( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), + "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedByList The collection of updatedBy as notInScope. + */ + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + protected void regUpdatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + protected void registerInlineUpdatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + abstract protected ConditionValue getCValueUpdatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * + * @param deletedTime The value of deletedTime as equal. + */ + public void setDeletedTime_Equal(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_EQ, deletedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as notEqual. + */ + public void setDeletedTime_NotEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_NE, deletedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterThan. + */ + public void setDeletedTime_GreaterThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GT, deletedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessThan. + */ + public void setDeletedTime_LessThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LT, deletedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterEqual. + */ + public void setDeletedTime_GreaterEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GE, deletedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessEqual. + */ + public void setDeletedTime_LessEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LE, deletedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setDeletedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueDeletedTime(), + "DELETED_TIME", "DeletedTime", "deletedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + */ + public void setDeletedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setDeletedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedTime_IsNull() { + regDeletedTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedTime_IsNotNull() { + regDeletedTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + protected void registerInlineDeletedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + abstract protected ConditionValue getCValueDeletedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param deletedBy The value of deletedBy as equal. + */ + public void setDeletedBy_Equal(String deletedBy) { + regDeletedBy(CK_EQ, fRES(deletedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as notEqual. + */ + public void setDeletedBy_NotEqual(String deletedBy) { + regDeletedBy(CK_NE, fRES(deletedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterThan. + */ + public void setDeletedBy_GreaterThan(String deletedBy) { + regDeletedBy(CK_GT, fRES(deletedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessThan. + */ + public void setDeletedBy_LessThan(String deletedBy) { + regDeletedBy(CK_LT, fRES(deletedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterEqual. + */ + public void setDeletedBy_GreaterEqual(String deletedBy) { + regDeletedBy(CK_GE, fRES(deletedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessEqual. + */ + public void setDeletedBy_LessEqual(String deletedBy) { + regDeletedBy(CK_LE, fRES(deletedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as prefixSearch. + */ + public void setDeletedBy_PrefixSearch(String deletedBy) { + regDeletedBy(CK_PS, fRES(deletedBy)); + } + + /** + * 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.scheduler.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. + * + * @param deletedByList The collection of deletedBy as inScope. + */ + public void setDeletedBy_InScope(Collection<String> deletedByList) { + regDeletedBy(CK_INS, cTL(deletedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedBy The collection of deletedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDeletedBy_InScope( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), + "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedByList The collection of deletedBy as notInScope. + */ + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedBy_IsNull() { + regDeletedBy(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedBy_IsNotNull() { + regDeletedBy(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + protected void registerInlineDeletedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + abstract protected ConditionValue getCValueDeletedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * + * @param versionno The value of versionno as equal. + */ + public void setVersionno_Equal(Integer versionno) { + regVersionno(CK_EQ, versionno); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as notEqual. + */ + public void setVersionno_NotEqual(Integer versionno) { + regVersionno(CK_NE, versionno); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterThan. + */ + public void setVersionno_GreaterThan(Integer versionno) { + regVersionno(CK_GT, versionno); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessThan. + */ + public void setVersionno_LessThan(Integer versionno) { + regVersionno(CK_LT, versionno); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterEqual. + */ + public void setVersionno_GreaterEqual(Integer versionno) { + regVersionno(CK_GE, versionno); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessEqual. + */ + public void setVersionno_LessEqual(Integer versionno) { + regVersionno(CK_LE, versionno); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as inScope. + */ + public void setVersionno_InScope(Collection<Integer> versionnoList) { + regVersionno(CK_INS, cTL(versionnoList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as notInScope. + */ + public void setVersionno_NotInScope(Collection<Integer> versionnoList) { + regVersionno(CK_NINS, cTL(versionnoList)); + } + + protected void regVersionno(ConditionKey key, Object value) { + registerQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + protected void registerInlineVersionno(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + abstract protected ConditionValue getCValueVersionno(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleInfoCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoleInfoCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,464 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of ROLE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsRoleMappingCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsRoleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROLE_MAPPING"; + } + + public String getTableSqlName() { + return "ROLE_MAPPING"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : INTEGER} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Integer id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Integer id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Integer id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Integer id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Integer id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Integer id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Integer> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Integer> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) + * : FK to USER_INFO} + * + * @param userId The value of userId as equal. + */ + public void setUserId_Equal(String userId) { + regUserId(CK_EQ, fRES(userId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as notEqual. + */ + public void setUserId_NotEqual(String userId) { + regUserId(CK_NE, fRES(userId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterThan. + */ + public void setUserId_GreaterThan(String userId) { + regUserId(CK_GT, fRES(userId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessThan. + */ + public void setUserId_LessThan(String userId) { + regUserId(CK_LT, fRES(userId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterEqual. + */ + public void setUserId_GreaterEqual(String userId) { + regUserId(CK_GE, fRES(userId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessEqual. + */ + public void setUserId_LessEqual(String userId) { + regUserId(CK_LE, fRES(userId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as prefixSearch. + */ + public void setUserId_PrefixSearch(String userId) { + regUserId(CK_PS, fRES(userId)); + } + + /** + * 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.scheduler.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. + * + * @param userIdList The collection of userId as inScope. + */ + public void setUserId_InScope(Collection<String> userIdList) { + regUserId(CK_INS, cTL(userIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userId The collection of userId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUserId_InScope( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), + "USER_ID", "UserId", "userId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userIdList The collection of userId as notInScope. + */ + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); + } + + /** + * @param userInfoCBquery Query. + * @deprecated Please use inScopeUserInfo(subQuery) method. + */ + 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 inScopeUserInfo(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_UserInfo( + jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); + + protected void regUserId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + protected void registerInlineUserId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + abstract protected ConditionValue getCValueUserId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) + * : FK to ROLE_INFO} + * + * @param roleId The value of roleId as equal. + */ + public void setRoleId_Equal(String roleId) { + regRoleId(CK_EQ, fRES(roleId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as notEqual. + */ + public void setRoleId_NotEqual(String roleId) { + regRoleId(CK_NE, fRES(roleId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as greaterThan. + */ + public void setRoleId_GreaterThan(String roleId) { + regRoleId(CK_GT, fRES(roleId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as lessThan. + */ + public void setRoleId_LessThan(String roleId) { + regRoleId(CK_LT, fRES(roleId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as greaterEqual. + */ + public void setRoleId_GreaterEqual(String roleId) { + regRoleId(CK_GE, fRES(roleId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as lessEqual. + */ + public void setRoleId_LessEqual(String roleId) { + regRoleId(CK_LE, fRES(roleId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as prefixSearch. + */ + public void setRoleId_PrefixSearch(String roleId) { + regRoleId(CK_PS, fRES(roleId)); + } + + /** + * 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.scheduler.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. + * + * @param roleIdList The collection of roleId as inScope. + */ + public void setRoleId_InScope(Collection<String> roleIdList) { + regRoleId(CK_INS, cTL(roleIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param roleId The collection of roleId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setRoleId_InScope( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), + "ROLE_ID", "RoleId", "roleId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param roleIdList The collection of roleId as notInScope. + */ + public void setRoleId_NotInScope(Collection<String> roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); + } + + /** + * @param roleInfoCBquery Query. + * @deprecated Please use inScopeRoleInfo(subQuery) method. + */ + 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 inScopeRoleInfo(SubQuery<RoleInfoCB> subQuery) { + assertObjectNotNull("subQuery<RoleInfoCB>", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ subQuery); + + protected void regRoleId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId"); + } + + protected void registerInlineRoleId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId"); + } + + abstract protected ConditionValue getCValueRoleId(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoleMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoleMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1920 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; + +/** + * The abstract condition-query of ROUTINE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsRoutineScheduleCQ extends + AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsRoutineScheduleCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Long id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Long id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Long id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Long id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Long id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Long id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Long> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Long> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * @param routineScheduleContentCBquery Query. + * @deprecated Please use inScopeRoutineScheduleContentAsOne(subQuery) + * method. + */ + public void setId_InScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ routineScheduleContentCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_RoutineScheduleContentAsOne(routineScheduleContentCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(routineScheduleContentCBquery, "ID", "ID", + subQueryPropertyName); + } + + public void inScopeRoutineScheduleContentAsOne( + SubQuery<RoutineScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleContentCB>", subQuery); + RoutineScheduleContentCB cb = new RoutineScheduleContentCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_RoutineScheduleContentAsOne(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery); + + /** + * @param routineScheduleMappingCBquery Query. + * @deprecated Please use inScopeRoutineScheduleMappingList(subQuery) + * method. + */ + public void setId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ routineScheduleMappingCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_RoutineScheduleMappingList(routineScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(routineScheduleMappingCBquery, "ID", + "SCHEDULE_ID", subQueryPropertyName); + } + + public void inScopeRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + public void notInScopeRoutineScheduleContentAsOne( + SubQuery<RoutineScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleContentCB>", subQuery); + RoutineScheduleContentCB cb = new RoutineScheduleContentCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotInScopeSubQuery_RoutineScheduleContentAsOne(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_NotInScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery); + + public void notInScopeRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotInScopeSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotInScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + /** + * @param routineScheduleContentCBquery Query. + * @deprecated Please use existsRoutineScheduleContentAsOne(subQuery) + * method. + */ + public void setId_ExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ routineScheduleContentCBquery) { + String subQueryPropertyName = keepId_ExistsSubQuery_RoutineScheduleContentAsOne(routineScheduleContentCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(routineScheduleContentCBquery, "ID", "ID", + subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select ID from + * ROUTINE_SCHEDULE_CONTENT where ...)} + * + * @param subQuery The sub-query of + * Id_ExistsSubQuery_RoutineScheduleContentAsOne for 'exists'. + * (NotNull) + */ + public void existsRoutineScheduleContentAsOne( + SubQuery<RoutineScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleContentCB>", subQuery); + RoutineScheduleContentCB cb = new RoutineScheduleContentCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_ExistsSubQuery_RoutineScheduleContentAsOne(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery); + + /** + * @param routineScheduleMappingCBquery Query. + * @deprecated Please use existsRoutineScheduleMappingList(subQuery) method. + */ + public void setId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ routineScheduleMappingCBquery) { + String subQueryPropertyName = keepId_ExistsSubQuery_RoutineScheduleMappingList(routineScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(routineScheduleMappingCBquery, "ID", + "SCHEDULE_ID", subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select SCHEDULE_ID from + * ROUTINE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * Id_ExistsSubQuery_RoutineScheduleMappingList for 'exists'. + * (NotNull) + */ + public void existsRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_ExistsSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select ID from + * ROUTINE_SCHEDULE_CONTENT where ...)} + * + * @param subQuery The sub-query of + * Id_NotExistsSubQuery_RoutineScheduleContentAsOne for 'not + * exists'. (NotNull) + */ + public void notExistsRoutineScheduleContentAsOne( + SubQuery<RoutineScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleContentCB>", subQuery); + RoutineScheduleContentCB cb = new RoutineScheduleContentCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotExistsSubQuery_RoutineScheduleContentAsOne(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_NotExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select SCHEDULE_ID from + * ROUTINE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * Id_NotExistsSubQuery_RoutineScheduleMappingList for 'not + * exists'. (NotNull) + */ + public void notExistsRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotExistsSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + public void xderiveRoutineScheduleMappingList(String function, + SubQuery<RoutineScheduleMappingCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepId_DeriveSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepId_DeriveSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(100)} + * + * @param title The value of title as equal. + */ + public void setTitle_Equal(String title) { + regTitle(CK_EQ, fRES(title)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as notEqual. + */ + public void setTitle_NotEqual(String title) { + regTitle(CK_NE, fRES(title)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as greaterThan. + */ + public void setTitle_GreaterThan(String title) { + regTitle(CK_GT, fRES(title)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as lessThan. + */ + public void setTitle_LessThan(String title) { + regTitle(CK_LT, fRES(title)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as greaterEqual. + */ + public void setTitle_GreaterEqual(String title) { + regTitle(CK_GE, fRES(title)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as lessEqual. + */ + public void setTitle_LessEqual(String title) { + regTitle(CK_LE, fRES(title)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as prefixSearch. + */ + public void setTitle_PrefixSearch(String title) { + regTitle(CK_PS, fRES(title)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(title), getCValueTitle(), "TITLE", + "Title", "title", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param titleList The collection of title as inScope. + */ + public void setTitle_InScope(Collection<String> titleList) { + regTitle(CK_INS, cTL(titleList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param title The collection of title as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setTitle_InScope( + String title, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", + "Title", "title", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param titleList The collection of title as notInScope. + */ + public void setTitle_NotInScope(Collection<String> titleList) { + regTitle(CK_NINS, cTL(titleList)); + } + + protected void regTitle(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTitle(), "TITLE", "Title", "title"); + } + + protected void registerInlineTitle(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTitle(), "TITLE", "Title", + "title"); + } + + abstract protected ConditionValue getCValueTitle(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param location The value of location as equal. + */ + public void setLocation_Equal(String location) { + regLocation(CK_EQ, fRES(location)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as notEqual. + */ + public void setLocation_NotEqual(String location) { + regLocation(CK_NE, fRES(location)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as greaterThan. + */ + public void setLocation_GreaterThan(String location) { + regLocation(CK_GT, fRES(location)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as lessThan. + */ + public void setLocation_LessThan(String location) { + regLocation(CK_LT, fRES(location)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as greaterEqual. + */ + public void setLocation_GreaterEqual(String location) { + regLocation(CK_GE, fRES(location)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as lessEqual. + */ + public void setLocation_LessEqual(String location) { + regLocation(CK_LE, fRES(location)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as prefixSearch. + */ + public void setLocation_PrefixSearch(String location) { + regLocation(CK_PS, fRES(location)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param location The value of location as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocation_LikeSearch( + String location, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(location), getCValueLocation(), + "LOCATION", "Location", "location", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param locationList The collection of location as inScope. + */ + public void setLocation_InScope(Collection<String> locationList) { + regLocation(CK_INS, cTL(locationList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param location The collection of location as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setLocation_InScope( + String location, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(location), getCValueLocation(), + "LOCATION", "Location", "location", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param locationList The collection of location as notInScope. + */ + public void setLocation_NotInScope(Collection<String> locationList) { + regLocation(CK_NINS, cTL(locationList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setLocation_IsNull() { + regLocation(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setLocation_IsNotNull() { + regLocation(CK_ISNN, DUMMY_OBJECT); + } + + protected void regLocation(ConditionKey key, Object value) { + registerQuery(key, value, getCValueLocation(), "LOCATION", "Location", + "location"); + } + + protected void registerInlineLocation(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueLocation(), "LOCATION", + "Location", "location"); + } + + abstract protected ConditionValue getCValueLocation(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DATE} + * + * @param startDate The value of startDate as equal. + */ + public void setStartDate_Equal(java.util.Date startDate) { + regStartDate(CK_EQ, startDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as notEqual. + */ + public void setStartDate_NotEqual(java.util.Date startDate) { + regStartDate(CK_NE, startDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as greaterThan. + */ + public void setStartDate_GreaterThan(java.util.Date startDate) { + regStartDate(CK_GT, startDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as lessThan. + */ + public void setStartDate_LessThan(java.util.Date startDate) { + regStartDate(CK_LT, startDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as greaterEqual. + */ + public void setStartDate_GreaterEqual(java.util.Date startDate) { + regStartDate(CK_GE, startDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as lessEqual. + */ + public void setStartDate_LessEqual(java.util.Date startDate) { + regStartDate(CK_LE, startDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : DATE} + * + * @param fromDate The from-date of startDate. (Nullable) + * @param toDate The to-date of startDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setStartDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery(fromDate, toDate, getCValueStartDate(), + "START_DATE", "StartDate", "startDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : DATE} + * + * @param fromDate The from-date of startDate. (Nullable) + * @param toDate The to-date of startDate. (Nullable) + */ + public void setStartDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setStartDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regStartDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStartDate(), "START_DATE", + "StartDate", "startDate"); + } + + protected void registerInlineStartDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStartDate(), "START_DATE", + "StartDate", "startDate"); + } + + abstract protected ConditionValue getCValueStartDate(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * + * @param startTime The value of startTime as equal. + */ + public void setStartTime_Equal(java.sql.Time startTime) { + regStartTime(CK_EQ, startTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as notEqual. + */ + public void setStartTime_NotEqual(java.sql.Time startTime) { + regStartTime(CK_NE, startTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as greaterThan. + */ + public void setStartTime_GreaterThan(java.sql.Time startTime) { + regStartTime(CK_GT, startTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as lessThan. + */ + public void setStartTime_LessThan(java.sql.Time startTime) { + regStartTime(CK_LT, startTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as greaterEqual. + */ + public void setStartTime_GreaterEqual(java.sql.Time startTime) { + regStartTime(CK_GE, startTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as lessEqual. + */ + public void setStartTime_LessEqual(java.sql.Time startTime) { + regStartTime(CK_LE, startTime); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setStartTime_IsNull() { + regStartTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setStartTime_IsNotNull() { + regStartTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStartTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStartTime(), "START_TIME", + "StartTime", "startTime"); + } + + protected void registerInlineStartTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStartTime(), "START_TIME", + "StartTime", "startTime"); + } + + abstract protected ConditionValue getCValueStartTime(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * + * @param endDate The value of endDate as equal. + */ + public void setEndDate_Equal(java.util.Date endDate) { + regEndDate(CK_EQ, endDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as notEqual. + */ + public void setEndDate_NotEqual(java.util.Date endDate) { + regEndDate(CK_NE, endDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as greaterThan. + */ + public void setEndDate_GreaterThan(java.util.Date endDate) { + regEndDate(CK_GT, endDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as lessThan. + */ + public void setEndDate_LessThan(java.util.Date endDate) { + regEndDate(CK_LT, endDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as greaterEqual. + */ + public void setEndDate_GreaterEqual(java.util.Date endDate) { + regEndDate(CK_GE, endDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as lessEqual. + */ + public void setEndDate_LessEqual(java.util.Date endDate) { + regEndDate(CK_LE, endDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {DATE} + * + * @param fromDate The from-date of endDate. (Nullable) + * @param toDate The to-date of endDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setEndDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery(fromDate, toDate, getCValueEndDate(), "END_DATE", + "EndDate", "endDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {DATE} + * + * @param fromDate The from-date of endDate. (Nullable) + * @param toDate The to-date of endDate. (Nullable) + */ + public void setEndDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setEndDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setEndDate_IsNull() { + regEndDate(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setEndDate_IsNotNull() { + regEndDate(CK_ISNN, DUMMY_OBJECT); + } + + protected void regEndDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEndDate(), "END_DATE", "EndDate", + "endDate"); + } + + protected void registerInlineEndDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEndDate(), "END_DATE", + "EndDate", "endDate"); + } + + abstract protected ConditionValue getCValueEndDate(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * + * @param endTime The value of endTime as equal. + */ + public void setEndTime_Equal(java.sql.Time endTime) { + regEndTime(CK_EQ, endTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as notEqual. + */ + public void setEndTime_NotEqual(java.sql.Time endTime) { + regEndTime(CK_NE, endTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as greaterThan. + */ + public void setEndTime_GreaterThan(java.sql.Time endTime) { + regEndTime(CK_GT, endTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as lessThan. + */ + public void setEndTime_LessThan(java.sql.Time endTime) { + regEndTime(CK_LT, endTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as greaterEqual. + */ + public void setEndTime_GreaterEqual(java.sql.Time endTime) { + regEndTime(CK_GE, endTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as lessEqual. + */ + public void setEndTime_LessEqual(java.sql.Time endTime) { + regEndTime(CK_LE, endTime); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setEndTime_IsNull() { + regEndTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setEndTime_IsNotNull() { + regEndTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regEndTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEndTime(), "END_TIME", "EndTime", + "endTime"); + } + + protected void registerInlineEndTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEndTime(), "END_TIME", + "EndTime", "endTime"); + } + + abstract protected ConditionValue getCValueEndTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(10)} + * + * @param type The value of type as equal. + */ + public void setType_Equal(String type) { + regType(CK_EQ, fRES(type)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param type The value of type as notEqual. + */ + public void setType_NotEqual(String type) { + regType(CK_NE, fRES(type)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param type The value of type as greaterThan. + */ + public void setType_GreaterThan(String type) { + regType(CK_GT, fRES(type)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param type The value of type as lessThan. + */ + public void setType_LessThan(String type) { + regType(CK_LT, fRES(type)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param type The value of type as greaterEqual. + */ + public void setType_GreaterEqual(String type) { + regType(CK_GE, fRES(type)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param type The value of type as lessEqual. + */ + public void setType_LessEqual(String type) { + regType(CK_LE, fRES(type)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param type The value of type as prefixSearch. + */ + public void setType_PrefixSearch(String type) { + regType(CK_PS, fRES(type)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param type The value of type as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setType_LikeSearch( + String type, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(type), getCValueType(), "TYPE", + "Type", "type", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param typeList The collection of type as inScope. + */ + public void setType_InScope(Collection<String> typeList) { + regType(CK_INS, cTL(typeList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param type The collection of type as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setType_InScope( + String type, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(type), getCValueType(), "TYPE", + "Type", "type", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param typeList The collection of type as notInScope. + */ + public void setType_NotInScope(Collection<String> typeList) { + regType(CK_NINS, cTL(typeList)); + } + + protected void regType(ConditionKey key, Object value) { + registerQuery(key, value, getCValueType(), "TYPE", "Type", "type"); + } + + protected void registerInlineType(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueType(), "TYPE", "Type", "type"); + } + + abstract protected ConditionValue getCValueType(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param createdTime The value of createdTime as equal. + */ + public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { + regCreatedTime(CK_EQ, createdTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as notEqual. + */ + public void setCreatedTime_NotEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_NE, createdTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterThan. + */ + public void setCreatedTime_GreaterThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GT, createdTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessThan. + */ + public void setCreatedTime_LessThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LT, createdTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterEqual. + */ + public void setCreatedTime_GreaterEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GE, createdTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessEqual. + */ + public void setCreatedTime_LessEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LE, createdTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setCreatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueCreatedTime(), + "CREATED_TIME", "CreatedTime", "createdTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + */ + public void setCreatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setCreatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regCreatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + protected void registerInlineCreatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + abstract protected ConditionValue getCValueCreatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param createdBy The value of createdBy as equal. + */ + public void setCreatedBy_Equal(String createdBy) { + regCreatedBy(CK_EQ, fRES(createdBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as notEqual. + */ + public void setCreatedBy_NotEqual(String createdBy) { + regCreatedBy(CK_NE, fRES(createdBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterThan. + */ + public void setCreatedBy_GreaterThan(String createdBy) { + regCreatedBy(CK_GT, fRES(createdBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessThan. + */ + public void setCreatedBy_LessThan(String createdBy) { + regCreatedBy(CK_LT, fRES(createdBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterEqual. + */ + public void setCreatedBy_GreaterEqual(String createdBy) { + regCreatedBy(CK_GE, fRES(createdBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessEqual. + */ + public void setCreatedBy_LessEqual(String createdBy) { + regCreatedBy(CK_LE, fRES(createdBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as prefixSearch. + */ + public void setCreatedBy_PrefixSearch(String createdBy) { + regCreatedBy(CK_PS, fRES(createdBy)); + } + + /** + * 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.scheduler.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. + * + * @param createdByList The collection of createdBy as inScope. + */ + public void setCreatedBy_InScope(Collection<String> createdByList) { + regCreatedBy(CK_INS, cTL(createdByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdBy The collection of createdBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setCreatedBy_InScope( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), + "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdByList The collection of createdBy as notInScope. + */ + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + protected void regCreatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + protected void registerInlineCreatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + abstract protected ConditionValue getCValueCreatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param updatedTime The value of updatedTime as equal. + */ + public void setUpdatedTime_Equal(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_EQ, updatedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as notEqual. + */ + public void setUpdatedTime_NotEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_NE, updatedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterThan. + */ + public void setUpdatedTime_GreaterThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GT, updatedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessThan. + */ + public void setUpdatedTime_LessThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LT, updatedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterEqual. + */ + public void setUpdatedTime_GreaterEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GE, updatedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessEqual. + */ + public void setUpdatedTime_LessEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LE, updatedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setUpdatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueUpdatedTime(), + "UPDATED_TIME", "UpdatedTime", "updatedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + */ + public void setUpdatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setUpdatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regUpdatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + protected void registerInlineUpdatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + abstract protected ConditionValue getCValueUpdatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param updatedBy The value of updatedBy as equal. + */ + public void setUpdatedBy_Equal(String updatedBy) { + regUpdatedBy(CK_EQ, fRES(updatedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as notEqual. + */ + public void setUpdatedBy_NotEqual(String updatedBy) { + regUpdatedBy(CK_NE, fRES(updatedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterThan. + */ + public void setUpdatedBy_GreaterThan(String updatedBy) { + regUpdatedBy(CK_GT, fRES(updatedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessThan. + */ + public void setUpdatedBy_LessThan(String updatedBy) { + regUpdatedBy(CK_LT, fRES(updatedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterEqual. + */ + public void setUpdatedBy_GreaterEqual(String updatedBy) { + regUpdatedBy(CK_GE, fRES(updatedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessEqual. + */ + public void setUpdatedBy_LessEqual(String updatedBy) { + regUpdatedBy(CK_LE, fRES(updatedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as prefixSearch. + */ + public void setUpdatedBy_PrefixSearch(String updatedBy) { + regUpdatedBy(CK_PS, fRES(updatedBy)); + } + + /** + * 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.scheduler.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. + * + * @param updatedByList The collection of updatedBy as inScope. + */ + public void setUpdatedBy_InScope(Collection<String> updatedByList) { + regUpdatedBy(CK_INS, cTL(updatedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedBy The collection of updatedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUpdatedBy_InScope( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), + "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedByList The collection of updatedBy as notInScope. + */ + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + protected void regUpdatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + protected void registerInlineUpdatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + abstract protected ConditionValue getCValueUpdatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * + * @param deletedTime The value of deletedTime as equal. + */ + public void setDeletedTime_Equal(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_EQ, deletedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as notEqual. + */ + public void setDeletedTime_NotEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_NE, deletedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterThan. + */ + public void setDeletedTime_GreaterThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GT, deletedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessThan. + */ + public void setDeletedTime_LessThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LT, deletedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterEqual. + */ + public void setDeletedTime_GreaterEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GE, deletedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessEqual. + */ + public void setDeletedTime_LessEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LE, deletedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setDeletedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueDeletedTime(), + "DELETED_TIME", "DeletedTime", "deletedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + */ + public void setDeletedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setDeletedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedTime_IsNull() { + regDeletedTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedTime_IsNotNull() { + regDeletedTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + protected void registerInlineDeletedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + abstract protected ConditionValue getCValueDeletedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param deletedBy The value of deletedBy as equal. + */ + public void setDeletedBy_Equal(String deletedBy) { + regDeletedBy(CK_EQ, fRES(deletedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as notEqual. + */ + public void setDeletedBy_NotEqual(String deletedBy) { + regDeletedBy(CK_NE, fRES(deletedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterThan. + */ + public void setDeletedBy_GreaterThan(String deletedBy) { + regDeletedBy(CK_GT, fRES(deletedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessThan. + */ + public void setDeletedBy_LessThan(String deletedBy) { + regDeletedBy(CK_LT, fRES(deletedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterEqual. + */ + public void setDeletedBy_GreaterEqual(String deletedBy) { + regDeletedBy(CK_GE, fRES(deletedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessEqual. + */ + public void setDeletedBy_LessEqual(String deletedBy) { + regDeletedBy(CK_LE, fRES(deletedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as prefixSearch. + */ + public void setDeletedBy_PrefixSearch(String deletedBy) { + regDeletedBy(CK_PS, fRES(deletedBy)); + } + + /** + * 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.scheduler.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. + * + * @param deletedByList The collection of deletedBy as inScope. + */ + public void setDeletedBy_InScope(Collection<String> deletedByList) { + regDeletedBy(CK_INS, cTL(deletedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedBy The collection of deletedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDeletedBy_InScope( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), + "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedByList The collection of deletedBy as notInScope. + */ + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedBy_IsNull() { + regDeletedBy(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedBy_IsNotNull() { + regDeletedBy(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + protected void registerInlineDeletedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + abstract protected ConditionValue getCValueDeletedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * + * @param versionno The value of versionno as equal. + */ + public void setVersionno_Equal(Integer versionno) { + regVersionno(CK_EQ, versionno); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as notEqual. + */ + public void setVersionno_NotEqual(Integer versionno) { + regVersionno(CK_NE, versionno); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterThan. + */ + public void setVersionno_GreaterThan(Integer versionno) { + regVersionno(CK_GT, versionno); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessThan. + */ + public void setVersionno_LessThan(Integer versionno) { + regVersionno(CK_LT, versionno); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterEqual. + */ + public void setVersionno_GreaterEqual(Integer versionno) { + regVersionno(CK_GE, versionno); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessEqual. + */ + public void setVersionno_LessEqual(Integer versionno) { + regVersionno(CK_LE, versionno); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as inScope. + */ + public void setVersionno_InScope(Collection<Integer> versionnoList) { + regVersionno(CK_INS, cTL(versionnoList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as notInScope. + */ + public void setVersionno_NotInScope(Collection<Integer> versionnoList) { + regVersionno(CK_NINS, cTL(versionnoList)); + } + + protected void regVersionno(ConditionKey key, Object value) { + registerQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + protected void registerInlineVersionno(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + abstract protected ConditionValue getCValueVersionno(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoutineScheduleCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleContentCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleContentCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,324 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; + +/** + * The abstract condition-query of ROUTINE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsRoutineScheduleContentCQ extends + AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsRoutineScheduleContentCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to + * ROUTINE_SCHEDULE} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Long id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Long id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Long id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Long id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Long id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Long id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Long> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Long> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * @param routineScheduleCBquery Query. + * @deprecated Please use inScopeRoutineSchedule(subQuery) method. + */ + public void setId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ routineScheduleCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_RoutineSchedule(routineScheduleCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(routineScheduleCBquery, "ID", "ID", + subQueryPropertyName); + } + + public void inScopeRoutineSchedule(SubQuery<RoutineScheduleCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleCB>", subQuery); + RoutineScheduleCB cb = new RoutineScheduleCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_RoutineSchedule(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1000)} + * + * @param content The value of content as equal. + */ + public void setContent_Equal(String content) { + regContent(CK_EQ, fRES(content)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as notEqual. + */ + public void setContent_NotEqual(String content) { + regContent(CK_NE, fRES(content)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as greaterThan. + */ + public void setContent_GreaterThan(String content) { + regContent(CK_GT, fRES(content)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as lessThan. + */ + public void setContent_LessThan(String content) { + regContent(CK_LT, fRES(content)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as greaterEqual. + */ + public void setContent_GreaterEqual(String content) { + regContent(CK_GE, fRES(content)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as lessEqual. + */ + public void setContent_LessEqual(String content) { + regContent(CK_LE, fRES(content)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as prefixSearch. + */ + public void setContent_PrefixSearch(String content) { + regContent(CK_PS, fRES(content)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), + "CONTENT", "Content", "content", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param contentList The collection of content as inScope. + */ + public void setContent_InScope(Collection<String> contentList) { + regContent(CK_INS, cTL(contentList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param content The collection of content as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setContent_InScope( + String content, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), + "CONTENT", "Content", "content", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param contentList The collection of content as notInScope. + */ + public void setContent_NotInScope(Collection<String> contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setContent_IsNull() { + regContent(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setContent_IsNotNull() { + regContent(CK_ISNN, DUMMY_OBJECT); + } + + protected void regContent(ConditionKey key, Object value) { + registerQuery(key, value, getCValueContent(), "CONTENT", "Content", + "content"); + } + + protected void registerInlineContent(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueContent(), "CONTENT", + "Content", "content"); + } + + abstract protected ConditionValue getCValueContent(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoutineScheduleContentCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleContentCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleContentCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,429 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of ROUTINE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsRoutineScheduleMappingCQ extends + AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsRoutineScheduleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + public String getTableSqlName() { + return "ROUTINE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Long id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Long id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Long id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Long id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Long id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Long id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Long> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Long> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * ROUTINE_SCHEDULE} + * + * @param scheduleId The value of scheduleId as equal. + */ + public void setScheduleId_Equal(Long scheduleId) { + regScheduleId(CK_EQ, scheduleId); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as notEqual. + */ + public void setScheduleId_NotEqual(Long scheduleId) { + regScheduleId(CK_NE, scheduleId); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as greaterThan. + */ + public void setScheduleId_GreaterThan(Long scheduleId) { + regScheduleId(CK_GT, scheduleId); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as lessThan. + */ + public void setScheduleId_LessThan(Long scheduleId) { + regScheduleId(CK_LT, scheduleId); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as greaterEqual. + */ + public void setScheduleId_GreaterEqual(Long scheduleId) { + regScheduleId(CK_GE, scheduleId); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as lessEqual. + */ + public void setScheduleId_LessEqual(Long scheduleId) { + regScheduleId(CK_LE, scheduleId); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param scheduleIdList The collection of scheduleId as inScope. + */ + public void setScheduleId_InScope(Collection<Long> scheduleIdList) { + regScheduleId(CK_INS, cTL(scheduleIdList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param scheduleIdList The collection of scheduleId as notInScope. + */ + public void setScheduleId_NotInScope(Collection<Long> scheduleIdList) { + regScheduleId(CK_NINS, cTL(scheduleIdList)); + } + + /** + * @param routineScheduleCBquery Query. + * @deprecated Please use inScopeRoutineSchedule(subQuery) method. + */ + public void setScheduleId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ routineScheduleCBquery) { + String subQueryPropertyName = keepScheduleId_InScopeSubQuery_RoutineSchedule(routineScheduleCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(routineScheduleCBquery, "SCHEDULE_ID", "ID", + subQueryPropertyName); + } + + public void inScopeRoutineSchedule(SubQuery<RoutineScheduleCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleCB>", subQuery); + RoutineScheduleCB cb = new RoutineScheduleCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScheduleId_InScopeSubQuery_RoutineSchedule(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "SCHEDULE_ID", "ID", + subQueryPropertyName); + } + + abstract public String keepScheduleId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ subQuery); + + protected void regScheduleId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueScheduleId(), "SCHEDULE_ID", + "ScheduleId", "scheduleId"); + } + + protected void registerInlineScheduleId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueScheduleId(), "SCHEDULE_ID", + "ScheduleId", "scheduleId"); + } + + abstract protected ConditionValue getCValueScheduleId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) + * : FK to USER_INFO} + * + * @param userId The value of userId as equal. + */ + public void setUserId_Equal(String userId) { + regUserId(CK_EQ, fRES(userId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as notEqual. + */ + public void setUserId_NotEqual(String userId) { + regUserId(CK_NE, fRES(userId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterThan. + */ + public void setUserId_GreaterThan(String userId) { + regUserId(CK_GT, fRES(userId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessThan. + */ + public void setUserId_LessThan(String userId) { + regUserId(CK_LT, fRES(userId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterEqual. + */ + public void setUserId_GreaterEqual(String userId) { + regUserId(CK_GE, fRES(userId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessEqual. + */ + public void setUserId_LessEqual(String userId) { + regUserId(CK_LE, fRES(userId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as prefixSearch. + */ + public void setUserId_PrefixSearch(String userId) { + regUserId(CK_PS, fRES(userId)); + } + + /** + * 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.scheduler.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. + * + * @param userIdList The collection of userId as inScope. + */ + public void setUserId_InScope(Collection<String> userIdList) { + regUserId(CK_INS, cTL(userIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userId The collection of userId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUserId_InScope( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), + "USER_ID", "UserId", "userId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userIdList The collection of userId as notInScope. + */ + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); + } + + /** + * @param userInfoCBquery Query. + * @deprecated Please use inScopeUserInfo(subQuery) method. + */ + 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 inScopeUserInfo(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_UserInfo( + jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); + + protected void regUserId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + protected void registerInlineUserId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + abstract protected ConditionValue getCValueUserId(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return RoutineScheduleMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsRoutineScheduleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1809 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; + +/** + * The abstract condition-query of SINGLE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsSingleScheduleCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsSingleScheduleCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Long id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Long id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Long id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Long id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Long id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Long id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Long> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Long> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * @param singleScheduleContentCBquery Query. + * @deprecated Please use inScopeSingleScheduleContentAsOne(subQuery) + * method. + */ + public void setId_InScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ singleScheduleContentCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_SingleScheduleContentAsOne(singleScheduleContentCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(singleScheduleContentCBquery, "ID", "ID", + subQueryPropertyName); + } + + public void inScopeSingleScheduleContentAsOne( + SubQuery<SingleScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleContentCB>", subQuery); + SingleScheduleContentCB cb = new SingleScheduleContentCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_SingleScheduleContentAsOne(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery); + + /** + * @param singleScheduleMappingCBquery Query. + * @deprecated Please use inScopeSingleScheduleMappingList(subQuery) method. + */ + public void setId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ singleScheduleMappingCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_SingleScheduleMappingList(singleScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(singleScheduleMappingCBquery, "ID", + "SCHEDULE_ID", subQueryPropertyName); + } + + public void inScopeSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + public void notInScopeSingleScheduleContentAsOne( + SubQuery<SingleScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleContentCB>", subQuery); + SingleScheduleContentCB cb = new SingleScheduleContentCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotInScopeSubQuery_SingleScheduleContentAsOne(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_NotInScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery); + + public void notInScopeSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotInScopeSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotInScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + /** + * @param singleScheduleContentCBquery Query. + * @deprecated Please use existsSingleScheduleContentAsOne(subQuery) method. + */ + public void setId_ExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ singleScheduleContentCBquery) { + String subQueryPropertyName = keepId_ExistsSubQuery_SingleScheduleContentAsOne(singleScheduleContentCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(singleScheduleContentCBquery, "ID", "ID", + subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select ID from + * SINGLE_SCHEDULE_CONTENT where ...)} + * + * @param subQuery The sub-query of + * Id_ExistsSubQuery_SingleScheduleContentAsOne for 'exists'. + * (NotNull) + */ + public void existsSingleScheduleContentAsOne( + SubQuery<SingleScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleContentCB>", subQuery); + SingleScheduleContentCB cb = new SingleScheduleContentCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_ExistsSubQuery_SingleScheduleContentAsOne(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery); + + /** + * @param singleScheduleMappingCBquery Query. + * @deprecated Please use existsSingleScheduleMappingList(subQuery) method. + */ + public void setId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ singleScheduleMappingCBquery) { + String subQueryPropertyName = keepId_ExistsSubQuery_SingleScheduleMappingList(singleScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(singleScheduleMappingCBquery, "ID", + "SCHEDULE_ID", subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select SCHEDULE_ID from + * SINGLE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * Id_ExistsSubQuery_SingleScheduleMappingList for 'exists'. + * (NotNull) + */ + public void existsSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_ExistsSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select ID from + * SINGLE_SCHEDULE_CONTENT where ...)} + * + * @param subQuery The sub-query of + * Id_NotExistsSubQuery_SingleScheduleContentAsOne for 'not + * exists'. (NotNull) + */ + public void notExistsSingleScheduleContentAsOne( + SubQuery<SingleScheduleContentCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleContentCB>", subQuery); + SingleScheduleContentCB cb = new SingleScheduleContentCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotExistsSubQuery_SingleScheduleContentAsOne(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_NotExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select SCHEDULE_ID from + * SINGLE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * Id_NotExistsSubQuery_SingleScheduleMappingList for 'not + * exists'. (NotNull) + */ + public void notExistsSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_NotExistsSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName); + } + + abstract public String keepId_NotExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + public void xderiveSingleScheduleMappingList(String function, + SubQuery<SingleScheduleMappingCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepId_DeriveSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "ID", "SCHEDULE_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepId_DeriveSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(100)} + * + * @param title The value of title as equal. + */ + public void setTitle_Equal(String title) { + regTitle(CK_EQ, fRES(title)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as notEqual. + */ + public void setTitle_NotEqual(String title) { + regTitle(CK_NE, fRES(title)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as greaterThan. + */ + public void setTitle_GreaterThan(String title) { + regTitle(CK_GT, fRES(title)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as lessThan. + */ + public void setTitle_LessThan(String title) { + regTitle(CK_LT, fRES(title)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as greaterEqual. + */ + public void setTitle_GreaterEqual(String title) { + regTitle(CK_GE, fRES(title)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as lessEqual. + */ + public void setTitle_LessEqual(String title) { + regTitle(CK_LE, fRES(title)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param title The value of title as prefixSearch. + */ + public void setTitle_PrefixSearch(String title) { + regTitle(CK_PS, fRES(title)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(title), getCValueTitle(), "TITLE", + "Title", "title", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param titleList The collection of title as inScope. + */ + public void setTitle_InScope(Collection<String> titleList) { + regTitle(CK_INS, cTL(titleList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param title The collection of title as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setTitle_InScope( + String title, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(title), getCValueTitle(), "TITLE", + "Title", "title", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param titleList The collection of title as notInScope. + */ + public void setTitle_NotInScope(Collection<String> titleList) { + regTitle(CK_NINS, cTL(titleList)); + } + + protected void regTitle(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTitle(), "TITLE", "Title", "title"); + } + + protected void registerInlineTitle(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTitle(), "TITLE", "Title", + "title"); + } + + abstract protected ConditionValue getCValueTitle(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param location The value of location as equal. + */ + public void setLocation_Equal(String location) { + regLocation(CK_EQ, fRES(location)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as notEqual. + */ + public void setLocation_NotEqual(String location) { + regLocation(CK_NE, fRES(location)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as greaterThan. + */ + public void setLocation_GreaterThan(String location) { + regLocation(CK_GT, fRES(location)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as lessThan. + */ + public void setLocation_LessThan(String location) { + regLocation(CK_LT, fRES(location)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as greaterEqual. + */ + public void setLocation_GreaterEqual(String location) { + regLocation(CK_GE, fRES(location)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as lessEqual. + */ + public void setLocation_LessEqual(String location) { + regLocation(CK_LE, fRES(location)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param location The value of location as prefixSearch. + */ + public void setLocation_PrefixSearch(String location) { + regLocation(CK_PS, fRES(location)); + } + + /** + * LikeSearch(like 'xxx%' escape ...). And NullOrEmptyIgnored, + * SeveralRegistered. + * + * @param location The value of location as likeSearch. + * @param likeSearchOption The option of like-search. (NotNull) + */ + public void setLocation_LikeSearch( + String location, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(location), getCValueLocation(), + "LOCATION", "Location", "location", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param locationList The collection of location as inScope. + */ + public void setLocation_InScope(Collection<String> locationList) { + regLocation(CK_INS, cTL(locationList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param location The collection of location as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setLocation_InScope( + String location, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(location), getCValueLocation(), + "LOCATION", "Location", "location", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param locationList The collection of location as notInScope. + */ + public void setLocation_NotInScope(Collection<String> locationList) { + regLocation(CK_NINS, cTL(locationList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setLocation_IsNull() { + regLocation(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setLocation_IsNotNull() { + regLocation(CK_ISNN, DUMMY_OBJECT); + } + + protected void regLocation(ConditionKey key, Object value) { + registerQuery(key, value, getCValueLocation(), "LOCATION", "Location", + "location"); + } + + protected void registerInlineLocation(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueLocation(), "LOCATION", + "Location", "location"); + } + + abstract protected ConditionValue getCValueLocation(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DATE} + * + * @param startDate The value of startDate as equal. + */ + public void setStartDate_Equal(java.util.Date startDate) { + regStartDate(CK_EQ, startDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as notEqual. + */ + public void setStartDate_NotEqual(java.util.Date startDate) { + regStartDate(CK_NE, startDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as greaterThan. + */ + public void setStartDate_GreaterThan(java.util.Date startDate) { + regStartDate(CK_GT, startDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as lessThan. + */ + public void setStartDate_LessThan(java.util.Date startDate) { + regStartDate(CK_LT, startDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as greaterEqual. + */ + public void setStartDate_GreaterEqual(java.util.Date startDate) { + regStartDate(CK_GE, startDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param startDate The value of startDate as lessEqual. + */ + public void setStartDate_LessEqual(java.util.Date startDate) { + regStartDate(CK_LE, startDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : DATE} + * + * @param fromDate The from-date of startDate. (Nullable) + * @param toDate The to-date of startDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setStartDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery(fromDate, toDate, getCValueStartDate(), + "START_DATE", "StartDate", "startDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : DATE} + * + * @param fromDate The from-date of startDate. (Nullable) + * @param toDate The to-date of startDate. (Nullable) + */ + public void setStartDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setStartDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regStartDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStartDate(), "START_DATE", + "StartDate", "startDate"); + } + + protected void registerInlineStartDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStartDate(), "START_DATE", + "StartDate", "startDate"); + } + + abstract protected ConditionValue getCValueStartDate(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * + * @param startTime The value of startTime as equal. + */ + public void setStartTime_Equal(java.sql.Time startTime) { + regStartTime(CK_EQ, startTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as notEqual. + */ + public void setStartTime_NotEqual(java.sql.Time startTime) { + regStartTime(CK_NE, startTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as greaterThan. + */ + public void setStartTime_GreaterThan(java.sql.Time startTime) { + regStartTime(CK_GT, startTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as lessThan. + */ + public void setStartTime_LessThan(java.sql.Time startTime) { + regStartTime(CK_LT, startTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as greaterEqual. + */ + public void setStartTime_GreaterEqual(java.sql.Time startTime) { + regStartTime(CK_GE, startTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param startTime The value of startTime as lessEqual. + */ + public void setStartTime_LessEqual(java.sql.Time startTime) { + regStartTime(CK_LE, startTime); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setStartTime_IsNull() { + regStartTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setStartTime_IsNotNull() { + regStartTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regStartTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueStartTime(), "START_TIME", + "StartTime", "startTime"); + } + + protected void registerInlineStartTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueStartTime(), "START_TIME", + "StartTime", "startTime"); + } + + abstract protected ConditionValue getCValueStartTime(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : DATE} + * + * @param endDate The value of endDate as equal. + */ + public void setEndDate_Equal(java.util.Date endDate) { + regEndDate(CK_EQ, endDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as notEqual. + */ + public void setEndDate_NotEqual(java.util.Date endDate) { + regEndDate(CK_NE, endDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as greaterThan. + */ + public void setEndDate_GreaterThan(java.util.Date endDate) { + regEndDate(CK_GT, endDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as lessThan. + */ + public void setEndDate_LessThan(java.util.Date endDate) { + regEndDate(CK_LT, endDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as greaterEqual. + */ + public void setEndDate_GreaterEqual(java.util.Date endDate) { + regEndDate(CK_GE, endDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param endDate The value of endDate as lessEqual. + */ + public void setEndDate_LessEqual(java.util.Date endDate) { + regEndDate(CK_LE, endDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : DATE} + * + * @param fromDate The from-date of endDate. (Nullable) + * @param toDate The to-date of endDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setEndDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery(fromDate, toDate, getCValueEndDate(), "END_DATE", + "EndDate", "endDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : DATE} + * + * @param fromDate The from-date of endDate. (Nullable) + * @param toDate The to-date of endDate. (Nullable) + */ + public void setEndDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setEndDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regEndDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEndDate(), "END_DATE", "EndDate", + "endDate"); + } + + protected void registerInlineEndDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEndDate(), "END_DATE", + "EndDate", "endDate"); + } + + abstract protected ConditionValue getCValueEndDate(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIME} + * + * @param endTime The value of endTime as equal. + */ + public void setEndTime_Equal(java.sql.Time endTime) { + regEndTime(CK_EQ, endTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as notEqual. + */ + public void setEndTime_NotEqual(java.sql.Time endTime) { + regEndTime(CK_NE, endTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as greaterThan. + */ + public void setEndTime_GreaterThan(java.sql.Time endTime) { + regEndTime(CK_GT, endTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as lessThan. + */ + public void setEndTime_LessThan(java.sql.Time endTime) { + regEndTime(CK_LT, endTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as greaterEqual. + */ + public void setEndTime_GreaterEqual(java.sql.Time endTime) { + regEndTime(CK_GE, endTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param endTime The value of endTime as lessEqual. + */ + public void setEndTime_LessEqual(java.sql.Time endTime) { + regEndTime(CK_LE, endTime); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setEndTime_IsNull() { + regEndTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setEndTime_IsNotNull() { + regEndTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regEndTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEndTime(), "END_TIME", "EndTime", + "endTime"); + } + + protected void registerInlineEndTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEndTime(), "END_TIME", + "EndTime", "endTime"); + } + + abstract protected ConditionValue getCValueEndTime(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param createdTime The value of createdTime as equal. + */ + public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { + regCreatedTime(CK_EQ, createdTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as notEqual. + */ + public void setCreatedTime_NotEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_NE, createdTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterThan. + */ + public void setCreatedTime_GreaterThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GT, createdTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessThan. + */ + public void setCreatedTime_LessThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LT, createdTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterEqual. + */ + public void setCreatedTime_GreaterEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GE, createdTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessEqual. + */ + public void setCreatedTime_LessEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LE, createdTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setCreatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueCreatedTime(), + "CREATED_TIME", "CreatedTime", "createdTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + */ + public void setCreatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setCreatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regCreatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + protected void registerInlineCreatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + abstract protected ConditionValue getCValueCreatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param createdBy The value of createdBy as equal. + */ + public void setCreatedBy_Equal(String createdBy) { + regCreatedBy(CK_EQ, fRES(createdBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as notEqual. + */ + public void setCreatedBy_NotEqual(String createdBy) { + regCreatedBy(CK_NE, fRES(createdBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterThan. + */ + public void setCreatedBy_GreaterThan(String createdBy) { + regCreatedBy(CK_GT, fRES(createdBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessThan. + */ + public void setCreatedBy_LessThan(String createdBy) { + regCreatedBy(CK_LT, fRES(createdBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterEqual. + */ + public void setCreatedBy_GreaterEqual(String createdBy) { + regCreatedBy(CK_GE, fRES(createdBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessEqual. + */ + public void setCreatedBy_LessEqual(String createdBy) { + regCreatedBy(CK_LE, fRES(createdBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as prefixSearch. + */ + public void setCreatedBy_PrefixSearch(String createdBy) { + regCreatedBy(CK_PS, fRES(createdBy)); + } + + /** + * 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.scheduler.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. + * + * @param createdByList The collection of createdBy as inScope. + */ + public void setCreatedBy_InScope(Collection<String> createdByList) { + regCreatedBy(CK_INS, cTL(createdByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdBy The collection of createdBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setCreatedBy_InScope( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), + "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdByList The collection of createdBy as notInScope. + */ + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + protected void regCreatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + protected void registerInlineCreatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + abstract protected ConditionValue getCValueCreatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * + * @param updatedTime The value of updatedTime as equal. + */ + public void setUpdatedTime_Equal(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_EQ, updatedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as notEqual. + */ + public void setUpdatedTime_NotEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_NE, updatedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterThan. + */ + public void setUpdatedTime_GreaterThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GT, updatedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessThan. + */ + public void setUpdatedTime_LessThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LT, updatedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterEqual. + */ + public void setUpdatedTime_GreaterEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GE, updatedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessEqual. + */ + public void setUpdatedTime_LessEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LE, updatedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setUpdatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueUpdatedTime(), + "UPDATED_TIME", "UpdatedTime", "updatedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + */ + public void setUpdatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setUpdatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setUpdatedTime_IsNull() { + regUpdatedTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setUpdatedTime_IsNotNull() { + regUpdatedTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regUpdatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + protected void registerInlineUpdatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + abstract protected ConditionValue getCValueUpdatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param updatedBy The value of updatedBy as equal. + */ + public void setUpdatedBy_Equal(String updatedBy) { + regUpdatedBy(CK_EQ, fRES(updatedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as notEqual. + */ + public void setUpdatedBy_NotEqual(String updatedBy) { + regUpdatedBy(CK_NE, fRES(updatedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterThan. + */ + public void setUpdatedBy_GreaterThan(String updatedBy) { + regUpdatedBy(CK_GT, fRES(updatedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessThan. + */ + public void setUpdatedBy_LessThan(String updatedBy) { + regUpdatedBy(CK_LT, fRES(updatedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterEqual. + */ + public void setUpdatedBy_GreaterEqual(String updatedBy) { + regUpdatedBy(CK_GE, fRES(updatedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessEqual. + */ + public void setUpdatedBy_LessEqual(String updatedBy) { + regUpdatedBy(CK_LE, fRES(updatedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as prefixSearch. + */ + public void setUpdatedBy_PrefixSearch(String updatedBy) { + regUpdatedBy(CK_PS, fRES(updatedBy)); + } + + /** + * 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.scheduler.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. + * + * @param updatedByList The collection of updatedBy as inScope. + */ + public void setUpdatedBy_InScope(Collection<String> updatedByList) { + regUpdatedBy(CK_INS, cTL(updatedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedBy The collection of updatedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUpdatedBy_InScope( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), + "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedByList The collection of updatedBy as notInScope. + */ + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setUpdatedBy_IsNull() { + regUpdatedBy(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setUpdatedBy_IsNotNull() { + regUpdatedBy(CK_ISNN, DUMMY_OBJECT); + } + + protected void regUpdatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + protected void registerInlineUpdatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + abstract protected ConditionValue getCValueUpdatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * + * @param deletedTime The value of deletedTime as equal. + */ + public void setDeletedTime_Equal(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_EQ, deletedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as notEqual. + */ + public void setDeletedTime_NotEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_NE, deletedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterThan. + */ + public void setDeletedTime_GreaterThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GT, deletedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessThan. + */ + public void setDeletedTime_LessThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LT, deletedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterEqual. + */ + public void setDeletedTime_GreaterEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GE, deletedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessEqual. + */ + public void setDeletedTime_LessEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LE, deletedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setDeletedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueDeletedTime(), + "DELETED_TIME", "DeletedTime", "deletedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + */ + public void setDeletedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setDeletedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedTime_IsNull() { + regDeletedTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedTime_IsNotNull() { + regDeletedTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + protected void registerInlineDeletedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + abstract protected ConditionValue getCValueDeletedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param deletedBy The value of deletedBy as equal. + */ + public void setDeletedBy_Equal(String deletedBy) { + regDeletedBy(CK_EQ, fRES(deletedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as notEqual. + */ + public void setDeletedBy_NotEqual(String deletedBy) { + regDeletedBy(CK_NE, fRES(deletedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterThan. + */ + public void setDeletedBy_GreaterThan(String deletedBy) { + regDeletedBy(CK_GT, fRES(deletedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessThan. + */ + public void setDeletedBy_LessThan(String deletedBy) { + regDeletedBy(CK_LT, fRES(deletedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterEqual. + */ + public void setDeletedBy_GreaterEqual(String deletedBy) { + regDeletedBy(CK_GE, fRES(deletedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessEqual. + */ + public void setDeletedBy_LessEqual(String deletedBy) { + regDeletedBy(CK_LE, fRES(deletedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as prefixSearch. + */ + public void setDeletedBy_PrefixSearch(String deletedBy) { + regDeletedBy(CK_PS, fRES(deletedBy)); + } + + /** + * 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.scheduler.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. + * + * @param deletedByList The collection of deletedBy as inScope. + */ + public void setDeletedBy_InScope(Collection<String> deletedByList) { + regDeletedBy(CK_INS, cTL(deletedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedBy The collection of deletedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDeletedBy_InScope( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), + "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedByList The collection of deletedBy as notInScope. + */ + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedBy_IsNull() { + regDeletedBy(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedBy_IsNotNull() { + regDeletedBy(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + protected void registerInlineDeletedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + abstract protected ConditionValue getCValueDeletedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * + * @param versionno The value of versionno as equal. + */ + public void setVersionno_Equal(Integer versionno) { + regVersionno(CK_EQ, versionno); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as notEqual. + */ + public void setVersionno_NotEqual(Integer versionno) { + regVersionno(CK_NE, versionno); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterThan. + */ + public void setVersionno_GreaterThan(Integer versionno) { + regVersionno(CK_GT, versionno); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessThan. + */ + public void setVersionno_LessThan(Integer versionno) { + regVersionno(CK_LT, versionno); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterEqual. + */ + public void setVersionno_GreaterEqual(Integer versionno) { + regVersionno(CK_GE, versionno); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessEqual. + */ + public void setVersionno_LessEqual(Integer versionno) { + regVersionno(CK_LE, versionno); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as inScope. + */ + public void setVersionno_InScope(Collection<Integer> versionnoList) { + regVersionno(CK_INS, cTL(versionnoList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as notInScope. + */ + public void setVersionno_NotInScope(Collection<Integer> versionnoList) { + regVersionno(CK_NINS, cTL(versionnoList)); + } + + protected void regVersionno(ConditionKey key, Object value) { + registerQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + protected void registerInlineVersionno(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + abstract protected ConditionValue getCValueVersionno(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return SingleScheduleCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleContentCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleContentCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,324 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleContentCB; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; + +/** + * The abstract condition-query of SINGLE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsSingleScheduleContentCQ extends + AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsSingleScheduleContentCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE_CONTENT"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : NotNull : BIGINT : FK to + * SINGLE_SCHEDULE} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Long id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Long id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Long id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Long id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Long id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Long id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Long> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Long> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * @param singleScheduleCBquery Query. + * @deprecated Please use inScopeSingleSchedule(subQuery) method. + */ + public void setId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ singleScheduleCBquery) { + String subQueryPropertyName = keepId_InScopeSubQuery_SingleSchedule(singleScheduleCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(singleScheduleCBquery, "ID", "ID", + subQueryPropertyName); + } + + public void inScopeSingleSchedule(SubQuery<SingleScheduleCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleCB>", subQuery); + SingleScheduleCB cb = new SingleScheduleCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepId_InScopeSubQuery_SingleSchedule(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ID", "ID", subQueryPropertyName); + } + + abstract public String keepId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1000)} + * + * @param content The value of content as equal. + */ + public void setContent_Equal(String content) { + regContent(CK_EQ, fRES(content)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as notEqual. + */ + public void setContent_NotEqual(String content) { + regContent(CK_NE, fRES(content)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as greaterThan. + */ + public void setContent_GreaterThan(String content) { + regContent(CK_GT, fRES(content)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as lessThan. + */ + public void setContent_LessThan(String content) { + regContent(CK_LT, fRES(content)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as greaterEqual. + */ + public void setContent_GreaterEqual(String content) { + regContent(CK_GE, fRES(content)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as lessEqual. + */ + public void setContent_LessEqual(String content) { + regContent(CK_LE, fRES(content)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param content The value of content as prefixSearch. + */ + public void setContent_PrefixSearch(String content) { + regContent(CK_PS, fRES(content)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(content), getCValueContent(), + "CONTENT", "Content", "content", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param contentList The collection of content as inScope. + */ + public void setContent_InScope(Collection<String> contentList) { + regContent(CK_INS, cTL(contentList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param content The collection of content as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setContent_InScope( + String content, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(content), getCValueContent(), + "CONTENT", "Content", "content", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param contentList The collection of content as notInScope. + */ + public void setContent_NotInScope(Collection<String> contentList) { + regContent(CK_NINS, cTL(contentList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setContent_IsNull() { + regContent(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setContent_IsNotNull() { + regContent(CK_ISNN, DUMMY_OBJECT); + } + + protected void regContent(ConditionKey key, Object value) { + registerQuery(key, value, getCValueContent(), "CONTENT", "Content", + "content"); + } + + protected void registerInlineContent(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueContent(), "CONTENT", + "Content", "content"); + } + + abstract protected ConditionValue getCValueContent(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return SingleScheduleContentCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleContentCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleContentCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,429 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of SINGLE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsSingleScheduleMappingCQ extends + AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsSingleScheduleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + public String getTableSqlName() { + return "SINGLE_SCHEDULE_MAPPING"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullIgnored, OnceRegistered. {PK : ID : NotNull : BIGINT} + * + * @param id The value of id as equal. + */ + public void setId_Equal(Long id) { + regId(CK_EQ, id); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as notEqual. + */ + public void setId_NotEqual(Long id) { + regId(CK_NE, id); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterThan. + */ + public void setId_GreaterThan(Long id) { + regId(CK_GT, id); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessThan. + */ + public void setId_LessThan(Long id) { + regId(CK_LT, id); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as greaterEqual. + */ + public void setId_GreaterEqual(Long id) { + regId(CK_GE, id); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param id The value of id as lessEqual. + */ + public void setId_LessEqual(Long id) { + regId(CK_LE, id); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as inScope. + */ + public void setId_InScope(Collection<Long> idList) { + regId(CK_INS, cTL(idList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param idList The collection of id as notInScope. + */ + public void setId_NotInScope(Collection<Long> idList) { + regId(CK_NINS, cTL(idList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setId_IsNull() { + regId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setId_IsNotNull() { + regId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + protected void registerInlineId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueId(), "ID", "Id", "id"); + } + + abstract protected ConditionValue getCValueId(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : BIGINT : FK to + * SINGLE_SCHEDULE} + * + * @param scheduleId The value of scheduleId as equal. + */ + public void setScheduleId_Equal(Long scheduleId) { + regScheduleId(CK_EQ, scheduleId); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as notEqual. + */ + public void setScheduleId_NotEqual(Long scheduleId) { + regScheduleId(CK_NE, scheduleId); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as greaterThan. + */ + public void setScheduleId_GreaterThan(Long scheduleId) { + regScheduleId(CK_GT, scheduleId); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as lessThan. + */ + public void setScheduleId_LessThan(Long scheduleId) { + regScheduleId(CK_LT, scheduleId); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as greaterEqual. + */ + public void setScheduleId_GreaterEqual(Long scheduleId) { + regScheduleId(CK_GE, scheduleId); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param scheduleId The value of scheduleId as lessEqual. + */ + public void setScheduleId_LessEqual(Long scheduleId) { + regScheduleId(CK_LE, scheduleId); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param scheduleIdList The collection of scheduleId as inScope. + */ + public void setScheduleId_InScope(Collection<Long> scheduleIdList) { + regScheduleId(CK_INS, cTL(scheduleIdList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param scheduleIdList The collection of scheduleId as notInScope. + */ + public void setScheduleId_NotInScope(Collection<Long> scheduleIdList) { + regScheduleId(CK_NINS, cTL(scheduleIdList)); + } + + /** + * @param singleScheduleCBquery Query. + * @deprecated Please use inScopeSingleSchedule(subQuery) method. + */ + public void setScheduleId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ singleScheduleCBquery) { + String subQueryPropertyName = keepScheduleId_InScopeSubQuery_SingleSchedule(singleScheduleCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(singleScheduleCBquery, "SCHEDULE_ID", "ID", + subQueryPropertyName); + } + + public void inScopeSingleSchedule(SubQuery<SingleScheduleCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleCB>", subQuery); + SingleScheduleCB cb = new SingleScheduleCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepScheduleId_InScopeSubQuery_SingleSchedule(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "SCHEDULE_ID", "ID", + subQueryPropertyName); + } + + abstract public String keepScheduleId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ subQuery); + + protected void regScheduleId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueScheduleId(), "SCHEDULE_ID", + "ScheduleId", "scheduleId"); + } + + protected void registerInlineScheduleId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueScheduleId(), "SCHEDULE_ID", + "ScheduleId", "scheduleId"); + } + + abstract protected ConditionValue getCValueScheduleId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : VARCHAR(255) + * : FK to USER_INFO} + * + * @param userId The value of userId as equal. + */ + public void setUserId_Equal(String userId) { + regUserId(CK_EQ, fRES(userId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as notEqual. + */ + public void setUserId_NotEqual(String userId) { + regUserId(CK_NE, fRES(userId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterThan. + */ + public void setUserId_GreaterThan(String userId) { + regUserId(CK_GT, fRES(userId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessThan. + */ + public void setUserId_LessThan(String userId) { + regUserId(CK_LT, fRES(userId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterEqual. + */ + public void setUserId_GreaterEqual(String userId) { + regUserId(CK_GE, fRES(userId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessEqual. + */ + public void setUserId_LessEqual(String userId) { + regUserId(CK_LE, fRES(userId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as prefixSearch. + */ + public void setUserId_PrefixSearch(String userId) { + regUserId(CK_PS, fRES(userId)); + } + + /** + * 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.scheduler.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. + * + * @param userIdList The collection of userId as inScope. + */ + public void setUserId_InScope(Collection<String> userIdList) { + regUserId(CK_INS, cTL(userIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userId The collection of userId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUserId_InScope( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), + "USER_ID", "UserId", "userId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userIdList The collection of userId as notInScope. + */ + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); + } + + /** + * @param userInfoCBquery Query. + * @deprecated Please use inScopeUserInfo(subQuery) method. + */ + 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 inScopeUserInfo(SubQuery<UserInfoCB> subQuery) { + assertObjectNotNull("subQuery<UserInfoCB>", subQuery); + UserInfoCB cb = new UserInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_UserInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_UserInfo( + jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ subQuery); + + protected void regUserId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + protected void registerInlineUserId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + abstract protected ConditionValue getCValueUserId(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return SingleScheduleMappingCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsSingleScheduleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsUserInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsUserInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsUserInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,3288 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Collection; + +import jp.sf.pal.scheduler.db.allcommon.cbean.AbstractConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.SubQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.GroupInfoCB; +import jp.sf.pal.scheduler.db.cbean.GroupMappingCB; +import jp.sf.pal.scheduler.db.cbean.RoleInfoCB; +import jp.sf.pal.scheduler.db.cbean.RoleMappingCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The abstract condition-query of USER_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public abstract class AbstractBsUserInfoCQ extends AbstractConditionQuery { + + //========================================================================== + // ========= + // Constructor + // =========== + public AbstractBsUserInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Table Name + // ========== + public String getTableDbName() { + return "USER_INFO"; + } + + public String getTableSqlName() { + return "USER_INFO"; + } + + //========================================================================== + // ========= + // Query + // ===== + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {PK : NotNull : + * VARCHAR(255)} + * + * @param userId The value of userId as equal. + */ + public void setUserId_Equal(String userId) { + regUserId(CK_EQ, fRES(userId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as notEqual. + */ + public void setUserId_NotEqual(String userId) { + regUserId(CK_NE, fRES(userId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterThan. + */ + public void setUserId_GreaterThan(String userId) { + regUserId(CK_GT, fRES(userId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessThan. + */ + public void setUserId_LessThan(String userId) { + regUserId(CK_LT, fRES(userId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as greaterEqual. + */ + public void setUserId_GreaterEqual(String userId) { + regUserId(CK_GE, fRES(userId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as lessEqual. + */ + public void setUserId_LessEqual(String userId) { + regUserId(CK_LE, fRES(userId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param userId The value of userId as prefixSearch. + */ + public void setUserId_PrefixSearch(String userId) { + regUserId(CK_PS, fRES(userId)); + } + + /** + * 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.scheduler.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. + * + * @param userIdList The collection of userId as inScope. + */ + public void setUserId_InScope(Collection<String> userIdList) { + regUserId(CK_INS, cTL(userIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userId The collection of userId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUserId_InScope( + String userId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(userId), getCValueUserId(), + "USER_ID", "UserId", "userId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param userIdList The collection of userId as notInScope. + */ + public void setUserId_NotInScope(Collection<String> userIdList) { + regUserId(CK_NINS, cTL(userIdList)); + } + + /** + * @param groupMappingCBquery Query. + * @deprecated Please use inScopeGroupMappingList(subQuery) method. + */ + public void setUserId_InScopeSubQuery_GroupMappingList( + GroupMappingCQ groupMappingCBquery) { + String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(groupMappingCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(groupMappingCBquery, "USER_ID", "USER_ID", + subQueryPropertyName); + } + + public void inScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public 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. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + /** + * @param routineScheduleMappingCBquery Query. + * @deprecated Please use inScopeRoutineScheduleMappingList(subQuery) + * method. + */ + public void setUserId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ routineScheduleMappingCBquery) { + String subQueryPropertyName = keepUserId_InScopeSubQuery_RoutineScheduleMappingList(routineScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(routineScheduleMappingCBquery, "USER_ID", + "USER_ID", subQueryPropertyName); + } + + public void inScopeRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + /** + * @param singleScheduleMappingCBquery Query. + * @deprecated Please use inScopeSingleScheduleMappingList(subQuery) method. + */ + public void setUserId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ singleScheduleMappingCBquery) { + String subQueryPropertyName = keepUserId_InScopeSubQuery_SingleScheduleMappingList(singleScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerInScopeSubQuery(singleScheduleMappingCBquery, "USER_ID", + "USER_ID", subQueryPropertyName); + } + + public void inScopeSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_InScopeSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + public void notInScopeGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotInScopeSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotInScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery); + + public void notInScopeRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotInScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + public void notInScopeRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotInScopeSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotInScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + public void notInScopeSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotInScopeSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerNotInScopeSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotInScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ 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 ...)} + * + * @param subQuery The sub-query of UserId_ExistsSubQuery_GroupMappingList + * for 'exists'. (NotNull) + */ + public void existsGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_ExistsSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public 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 ...)} + * + * @param subQuery The sub-query of UserId_ExistsSubQuery_RoleMappingList + * for 'exists'. (NotNull) + */ + public void existsRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_ExistsSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_ExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + /** + * @param routineScheduleMappingCBquery Query. + * @deprecated Please use existsRoutineScheduleMappingList(subQuery) method. + */ + public void setUserId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ routineScheduleMappingCBquery) { + String subQueryPropertyName = keepUserId_ExistsSubQuery_RoutineScheduleMappingList(routineScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(routineScheduleMappingCBquery, "USER_ID", + "USER_ID", subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select USER_ID from + * ROUTINE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * UserId_ExistsSubQuery_RoutineScheduleMappingList for 'exists'. + * (NotNull) + */ + public void existsRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_ExistsSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + /** + * @param singleScheduleMappingCBquery Query. + * @deprecated Please use existsSingleScheduleMappingList(subQuery) method. + */ + public void setUserId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ singleScheduleMappingCBquery) { + String subQueryPropertyName = keepUserId_ExistsSubQuery_SingleScheduleMappingList(singleScheduleMappingCBquery);// for + // saving + // query + // - + // value + // . + registerExistsSubQuery(singleScheduleMappingCBquery, "USER_ID", + "USER_ID", subQueryPropertyName); + } + + /** + * Set up 'exists' sub-query. {exists (select USER_ID from + * SINGLE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * UserId_ExistsSubQuery_SingleScheduleMappingList for 'exists'. + * (NotNull) + */ + public void existsSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_ExistsSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select USER_ID from + * GROUP_MAPPING where ...)} + * + * @param subQuery The sub-query of + * UserId_NotExistsSubQuery_GroupMappingList for 'not exists'. + * (NotNull) + */ + public void notExistsGroupMappingList(SubQuery<GroupMappingCB> subQuery) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotExistsSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select USER_ID from + * ROLE_MAPPING where ...)} + * + * @param subQuery The sub-query of UserId_NotExistsSubQuery_RoleMappingList + * for 'not exists'. (NotNull) + */ + public void notExistsRoleMappingList(SubQuery<RoleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select USER_ID from + * ROUTINE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * UserId_NotExistsSubQuery_RoutineScheduleMappingList for 'not + * exists'. (NotNull) + */ + public void notExistsRoutineScheduleMappingList( + SubQuery<RoutineScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotExistsSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + /** + * Set up 'not exists' sub-query. {not exists (select USER_ID from + * SINGLE_SCHEDULE_MAPPING where ...)} + * + * @param subQuery The sub-query of + * UserId_NotExistsSubQuery_SingleScheduleMappingList for 'not + * exists'. (NotNull) + */ + public void notExistsSingleScheduleMappingList( + SubQuery<SingleScheduleMappingCB> subQuery) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForExistsSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_NotExistsSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerNotExistsSubQuery(cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName); + } + + abstract public String keepUserId_NotExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + public void xderiveGroupMappingList(String function, + SubQuery<GroupMappingCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<GroupMappingCB>", subQuery); + GroupMappingCB cb = new GroupMappingCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_DeriveSubQuery_GroupMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepUserId_DeriveSubQuery_GroupMappingList( + GroupMappingCQ subQuery); + + public void xderiveRoleMappingList(String function, + SubQuery<RoleMappingCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<RoleMappingCB>", subQuery); + RoleMappingCB cb = new RoleMappingCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_DeriveSubQuery_RoleMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepUserId_DeriveSubQuery_RoleMappingList( + RoleMappingCQ subQuery); + + public void xderiveRoutineScheduleMappingList(String function, + SubQuery<RoutineScheduleMappingCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<RoutineScheduleMappingCB>", subQuery); + RoutineScheduleMappingCB cb = new RoutineScheduleMappingCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_DeriveSubQuery_RoutineScheduleMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepUserId_DeriveSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery); + + public void xderiveSingleScheduleMappingList(String function, + SubQuery<SingleScheduleMappingCB> subQuery, String aliasName) { + assertObjectNotNull("subQuery<SingleScheduleMappingCB>", subQuery); + SingleScheduleMappingCB cb = new SingleScheduleMappingCB(); + cb.xsetupForDeriveReferrer(); + subQuery.query(cb); + String subQueryPropertyName = keepUserId_DeriveSubQuery_SingleScheduleMappingList(cb + .query());// for saving query-value. + registerDeriveSubQuery(function, cb.query(), "USER_ID", "USER_ID", + subQueryPropertyName, aliasName); + } + + abstract public String keepUserId_DeriveSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setUserId_IsNull() { + regUserId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setUserId_IsNotNull() { + regUserId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regUserId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + protected void registerInlineUserId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUserId(), "USER_ID", "UserId", + "userId"); + } + + abstract protected ConditionValue getCValueUserId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param givenName The value of givenName as equal. + */ + public void setGivenName_Equal(String givenName) { + regGivenName(CK_EQ, fRES(givenName)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenName The value of givenName as notEqual. + */ + public void setGivenName_NotEqual(String givenName) { + regGivenName(CK_NE, fRES(givenName)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenName The value of givenName as greaterThan. + */ + public void setGivenName_GreaterThan(String givenName) { + regGivenName(CK_GT, fRES(givenName)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenName The value of givenName as lessThan. + */ + public void setGivenName_LessThan(String givenName) { + regGivenName(CK_LT, fRES(givenName)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenName The value of givenName as greaterEqual. + */ + public void setGivenName_GreaterEqual(String givenName) { + regGivenName(CK_GE, fRES(givenName)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenName The value of givenName as lessEqual. + */ + public void setGivenName_LessEqual(String givenName) { + regGivenName(CK_LE, fRES(givenName)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenName The value of givenName as prefixSearch. + */ + public void setGivenName_PrefixSearch(String givenName) { + regGivenName(CK_PS, fRES(givenName)); + } + + /** + * 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.scheduler.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. + * + * @param givenNameList The collection of givenName as inScope. + */ + public void setGivenName_InScope(Collection<String> givenNameList) { + regGivenName(CK_INS, cTL(givenNameList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param givenName The collection of givenName as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setGivenName_InScope( + String givenName, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(givenName), getCValueGivenName(), + "GIVEN_NAME", "GivenName", "givenName", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param givenNameList The collection of givenName as notInScope. + */ + public void setGivenName_NotInScope(Collection<String> givenNameList) { + regGivenName(CK_NINS, cTL(givenNameList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setGivenName_IsNull() { + regGivenName(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setGivenName_IsNotNull() { + regGivenName(CK_ISNN, DUMMY_OBJECT); + } + + protected void regGivenName(ConditionKey key, Object value) { + registerQuery(key, value, getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName"); + } + + protected void registerInlineGivenName(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueGivenName(), "GIVEN_NAME", + "GivenName", "givenName"); + } + + abstract protected ConditionValue getCValueGivenName(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param familyName The value of familyName as equal. + */ + public void setFamilyName_Equal(String familyName) { + regFamilyName(CK_EQ, fRES(familyName)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyName The value of familyName as notEqual. + */ + public void setFamilyName_NotEqual(String familyName) { + regFamilyName(CK_NE, fRES(familyName)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyName The value of familyName as greaterThan. + */ + public void setFamilyName_GreaterThan(String familyName) { + regFamilyName(CK_GT, fRES(familyName)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyName The value of familyName as lessThan. + */ + public void setFamilyName_LessThan(String familyName) { + regFamilyName(CK_LT, fRES(familyName)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyName The value of familyName as greaterEqual. + */ + public void setFamilyName_GreaterEqual(String familyName) { + regFamilyName(CK_GE, fRES(familyName)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyName The value of familyName as lessEqual. + */ + public void setFamilyName_LessEqual(String familyName) { + regFamilyName(CK_LE, fRES(familyName)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyName The value of familyName as prefixSearch. + */ + public void setFamilyName_PrefixSearch(String familyName) { + regFamilyName(CK_PS, fRES(familyName)); + } + + /** + * 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.scheduler.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. + * + * @param familyNameList The collection of familyName as inScope. + */ + public void setFamilyName_InScope(Collection<String> familyNameList) { + regFamilyName(CK_INS, cTL(familyNameList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param familyName The collection of familyName as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setFamilyName_InScope( + String familyName, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(familyName), getCValueFamilyName(), + "FAMILY_NAME", "FamilyName", "familyName", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param familyNameList The collection of familyName as notInScope. + */ + public void setFamilyName_NotInScope(Collection<String> familyNameList) { + regFamilyName(CK_NINS, cTL(familyNameList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setFamilyName_IsNull() { + regFamilyName(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setFamilyName_IsNotNull() { + regFamilyName(CK_ISNN, DUMMY_OBJECT); + } + + protected void regFamilyName(ConditionKey key, Object value) { + registerQuery(key, value, getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName"); + } + + protected void registerInlineFamilyName(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueFamilyName(), "FAMILY_NAME", + "FamilyName", "familyName"); + } + + abstract protected ConditionValue getCValueFamilyName(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(50)} + * + * @param middleName The value of middleName as equal. + */ + public void setMiddleName_Equal(String middleName) { + regMiddleName(CK_EQ, fRES(middleName)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param middleName The value of middleName as notEqual. + */ + public void setMiddleName_NotEqual(String middleName) { + regMiddleName(CK_NE, fRES(middleName)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param middleName The value of middleName as greaterThan. + */ + public void setMiddleName_GreaterThan(String middleName) { + regMiddleName(CK_GT, fRES(middleName)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param middleName The value of middleName as lessThan. + */ + public void setMiddleName_LessThan(String middleName) { + regMiddleName(CK_LT, fRES(middleName)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param middleName The value of middleName as greaterEqual. + */ + public void setMiddleName_GreaterEqual(String middleName) { + regMiddleName(CK_GE, fRES(middleName)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param middleName The value of middleName as lessEqual. + */ + public void setMiddleName_LessEqual(String middleName) { + regMiddleName(CK_LE, fRES(middleName)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param middleName The value of middleName as prefixSearch. + */ + public void setMiddleName_PrefixSearch(String middleName) { + regMiddleName(CK_PS, fRES(middleName)); + } + + /** + * 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.scheduler.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. + * + * @param middleNameList The collection of middleName as inScope. + */ + public void setMiddleName_InScope(Collection<String> middleNameList) { + regMiddleName(CK_INS, cTL(middleNameList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param middleName The collection of middleName as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setMiddleName_InScope( + String middleName, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(middleName), getCValueMiddleName(), + "MIDDLE_NAME", "MiddleName", "middleName", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param middleNameList The collection of middleName as notInScope. + */ + public void setMiddleName_NotInScope(Collection<String> middleNameList) { + regMiddleName(CK_NINS, cTL(middleNameList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setMiddleName_IsNull() { + regMiddleName(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setMiddleName_IsNotNull() { + regMiddleName(CK_ISNN, DUMMY_OBJECT); + } + + protected void regMiddleName(ConditionKey key, Object value) { + registerQuery(key, value, getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName"); + } + + protected void registerInlineMiddleName(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueMiddleName(), "MIDDLE_NAME", + "MiddleName", "middleName"); + } + + abstract protected ConditionValue getCValueMiddleName(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param givenNameDesc The value of givenNameDesc as equal. + */ + public void setGivenNameDesc_Equal(String givenNameDesc) { + regGivenNameDesc(CK_EQ, fRES(givenNameDesc)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenNameDesc The value of givenNameDesc as notEqual. + */ + public void setGivenNameDesc_NotEqual(String givenNameDesc) { + regGivenNameDesc(CK_NE, fRES(givenNameDesc)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenNameDesc The value of givenNameDesc as greaterThan. + */ + public void setGivenNameDesc_GreaterThan(String givenNameDesc) { + regGivenNameDesc(CK_GT, fRES(givenNameDesc)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenNameDesc The value of givenNameDesc as lessThan. + */ + public void setGivenNameDesc_LessThan(String givenNameDesc) { + regGivenNameDesc(CK_LT, fRES(givenNameDesc)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenNameDesc The value of givenNameDesc as greaterEqual. + */ + public void setGivenNameDesc_GreaterEqual(String givenNameDesc) { + regGivenNameDesc(CK_GE, fRES(givenNameDesc)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenNameDesc The value of givenNameDesc as lessEqual. + */ + public void setGivenNameDesc_LessEqual(String givenNameDesc) { + regGivenNameDesc(CK_LE, fRES(givenNameDesc)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param givenNameDesc The value of givenNameDesc as prefixSearch. + */ + public void setGivenNameDesc_PrefixSearch(String givenNameDesc) { + regGivenNameDesc(CK_PS, fRES(givenNameDesc)); + } + + /** + * 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.scheduler.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. + * + * @param givenNameDescList The collection of givenNameDesc as inScope. + */ + public void setGivenNameDesc_InScope(Collection<String> givenNameDescList) { + regGivenNameDesc(CK_INS, cTL(givenNameDescList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param givenNameDesc The collection of givenNameDesc as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setGivenNameDesc_InScope( + String givenNameDesc, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(givenNameDesc), + getCValueGivenNameDesc(), "GIVEN_NAME_DESC", "GivenNameDesc", + "givenNameDesc", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param givenNameDescList The collection of givenNameDesc as notInScope. + */ + public void setGivenNameDesc_NotInScope(Collection<String> givenNameDescList) { + regGivenNameDesc(CK_NINS, cTL(givenNameDescList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setGivenNameDesc_IsNull() { + regGivenNameDesc(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setGivenNameDesc_IsNotNull() { + regGivenNameDesc(CK_ISNN, DUMMY_OBJECT); + } + + protected void regGivenNameDesc(ConditionKey key, Object value) { + registerQuery(key, value, getCValueGivenNameDesc(), "GIVEN_NAME_DESC", + "GivenNameDesc", "givenNameDesc"); + } + + protected void registerInlineGivenNameDesc(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueGivenNameDesc(), + "GIVEN_NAME_DESC", "GivenNameDesc", "givenNameDesc"); + } + + abstract protected ConditionValue getCValueGivenNameDesc(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param familyNameDesc The value of familyNameDesc as equal. + */ + public void setFamilyNameDesc_Equal(String familyNameDesc) { + regFamilyNameDesc(CK_EQ, fRES(familyNameDesc)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyNameDesc The value of familyNameDesc as notEqual. + */ + public void setFamilyNameDesc_NotEqual(String familyNameDesc) { + regFamilyNameDesc(CK_NE, fRES(familyNameDesc)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyNameDesc The value of familyNameDesc as greaterThan. + */ + public void setFamilyNameDesc_GreaterThan(String familyNameDesc) { + regFamilyNameDesc(CK_GT, fRES(familyNameDesc)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyNameDesc The value of familyNameDesc as lessThan. + */ + public void setFamilyNameDesc_LessThan(String familyNameDesc) { + regFamilyNameDesc(CK_LT, fRES(familyNameDesc)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyNameDesc The value of familyNameDesc as greaterEqual. + */ + public void setFamilyNameDesc_GreaterEqual(String familyNameDesc) { + regFamilyNameDesc(CK_GE, fRES(familyNameDesc)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyNameDesc The value of familyNameDesc as lessEqual. + */ + public void setFamilyNameDesc_LessEqual(String familyNameDesc) { + regFamilyNameDesc(CK_LE, fRES(familyNameDesc)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param familyNameDesc The value of familyNameDesc as prefixSearch. + */ + public void setFamilyNameDesc_PrefixSearch(String familyNameDesc) { + regFamilyNameDesc(CK_PS, fRES(familyNameDesc)); + } + + /** + * 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.scheduler.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. + * + * @param familyNameDescList The collection of familyNameDesc as inScope. + */ + public void setFamilyNameDesc_InScope(Collection<String> familyNameDescList) { + regFamilyNameDesc(CK_INS, cTL(familyNameDescList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param familyNameDesc The collection of familyNameDesc as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setFamilyNameDesc_InScope( + String familyNameDesc, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(familyNameDesc), + getCValueFamilyNameDesc(), "FAMILY_NAME_DESC", + "FamilyNameDesc", "familyNameDesc", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param familyNameDescList The collection of familyNameDesc as notInScope. + */ + public void setFamilyNameDesc_NotInScope( + Collection<String> familyNameDescList) { + regFamilyNameDesc(CK_NINS, cTL(familyNameDescList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setFamilyNameDesc_IsNull() { + regFamilyNameDesc(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setFamilyNameDesc_IsNotNull() { + regFamilyNameDesc(CK_ISNN, DUMMY_OBJECT); + } + + protected void regFamilyNameDesc(ConditionKey key, Object value) { + registerQuery(key, value, getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc"); + } + + protected void registerInlineFamilyNameDesc(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueFamilyNameDesc(), + "FAMILY_NAME_DESC", "FamilyNameDesc", "familyNameDesc"); + } + + abstract protected ConditionValue getCValueFamilyNameDesc(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(100)} + * + * @param nickname The value of nickname as equal. + */ + public void setNickname_Equal(String nickname) { + regNickname(CK_EQ, fRES(nickname)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param nickname The value of nickname as notEqual. + */ + public void setNickname_NotEqual(String nickname) { + regNickname(CK_NE, fRES(nickname)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param nickname The value of nickname as greaterThan. + */ + public void setNickname_GreaterThan(String nickname) { + regNickname(CK_GT, fRES(nickname)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param nickname The value of nickname as lessThan. + */ + public void setNickname_LessThan(String nickname) { + regNickname(CK_LT, fRES(nickname)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param nickname The value of nickname as greaterEqual. + */ + public void setNickname_GreaterEqual(String nickname) { + regNickname(CK_GE, fRES(nickname)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param nickname The value of nickname as lessEqual. + */ + public void setNickname_LessEqual(String nickname) { + regNickname(CK_LE, fRES(nickname)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param nickname The value of nickname as prefixSearch. + */ + public void setNickname_PrefixSearch(String nickname) { + regNickname(CK_PS, fRES(nickname)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(nickname), getCValueNickname(), + "NICKNAME", "Nickname", "nickname", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nicknameList The collection of nickname as inScope. + */ + public void setNickname_InScope(Collection<String> nicknameList) { + regNickname(CK_INS, cTL(nicknameList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nickname The collection of nickname as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setNickname_InScope( + String nickname, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(nickname), getCValueNickname(), + "NICKNAME", "Nickname", "nickname", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param nicknameList The collection of nickname as notInScope. + */ + public void setNickname_NotInScope(Collection<String> nicknameList) { + regNickname(CK_NINS, cTL(nicknameList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setNickname_IsNull() { + regNickname(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setNickname_IsNotNull() { + regNickname(CK_ISNN, DUMMY_OBJECT); + } + + protected void regNickname(ConditionKey key, Object value) { + registerQuery(key, value, getCValueNickname(), "NICKNAME", "Nickname", + "nickname"); + } + + protected void registerInlineNickname(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueNickname(), "NICKNAME", + "Nickname", "nickname"); + } + + abstract protected ConditionValue getCValueNickname(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(1)} + * + * @param gender The value of gender as equal. + */ + public void setGender_Equal(String gender) { + regGender(CK_EQ, fRES(gender)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param gender The value of gender as notEqual. + */ + public void setGender_NotEqual(String gender) { + regGender(CK_NE, fRES(gender)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param gender The value of gender as greaterThan. + */ + public void setGender_GreaterThan(String gender) { + regGender(CK_GT, fRES(gender)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param gender The value of gender as lessThan. + */ + public void setGender_LessThan(String gender) { + regGender(CK_LT, fRES(gender)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param gender The value of gender as greaterEqual. + */ + public void setGender_GreaterEqual(String gender) { + regGender(CK_GE, fRES(gender)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param gender The value of gender as lessEqual. + */ + public void setGender_LessEqual(String gender) { + regGender(CK_LE, fRES(gender)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param gender The value of gender as prefixSearch. + */ + public void setGender_PrefixSearch(String gender) { + regGender(CK_PS, fRES(gender)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(gender), getCValueGender(), + "GENDER", "Gender", "gender", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param genderList The collection of gender as inScope. + */ + public void setGender_InScope(Collection<String> genderList) { + regGender(CK_INS, cTL(genderList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param gender The collection of gender as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setGender_InScope( + String gender, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(gender), getCValueGender(), "GENDER", + "Gender", "gender", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param genderList The collection of gender as notInScope. + */ + public void setGender_NotInScope(Collection<String> genderList) { + regGender(CK_NINS, cTL(genderList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setGender_IsNull() { + regGender(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setGender_IsNotNull() { + regGender(CK_ISNN, DUMMY_OBJECT); + } + + protected void regGender(ConditionKey key, Object value) { + registerQuery(key, value, getCValueGender(), "GENDER", "Gender", + "gender"); + } + + protected void registerInlineGender(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueGender(), "GENDER", "Gender", + "gender"); + } + + abstract protected ConditionValue getCValueGender(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {DATE} + * + * @param birthDate The value of birthDate as equal. + */ + public void setBirthDate_Equal(java.util.Date birthDate) { + regBirthDate(CK_EQ, birthDate); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param birthDate The value of birthDate as notEqual. + */ + public void setBirthDate_NotEqual(java.util.Date birthDate) { + regBirthDate(CK_NE, birthDate); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param birthDate The value of birthDate as greaterThan. + */ + public void setBirthDate_GreaterThan(java.util.Date birthDate) { + regBirthDate(CK_GT, birthDate); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param birthDate The value of birthDate as lessThan. + */ + public void setBirthDate_LessThan(java.util.Date birthDate) { + regBirthDate(CK_LT, birthDate); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param birthDate The value of birthDate as greaterEqual. + */ + public void setBirthDate_GreaterEqual(java.util.Date birthDate) { + regBirthDate(CK_GE, birthDate); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param birthDate The value of birthDate as lessEqual. + */ + public void setBirthDate_LessEqual(java.util.Date birthDate) { + regBirthDate(CK_LE, birthDate); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {DATE} + * + * @param fromDate The from-date of birthDate. (Nullable) + * @param toDate The to-date of birthDate. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setBirthDate_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery(fromDate, toDate, getCValueBirthDate(), + "BIRTH_DATE", "BirthDate", "birthDate", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {DATE} + * + * @param fromDate The from-date of birthDate. (Nullable) + * @param toDate The to-date of birthDate. (Nullable) + */ + public void setBirthDate_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setBirthDate_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setBirthDate_IsNull() { + regBirthDate(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setBirthDate_IsNotNull() { + regBirthDate(CK_ISNN, DUMMY_OBJECT); + } + + protected void regBirthDate(ConditionKey key, Object value) { + registerQuery(key, value, getCValueBirthDate(), "BIRTH_DATE", + "BirthDate", "birthDate"); + } + + protected void registerInlineBirthDate(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueBirthDate(), "BIRTH_DATE", + "BirthDate", "birthDate"); + } + + abstract protected ConditionValue getCValueBirthDate(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param email The value of email as equal. + */ + public void setEmail_Equal(String email) { + regEmail(CK_EQ, fRES(email)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as notEqual. + */ + public void setEmail_NotEqual(String email) { + regEmail(CK_NE, fRES(email)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as greaterThan. + */ + public void setEmail_GreaterThan(String email) { + regEmail(CK_GT, fRES(email)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as lessThan. + */ + public void setEmail_LessThan(String email) { + regEmail(CK_LT, fRES(email)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as greaterEqual. + */ + public void setEmail_GreaterEqual(String email) { + regEmail(CK_GE, fRES(email)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as lessEqual. + */ + public void setEmail_LessEqual(String email) { + regEmail(CK_LE, fRES(email)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param email The value of email as prefixSearch. + */ + public void setEmail_PrefixSearch(String email) { + regEmail(CK_PS, fRES(email)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(email), getCValueEmail(), "EMAIL", + "Email", "email", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param emailList The collection of email as inScope. + */ + public void setEmail_InScope(Collection<String> emailList) { + regEmail(CK_INS, cTL(emailList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param email The collection of email as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setEmail_InScope( + String email, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(email), getCValueEmail(), "EMAIL", + "Email", "email", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param emailList The collection of email as notInScope. + */ + public void setEmail_NotInScope(Collection<String> emailList) { + regEmail(CK_NINS, cTL(emailList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setEmail_IsNull() { + regEmail(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setEmail_IsNotNull() { + regEmail(CK_ISNN, DUMMY_OBJECT); + } + + protected void regEmail(ConditionKey key, Object value) { + registerQuery(key, value, getCValueEmail(), "EMAIL", "Email", "email"); + } + + protected void registerInlineEmail(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueEmail(), "EMAIL", "Email", + "email"); + } + + abstract protected ConditionValue getCValueEmail(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param url The value of url as equal. + */ + public void setUrl_Equal(String url) { + regUrl(CK_EQ, fRES(url)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as notEqual. + */ + public void setUrl_NotEqual(String url) { + regUrl(CK_NE, fRES(url)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as greaterThan. + */ + public void setUrl_GreaterThan(String url) { + regUrl(CK_GT, fRES(url)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as lessThan. + */ + public void setUrl_LessThan(String url) { + regUrl(CK_LT, fRES(url)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as greaterEqual. + */ + public void setUrl_GreaterEqual(String url) { + regUrl(CK_GE, fRES(url)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as lessEqual. + */ + public void setUrl_LessEqual(String url) { + regUrl(CK_LE, fRES(url)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param url The value of url as prefixSearch. + */ + public void setUrl_PrefixSearch(String url) { + regUrl(CK_PS, fRES(url)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(url), getCValueUrl(), "URL", "Url", + "url", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param urlList The collection of url as inScope. + */ + public void setUrl_InScope(Collection<String> urlList) { + regUrl(CK_INS, cTL(urlList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param url The collection of url as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUrl_InScope( + String url, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(url), getCValueUrl(), "URL", "Url", + "url", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param urlList The collection of url as notInScope. + */ + public void setUrl_NotInScope(Collection<String> urlList) { + regUrl(CK_NINS, cTL(urlList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setUrl_IsNull() { + regUrl(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setUrl_IsNotNull() { + regUrl(CK_ISNN, DUMMY_OBJECT); + } + + protected void regUrl(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUrl(), "URL", "Url", "url"); + } + + protected void registerInlineUrl(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUrl(), "URL", "Url", "url"); + } + + abstract protected ConditionValue getCValueUrl(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(40)} + * + * @param telephone The value of telephone as equal. + */ + public void setTelephone_Equal(String telephone) { + regTelephone(CK_EQ, fRES(telephone)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as notEqual. + */ + public void setTelephone_NotEqual(String telephone) { + regTelephone(CK_NE, fRES(telephone)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as greaterThan. + */ + public void setTelephone_GreaterThan(String telephone) { + regTelephone(CK_GT, fRES(telephone)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as lessThan. + */ + public void setTelephone_LessThan(String telephone) { + regTelephone(CK_LT, fRES(telephone)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as greaterEqual. + */ + public void setTelephone_GreaterEqual(String telephone) { + regTelephone(CK_GE, fRES(telephone)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as lessEqual. + */ + public void setTelephone_LessEqual(String telephone) { + regTelephone(CK_LE, fRES(telephone)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param telephone The value of telephone as prefixSearch. + */ + public void setTelephone_PrefixSearch(String telephone) { + regTelephone(CK_PS, fRES(telephone)); + } + + /** + * 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.scheduler.db.allcommon.cbean.coption.LikeSearchOption likeSearchOption) { + registerLikeSearchQuery(CK_LS, fRES(telephone), getCValueTelephone(), + "TELEPHONE", "Telephone", "telephone", likeSearchOption); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephoneList The collection of telephone as inScope. + */ + public void setTelephone_InScope(Collection<String> telephoneList) { + regTelephone(CK_INS, cTL(telephoneList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephone The collection of telephone as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setTelephone_InScope( + String telephone, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(telephone), getCValueTelephone(), + "TELEPHONE", "Telephone", "telephone", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param telephoneList The collection of telephone as notInScope. + */ + public void setTelephone_NotInScope(Collection<String> telephoneList) { + regTelephone(CK_NINS, cTL(telephoneList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setTelephone_IsNull() { + regTelephone(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setTelephone_IsNotNull() { + regTelephone(CK_ISNN, DUMMY_OBJECT); + } + + protected void regTelephone(ConditionKey key, Object value) { + registerQuery(key, value, getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone"); + } + + protected void registerInlineTelephone(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueTelephone(), "TELEPHONE", + "Telephone", "telephone"); + } + + abstract protected ConditionValue getCValueTelephone(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to + * ROLE_INFO} + * + * @param roleId The value of roleId as equal. + */ + public void setRoleId_Equal(String roleId) { + regRoleId(CK_EQ, fRES(roleId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as notEqual. + */ + public void setRoleId_NotEqual(String roleId) { + regRoleId(CK_NE, fRES(roleId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as greaterThan. + */ + public void setRoleId_GreaterThan(String roleId) { + regRoleId(CK_GT, fRES(roleId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as lessThan. + */ + public void setRoleId_LessThan(String roleId) { + regRoleId(CK_LT, fRES(roleId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as greaterEqual. + */ + public void setRoleId_GreaterEqual(String roleId) { + regRoleId(CK_GE, fRES(roleId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as lessEqual. + */ + public void setRoleId_LessEqual(String roleId) { + regRoleId(CK_LE, fRES(roleId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param roleId The value of roleId as prefixSearch. + */ + public void setRoleId_PrefixSearch(String roleId) { + regRoleId(CK_PS, fRES(roleId)); + } + + /** + * 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.scheduler.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. + * + * @param roleIdList The collection of roleId as inScope. + */ + public void setRoleId_InScope(Collection<String> roleIdList) { + regRoleId(CK_INS, cTL(roleIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param roleId The collection of roleId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setRoleId_InScope( + String roleId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(roleId), getCValueRoleId(), + "ROLE_ID", "RoleId", "roleId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param roleIdList The collection of roleId as notInScope. + */ + public void setRoleId_NotInScope(Collection<String> roleIdList) { + regRoleId(CK_NINS, cTL(roleIdList)); + } + + /** + * @param roleInfoCBquery Query. + * @deprecated Please use inScopeRoleInfo(subQuery) method. + */ + 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 inScopeRoleInfo(SubQuery<RoleInfoCB> subQuery) { + assertObjectNotNull("subQuery<RoleInfoCB>", subQuery); + RoleInfoCB cb = new RoleInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepRoleId_InScopeSubQuery_RoleInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "ROLE_ID", "ROLE_ID", + subQueryPropertyName); + } + + abstract public String keepRoleId_InScopeSubQuery_RoleInfo( + jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setRoleId_IsNull() { + regRoleId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setRoleId_IsNotNull() { + regRoleId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regRoleId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId"); + } + + protected void registerInlineRoleId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueRoleId(), "ROLE_ID", "RoleId", + "roleId"); + } + + abstract protected ConditionValue getCValueRoleId(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255) : FK to + * GROUP_INFO} + * + * @param groupId The value of groupId as equal. + */ + public void setGroupId_Equal(String groupId) { + regGroupId(CK_EQ, fRES(groupId)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as notEqual. + */ + public void setGroupId_NotEqual(String groupId) { + regGroupId(CK_NE, fRES(groupId)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as greaterThan. + */ + public void setGroupId_GreaterThan(String groupId) { + regGroupId(CK_GT, fRES(groupId)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as lessThan. + */ + public void setGroupId_LessThan(String groupId) { + regGroupId(CK_LT, fRES(groupId)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as greaterEqual. + */ + public void setGroupId_GreaterEqual(String groupId) { + regGroupId(CK_GE, fRES(groupId)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as lessEqual. + */ + public void setGroupId_LessEqual(String groupId) { + regGroupId(CK_LE, fRES(groupId)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param groupId The value of groupId as prefixSearch. + */ + public void setGroupId_PrefixSearch(String groupId) { + regGroupId(CK_PS, fRES(groupId)); + } + + /** + * 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.scheduler.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. + * + * @param groupIdList The collection of groupId as inScope. + */ + public void setGroupId_InScope(Collection<String> groupIdList) { + regGroupId(CK_INS, cTL(groupIdList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param groupId The collection of groupId as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setGroupId_InScope( + String groupId, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(groupId), getCValueGroupId(), + "GROUP_ID", "GroupId", "groupId", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param groupIdList The collection of groupId as notInScope. + */ + public void setGroupId_NotInScope(Collection<String> groupIdList) { + regGroupId(CK_NINS, cTL(groupIdList)); + } + + /** + * @param groupInfoCBquery Query. + * @deprecated Please use inScopeGroupInfo(subQuery) method. + */ + 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 inScopeGroupInfo(SubQuery<GroupInfoCB> subQuery) { + assertObjectNotNull("subQuery<GroupInfoCB>", subQuery); + GroupInfoCB cb = new GroupInfoCB(); + cb.xsetupForInScopeSubQuery(); + subQuery.query(cb); + String subQueryPropertyName = keepGroupId_InScopeSubQuery_GroupInfo(cb + .query());// for saving query-value. + registerInScopeSubQuery(cb.query(), "GROUP_ID", "GROUP_ID", + subQueryPropertyName); + } + + abstract public String keepGroupId_InScopeSubQuery_GroupInfo( + jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ subQuery); + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setGroupId_IsNull() { + regGroupId(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setGroupId_IsNotNull() { + regGroupId(CK_ISNN, DUMMY_OBJECT); + } + + protected void regGroupId(ConditionKey key, Object value) { + registerQuery(key, value, getCValueGroupId(), "GROUP_ID", "GroupId", + "groupId"); + } + + protected void registerInlineGroupId(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueGroupId(), "GROUP_ID", + "GroupId", "groupId"); + } + + abstract protected ConditionValue getCValueGroupId(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param createdTime The value of createdTime as equal. + */ + public void setCreatedTime_Equal(java.sql.Timestamp createdTime) { + regCreatedTime(CK_EQ, createdTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as notEqual. + */ + public void setCreatedTime_NotEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_NE, createdTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterThan. + */ + public void setCreatedTime_GreaterThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GT, createdTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessThan. + */ + public void setCreatedTime_LessThan(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LT, createdTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as greaterEqual. + */ + public void setCreatedTime_GreaterEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_GE, createdTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param createdTime The value of createdTime as lessEqual. + */ + public void setCreatedTime_LessEqual(java.sql.Timestamp createdTime) { + regCreatedTime(CK_LE, createdTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setCreatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueCreatedTime(), + "CREATED_TIME", "CreatedTime", "createdTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of createdTime. (Nullable) + * @param toDate The to-date of createdTime. (Nullable) + */ + public void setCreatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setCreatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regCreatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + protected void registerInlineCreatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedTime(), "CREATED_TIME", + "CreatedTime", "createdTime"); + } + + abstract protected ConditionValue getCValueCreatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param createdBy The value of createdBy as equal. + */ + public void setCreatedBy_Equal(String createdBy) { + regCreatedBy(CK_EQ, fRES(createdBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as notEqual. + */ + public void setCreatedBy_NotEqual(String createdBy) { + regCreatedBy(CK_NE, fRES(createdBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterThan. + */ + public void setCreatedBy_GreaterThan(String createdBy) { + regCreatedBy(CK_GT, fRES(createdBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessThan. + */ + public void setCreatedBy_LessThan(String createdBy) { + regCreatedBy(CK_LT, fRES(createdBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as greaterEqual. + */ + public void setCreatedBy_GreaterEqual(String createdBy) { + regCreatedBy(CK_GE, fRES(createdBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as lessEqual. + */ + public void setCreatedBy_LessEqual(String createdBy) { + regCreatedBy(CK_LE, fRES(createdBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param createdBy The value of createdBy as prefixSearch. + */ + public void setCreatedBy_PrefixSearch(String createdBy) { + regCreatedBy(CK_PS, fRES(createdBy)); + } + + /** + * 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.scheduler.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. + * + * @param createdByList The collection of createdBy as inScope. + */ + public void setCreatedBy_InScope(Collection<String> createdByList) { + regCreatedBy(CK_INS, cTL(createdByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdBy The collection of createdBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setCreatedBy_InScope( + String createdBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(createdBy), getCValueCreatedBy(), + "CREATED_BY", "CreatedBy", "createdBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param createdByList The collection of createdBy as notInScope. + */ + public void setCreatedBy_NotInScope(Collection<String> createdByList) { + regCreatedBy(CK_NINS, cTL(createdByList)); + } + + protected void regCreatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + protected void registerInlineCreatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueCreatedBy(), "CREATED_BY", + "CreatedBy", "createdBy"); + } + + abstract protected ConditionValue getCValueCreatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : TIMESTAMP} + * + * @param updatedTime The value of updatedTime as equal. + */ + public void setUpdatedTime_Equal(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_EQ, updatedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as notEqual. + */ + public void setUpdatedTime_NotEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_NE, updatedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterThan. + */ + public void setUpdatedTime_GreaterThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GT, updatedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessThan. + */ + public void setUpdatedTime_LessThan(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LT, updatedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as greaterEqual. + */ + public void setUpdatedTime_GreaterEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_GE, updatedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param updatedTime The value of updatedTime as lessEqual. + */ + public void setUpdatedTime_LessEqual(java.sql.Timestamp updatedTime) { + regUpdatedTime(CK_LE, updatedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setUpdatedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueUpdatedTime(), + "UPDATED_TIME", "UpdatedTime", "updatedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {NotNull : TIMESTAMP} + * + * @param fromDate The from-date of updatedTime. (Nullable) + * @param toDate The to-date of updatedTime. (Nullable) + */ + public void setUpdatedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setUpdatedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + protected void regUpdatedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + protected void registerInlineUpdatedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedTime(), "UPDATED_TIME", + "UpdatedTime", "updatedTime"); + } + + abstract protected ConditionValue getCValueUpdatedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {NotNull : + * VARCHAR(255)} + * + * @param updatedBy The value of updatedBy as equal. + */ + public void setUpdatedBy_Equal(String updatedBy) { + regUpdatedBy(CK_EQ, fRES(updatedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as notEqual. + */ + public void setUpdatedBy_NotEqual(String updatedBy) { + regUpdatedBy(CK_NE, fRES(updatedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterThan. + */ + public void setUpdatedBy_GreaterThan(String updatedBy) { + regUpdatedBy(CK_GT, fRES(updatedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessThan. + */ + public void setUpdatedBy_LessThan(String updatedBy) { + regUpdatedBy(CK_LT, fRES(updatedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as greaterEqual. + */ + public void setUpdatedBy_GreaterEqual(String updatedBy) { + regUpdatedBy(CK_GE, fRES(updatedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as lessEqual. + */ + public void setUpdatedBy_LessEqual(String updatedBy) { + regUpdatedBy(CK_LE, fRES(updatedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param updatedBy The value of updatedBy as prefixSearch. + */ + public void setUpdatedBy_PrefixSearch(String updatedBy) { + regUpdatedBy(CK_PS, fRES(updatedBy)); + } + + /** + * 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.scheduler.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. + * + * @param updatedByList The collection of updatedBy as inScope. + */ + public void setUpdatedBy_InScope(Collection<String> updatedByList) { + regUpdatedBy(CK_INS, cTL(updatedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedBy The collection of updatedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setUpdatedBy_InScope( + String updatedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(updatedBy), getCValueUpdatedBy(), + "UPDATED_BY", "UpdatedBy", "updatedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param updatedByList The collection of updatedBy as notInScope. + */ + public void setUpdatedBy_NotInScope(Collection<String> updatedByList) { + regUpdatedBy(CK_NINS, cTL(updatedByList)); + } + + protected void regUpdatedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + protected void registerInlineUpdatedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueUpdatedBy(), "UPDATED_BY", + "UpdatedBy", "updatedBy"); + } + + abstract protected ConditionValue getCValueUpdatedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {TIMESTAMP} + * + * @param deletedTime The value of deletedTime as equal. + */ + public void setDeletedTime_Equal(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_EQ, deletedTime); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as notEqual. + */ + public void setDeletedTime_NotEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_NE, deletedTime); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterThan. + */ + public void setDeletedTime_GreaterThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GT, deletedTime); + } + + /** + * LessThan(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessThan. + */ + public void setDeletedTime_LessThan(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LT, deletedTime); + } + + /** + * GreaterEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as greaterEqual. + */ + public void setDeletedTime_GreaterEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_GE, deletedTime); + } + + /** + * LessEqual(>). And NullIgnored, OnceRegistered. + * + * @param deletedTime The value of deletedTime as lessEqual. + */ + public void setDeletedTime_LessEqual(java.sql.Timestamp deletedTime) { + regDeletedTime(CK_LE, deletedTime); + } + + /** + * FromTo($fromDate <= COLUMN_NAME <= $toDate). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + * @param fromToOption The option of from-to. (NotNull) + */ + public void setDeletedTime_FromTo( + java.util.Date fromDate, + java.util.Date toDate, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.FromToOption fromToOption) { + registerFromToQuery((fromDate != null ? new java.sql.Timestamp(fromDate + .getTime()) : null), (toDate != null ? new java.sql.Timestamp( + toDate.getTime()) : null), getCValueDeletedTime(), + "DELETED_TIME", "DeletedTime", "deletedTime", fromToOption); + } + + /** + * FromTo($fromDate <= COLUMN_NAME < $toDate + 1). And NullIgnored, + * OnceRegistered. {TIMESTAMP} + * + * @param fromDate The from-date of deletedTime. (Nullable) + * @param toDate The to-date of deletedTime. (Nullable) + */ + public void setDeletedTime_DateFromTo(java.util.Date fromDate, + java.util.Date toDate) { + setDeletedTime_FromTo( + fromDate, + toDate, + new jp.sf.pal.scheduler.db.allcommon.cbean.coption.DateFromToOption()); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedTime_IsNull() { + regDeletedTime(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedTime_IsNotNull() { + regDeletedTime(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedTime(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + protected void registerInlineDeletedTime(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedTime(), "DELETED_TIME", + "DeletedTime", "deletedTime"); + } + + abstract protected ConditionValue getCValueDeletedTime(); + + /** + * Equal(=). And NullOrEmptyIgnored, OnceRegistered. {VARCHAR(255)} + * + * @param deletedBy The value of deletedBy as equal. + */ + public void setDeletedBy_Equal(String deletedBy) { + regDeletedBy(CK_EQ, fRES(deletedBy)); + } + + /** + * NotEqual(!=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as notEqual. + */ + public void setDeletedBy_NotEqual(String deletedBy) { + regDeletedBy(CK_NE, fRES(deletedBy)); + } + + /** + * GreaterThan(>). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterThan. + */ + public void setDeletedBy_GreaterThan(String deletedBy) { + regDeletedBy(CK_GT, fRES(deletedBy)); + } + + /** + * LessThan(<). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessThan. + */ + public void setDeletedBy_LessThan(String deletedBy) { + regDeletedBy(CK_LT, fRES(deletedBy)); + } + + /** + * GreaterEqual(>=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as greaterEqual. + */ + public void setDeletedBy_GreaterEqual(String deletedBy) { + regDeletedBy(CK_GE, fRES(deletedBy)); + } + + /** + * LessEqual(<=). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as lessEqual. + */ + public void setDeletedBy_LessEqual(String deletedBy) { + regDeletedBy(CK_LE, fRES(deletedBy)); + } + + /** + * PrefixSearch(like 'xxx%'). And NullOrEmptyIgnored, OnceRegistered. + * + * @param deletedBy The value of deletedBy as prefixSearch. + */ + public void setDeletedBy_PrefixSearch(String deletedBy) { + regDeletedBy(CK_PS, fRES(deletedBy)); + } + + /** + * 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.scheduler.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. + * + * @param deletedByList The collection of deletedBy as inScope. + */ + public void setDeletedBy_InScope(Collection<String> deletedByList) { + regDeletedBy(CK_INS, cTL(deletedByList)); + } + + /** + * InScope(in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedBy The collection of deletedBy as inScope. + * @param inScopeOption The option of in-scope. (NotNull) + */ + public void setDeletedBy_InScope( + String deletedBy, + jp.sf.pal.scheduler.db.allcommon.cbean.coption.InScopeOption inScopeOption) { + registerInScopeQuery(CK_INS, fRES(deletedBy), getCValueDeletedBy(), + "DELETED_BY", "DeletedBy", "deletedBy", inScopeOption); + } + + /** + * NotInScope(not in ('a', 'b')). And NullOrEmptyIgnored, + * NullOrEmptyElementIgnored, SeveralRegistered. + * + * @param deletedByList The collection of deletedBy as notInScope. + */ + public void setDeletedBy_NotInScope(Collection<String> deletedByList) { + regDeletedBy(CK_NINS, cTL(deletedByList)); + } + + /** + * IsNull(is null). And OnceRegistered. + */ + public void setDeletedBy_IsNull() { + regDeletedBy(CK_ISN, DUMMY_OBJECT); + } + + /** + * IsNotNull(is not null). And OnceRegistered. + */ + public void setDeletedBy_IsNotNull() { + regDeletedBy(CK_ISNN, DUMMY_OBJECT); + } + + protected void regDeletedBy(ConditionKey key, Object value) { + registerQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + protected void registerInlineDeletedBy(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueDeletedBy(), "DELETED_BY", + "DeletedBy", "deletedBy"); + } + + abstract protected ConditionValue getCValueDeletedBy(); + + /** + * Equal(=). And NullIgnored, OnceRegistered. {NotNull : INTEGER} + * + * @param versionno The value of versionno as equal. + */ + public void setVersionno_Equal(Integer versionno) { + regVersionno(CK_EQ, versionno); + } + + /** + * NotEqual(!=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as notEqual. + */ + public void setVersionno_NotEqual(Integer versionno) { + regVersionno(CK_NE, versionno); + } + + /** + * GreaterThan(>). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterThan. + */ + public void setVersionno_GreaterThan(Integer versionno) { + regVersionno(CK_GT, versionno); + } + + /** + * LessThan(<). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessThan. + */ + public void setVersionno_LessThan(Integer versionno) { + regVersionno(CK_LT, versionno); + } + + /** + * GreaterEqual(>=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as greaterEqual. + */ + public void setVersionno_GreaterEqual(Integer versionno) { + regVersionno(CK_GE, versionno); + } + + /** + * LessEqual(<=). And NullIgnored, OnceRegistered. + * + * @param versionno The value of versionno as lessEqual. + */ + public void setVersionno_LessEqual(Integer versionno) { + regVersionno(CK_LE, versionno); + } + + /** + * InScope(in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as inScope. + */ + public void setVersionno_InScope(Collection<Integer> versionnoList) { + regVersionno(CK_INS, cTL(versionnoList)); + } + + /** + * NotInScope(not in (1, 2)). And NullIgnored, NullElementIgnored, + * SeveralRegistered. + * + * @param versionnoList The collection of versionno as notInScope. + */ + public void setVersionno_NotInScope(Collection<Integer> versionnoList) { + regVersionno(CK_NINS, cTL(versionnoList)); + } + + protected void regVersionno(ConditionKey key, Object value) { + registerQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + protected void registerInlineVersionno(ConditionKey key, Object value) { + registerInlineQuery(key, value, getCValueVersionno(), "VERSIONNO", + "Versionno", "versionno"); + } + + abstract protected ConditionValue getCValueVersionno(); + + // Very Internal (for Suppressing Warn about 'Not Use Import') + protected String getConditionBeanClassNameInternally() { + return UserInfoCB.class.getName(); + } + + protected String getConditionQueryClassNameInternally() { + return UserInfoCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/AbstractBsUserInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,575 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.GroupInfoCIQ; + +/** + * The base condition-query of GROUP_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsGroupInfoCQ extends AbstractBsGroupInfoCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected GroupInfoCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsGroupInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from GROUP_INFO) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public GroupInfoCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new GroupInfoCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * GROUP_INFO on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public GroupInfoCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + GroupInfoCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _groupId; + + public ConditionValue getGroupId() { + if (_groupId == null) { + _groupId = new ConditionValue(); + } + return _groupId; + } + + protected ConditionValue getCValueGroupId() { + return getGroupId(); + } + + protected Map<String, GroupMappingCQ> _groupId_InScopeSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getGroupId_InScopeSubQuery_GroupMappingList() { + return _groupId_InScopeSubQuery_GroupMappingListMap; + } + + public String keepGroupId_InScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_groupId_InScopeSubQuery_GroupMappingListMap == null) { + _groupId_InScopeSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_InScopeSubQuery_GroupMappingListMap.size() + 1); + _groupId_InScopeSubQuery_GroupMappingListMap.put(key, subQuery); + return "groupId_InScopeSubQuery_GroupMappingList." + key; + } + + protected Map<String, UserInfoCQ> _groupId_InScopeSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getGroupId_InScopeSubQuery_UserInfoList() { + return _groupId_InScopeSubQuery_UserInfoListMap; + } + + public String keepGroupId_InScopeSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_InScopeSubQuery_UserInfoListMap == null) { + _groupId_InScopeSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_InScopeSubQuery_UserInfoListMap.size() + 1); + _groupId_InScopeSubQuery_UserInfoListMap.put(key, subQuery); + return "groupId_InScopeSubQuery_UserInfoList." + key; + } + + protected Map<String, GroupMappingCQ> _groupId_NotInScopeSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getGroupId_NotInScopeSubQuery_GroupMappingList() { + return _groupId_NotInScopeSubQuery_GroupMappingListMap; + } + + public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_groupId_NotInScopeSubQuery_GroupMappingListMap == null) { + _groupId_NotInScopeSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_NotInScopeSubQuery_GroupMappingListMap.size() + 1); + _groupId_NotInScopeSubQuery_GroupMappingListMap.put(key, subQuery); + return "groupId_NotInScopeSubQuery_GroupMappingList." + key; + } + + protected Map<String, UserInfoCQ> _groupId_NotInScopeSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getGroupId_NotInScopeSubQuery_UserInfoList() { + return _groupId_NotInScopeSubQuery_UserInfoListMap; + } + + public String keepGroupId_NotInScopeSubQuery_UserInfoList( + UserInfoCQ subQuery) { + if (_groupId_NotInScopeSubQuery_UserInfoListMap == null) { + _groupId_NotInScopeSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_NotInScopeSubQuery_UserInfoListMap.size() + 1); + _groupId_NotInScopeSubQuery_UserInfoListMap.put(key, subQuery); + return "groupId_NotInScopeSubQuery_UserInfoList." + key; + } + + protected Map<String, GroupMappingCQ> _groupId_ExistsSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getGroupId_ExistsSubQuery_GroupMappingList() { + return _groupId_ExistsSubQuery_GroupMappingListMap; + } + + public String keepGroupId_ExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_groupId_ExistsSubQuery_GroupMappingListMap == null) { + _groupId_ExistsSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_ExistsSubQuery_GroupMappingListMap.size() + 1); + _groupId_ExistsSubQuery_GroupMappingListMap.put(key, subQuery); + return "groupId_ExistsSubQuery_GroupMappingList." + key; + } + + protected Map<String, UserInfoCQ> _groupId_ExistsSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getGroupId_ExistsSubQuery_UserInfoList() { + return _groupId_ExistsSubQuery_UserInfoListMap; + } + + public String keepGroupId_ExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_ExistsSubQuery_UserInfoListMap == null) { + _groupId_ExistsSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_ExistsSubQuery_UserInfoListMap.size() + 1); + _groupId_ExistsSubQuery_UserInfoListMap.put(key, subQuery); + return "groupId_ExistsSubQuery_UserInfoList." + key; + } + + protected Map<String, GroupMappingCQ> _groupId_NotExistsSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getGroupId_NotExistsSubQuery_GroupMappingList() { + return _groupId_NotExistsSubQuery_GroupMappingListMap; + } + + public String keepGroupId_NotExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_groupId_NotExistsSubQuery_GroupMappingListMap == null) { + _groupId_NotExistsSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_NotExistsSubQuery_GroupMappingListMap.size() + 1); + _groupId_NotExistsSubQuery_GroupMappingListMap.put(key, subQuery); + return "groupId_NotExistsSubQuery_GroupMappingList." + key; + } + + protected Map<String, UserInfoCQ> _groupId_NotExistsSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getGroupId_NotExistsSubQuery_UserInfoList() { + return _groupId_NotExistsSubQuery_UserInfoListMap; + } + + public String keepGroupId_NotExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_NotExistsSubQuery_UserInfoListMap == null) { + _groupId_NotExistsSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_NotExistsSubQuery_UserInfoListMap.size() + 1); + _groupId_NotExistsSubQuery_UserInfoListMap.put(key, subQuery); + return "groupId_NotExistsSubQuery_UserInfoList." + key; + } + + protected Map<String, GroupMappingCQ> _groupId_DeriveSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getGroupId_DeriveSubQuery_GroupMappingList() { + return _groupId_DeriveSubQuery_GroupMappingListMap; + } + + public String keepGroupId_DeriveSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_groupId_DeriveSubQuery_GroupMappingListMap == null) { + _groupId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_DeriveSubQuery_GroupMappingListMap.size() + 1); + _groupId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); + return "groupId_DeriveSubQuery_GroupMappingList." + key; + } + + protected Map<String, UserInfoCQ> _groupId_DeriveSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getGroupId_DeriveSubQuery_UserInfoList() { + return _groupId_DeriveSubQuery_UserInfoListMap; + } + + public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_groupId_DeriveSubQuery_UserInfoListMap == null) { + _groupId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_DeriveSubQuery_UserInfoListMap.size() + 1); + _groupId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); + return "groupId_DeriveSubQuery_UserInfoList." + key; + } + + public BsGroupInfoCQ addOrderBy_GroupId_Asc() { + regOBA("GROUP_ID"); + return this; + } + + public BsGroupInfoCQ addOrderBy_GroupId_Desc() { + regOBD("GROUP_ID"); + return this; + } + + protected ConditionValue _name; + + public ConditionValue getName() { + if (_name == null) { + _name = new ConditionValue(); + } + return _name; + } + + protected ConditionValue getCValueName() { + return getName(); + } + + public BsGroupInfoCQ addOrderBy_Name_Asc() { + regOBA("NAME"); + return this; + } + + public BsGroupInfoCQ addOrderBy_Name_Desc() { + regOBD("NAME"); + return this; + } + + protected ConditionValue _description; + + public ConditionValue getDescription() { + if (_description == null) { + _description = new ConditionValue(); + } + return _description; + } + + protected ConditionValue getCValueDescription() { + return getDescription(); + } + + public BsGroupInfoCQ addOrderBy_Description_Asc() { + regOBA("DESCRIPTION"); + return this; + } + + public BsGroupInfoCQ addOrderBy_Description_Desc() { + regOBD("DESCRIPTION"); + return this; + } + + protected ConditionValue _email; + + public ConditionValue getEmail() { + if (_email == null) { + _email = new ConditionValue(); + } + return _email; + } + + protected ConditionValue getCValueEmail() { + return getEmail(); + } + + public BsGroupInfoCQ addOrderBy_Email_Asc() { + regOBA("EMAIL"); + return this; + } + + public BsGroupInfoCQ addOrderBy_Email_Desc() { + regOBD("EMAIL"); + return this; + } + + protected ConditionValue _url; + + public ConditionValue getUrl() { + if (_url == null) { + _url = new ConditionValue(); + } + return _url; + } + + protected ConditionValue getCValueUrl() { + return getUrl(); + } + + public BsGroupInfoCQ addOrderBy_Url_Asc() { + regOBA("URL"); + return this; + } + + public BsGroupInfoCQ addOrderBy_Url_Desc() { + regOBD("URL"); + return this; + } + + protected ConditionValue _telephone; + + public ConditionValue getTelephone() { + if (_telephone == null) { + _telephone = new ConditionValue(); + } + return _telephone; + } + + protected ConditionValue getCValueTelephone() { + return getTelephone(); + } + + public BsGroupInfoCQ addOrderBy_Telephone_Asc() { + regOBA("TELEPHONE"); + return this; + } + + public BsGroupInfoCQ addOrderBy_Telephone_Desc() { + regOBD("TELEPHONE"); + return this; + } + + protected ConditionValue _createdTime; + + public ConditionValue getCreatedTime() { + if (_createdTime == null) { + _createdTime = new ConditionValue(); + } + return _createdTime; + } + + protected ConditionValue getCValueCreatedTime() { + return getCreatedTime(); + } + + public BsGroupInfoCQ addOrderBy_CreatedTime_Asc() { + regOBA("CREATED_TIME"); + return this; + } + + public BsGroupInfoCQ addOrderBy_CreatedTime_Desc() { + regOBD("CREATED_TIME"); + return this; + } + + protected ConditionValue _createdBy; + + public ConditionValue getCreatedBy() { + if (_createdBy == null) { + _createdBy = new ConditionValue(); + } + return _createdBy; + } + + protected ConditionValue getCValueCreatedBy() { + return getCreatedBy(); + } + + public BsGroupInfoCQ addOrderBy_CreatedBy_Asc() { + regOBA("CREATED_BY"); + return this; + } + + public BsGroupInfoCQ addOrderBy_CreatedBy_Desc() { + regOBD("CREATED_BY"); + return this; + } + + protected ConditionValue _updatedTime; + + public ConditionValue getUpdatedTime() { + if (_updatedTime == null) { + _updatedTime = new ConditionValue(); + } + return _updatedTime; + } + + protected ConditionValue getCValueUpdatedTime() { + return getUpdatedTime(); + } + + public BsGroupInfoCQ addOrderBy_UpdatedTime_Asc() { + regOBA("UPDATED_TIME"); + return this; + } + + public BsGroupInfoCQ addOrderBy_UpdatedTime_Desc() { + regOBD("UPDATED_TIME"); + return this; + } + + protected ConditionValue _updatedBy; + + public ConditionValue getUpdatedBy() { + if (_updatedBy == null) { + _updatedBy = new ConditionValue(); + } + return _updatedBy; + } + + protected ConditionValue getCValueUpdatedBy() { + return getUpdatedBy(); + } + + public BsGroupInfoCQ addOrderBy_UpdatedBy_Asc() { + regOBA("UPDATED_BY"); + return this; + } + + public BsGroupInfoCQ addOrderBy_UpdatedBy_Desc() { + regOBD("UPDATED_BY"); + return this; + } + + protected ConditionValue _deletedTime; + + public ConditionValue getDeletedTime() { + if (_deletedTime == null) { + _deletedTime = new ConditionValue(); + } + return _deletedTime; + } + + protected ConditionValue getCValueDeletedTime() { + return getDeletedTime(); + } + + public BsGroupInfoCQ addOrderBy_DeletedTime_Asc() { + regOBA("DELETED_TIME"); + return this; + } + + public BsGroupInfoCQ addOrderBy_DeletedTime_Desc() { + regOBD("DELETED_TIME"); + return this; + } + + protected ConditionValue _deletedBy; + + public ConditionValue getDeletedBy() { + if (_deletedBy == null) { + _deletedBy = new ConditionValue(); + } + return _deletedBy; + } + + protected ConditionValue getCValueDeletedBy() { + return getDeletedBy(); + } + + public BsGroupInfoCQ addOrderBy_DeletedBy_Asc() { + regOBA("DELETED_BY"); + return this; + } + + public BsGroupInfoCQ addOrderBy_DeletedBy_Desc() { + regOBD("DELETED_BY"); + return this; + } + + protected ConditionValue _versionno; + + public ConditionValue getVersionno() { + if (_versionno == null) { + _versionno = new ConditionValue(); + } + return _versionno; + } + + protected ConditionValue getCValueVersionno() { + return getVersionno(); + } + + public BsGroupInfoCQ addOrderBy_Versionno_Asc() { + regOBA("VERSIONNO"); + return this; + } + + public BsGroupInfoCQ addOrderBy_Versionno_Desc() { + regOBD("VERSIONNO"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsGroupInfoCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsGroupInfoCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + protected String getConditionQueryClassNameInternally() { + return GroupInfoCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,291 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.GroupMappingCIQ; + +/** + * The base condition-query of GROUP_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsGroupMappingCQ extends AbstractBsGroupMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected GroupMappingCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsGroupMappingCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from GROUP_MAPPING) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public GroupMappingCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new GroupMappingCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * GROUP_MAPPING on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public GroupMappingCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + GroupMappingCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + public BsGroupMappingCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsGroupMappingCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _userId; + + public ConditionValue getUserId() { + if (_userId == null) { + _userId = new ConditionValue(); + } + return _userId; + } + + protected ConditionValue getCValueUserId() { + return getUserId(); + } + + protected Map<String, UserInfoCQ> _userId_InScopeSubQuery_UserInfoMap; + + public Map<String, UserInfoCQ> getUserId_InScopeSubQuery_UserInfo() { + return _userId_InScopeSubQuery_UserInfoMap; + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + if (_userId_InScopeSubQuery_UserInfoMap == null) { + _userId_InScopeSubQuery_UserInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_UserInfoMap.size() + 1); + _userId_InScopeSubQuery_UserInfoMap.put(key, subQuery); + return "userId_InScopeSubQuery_UserInfo." + key; + } + + public BsGroupMappingCQ addOrderBy_UserId_Asc() { + regOBA("USER_ID"); + return this; + } + + public BsGroupMappingCQ addOrderBy_UserId_Desc() { + regOBD("USER_ID"); + return this; + } + + protected ConditionValue _groupId; + + public ConditionValue getGroupId() { + if (_groupId == null) { + _groupId = new ConditionValue(); + } + return _groupId; + } + + protected ConditionValue getCValueGroupId() { + return getGroupId(); + } + + protected Map<String, GroupInfoCQ> _groupId_InScopeSubQuery_GroupInfoMap; + + public Map<String, GroupInfoCQ> getGroupId_InScopeSubQuery_GroupInfo() { + return _groupId_InScopeSubQuery_GroupInfoMap; + } + + public String keepGroupId_InScopeSubQuery_GroupInfo(GroupInfoCQ subQuery) { + if (_groupId_InScopeSubQuery_GroupInfoMap == null) { + _groupId_InScopeSubQuery_GroupInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_InScopeSubQuery_GroupInfoMap.size() + 1); + _groupId_InScopeSubQuery_GroupInfoMap.put(key, subQuery); + return "groupId_InScopeSubQuery_GroupInfo." + key; + } + + public BsGroupMappingCQ addOrderBy_GroupId_Asc() { + regOBA("GROUP_ID"); + return this; + } + + public BsGroupMappingCQ addOrderBy_GroupId_Desc() { + regOBD("GROUP_ID"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsGroupMappingCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsGroupMappingCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + GroupMappingCQ baseQuery = (GroupMappingCQ) baseQueryAsSuper; + GroupMappingCQ unionQuery = (GroupMappingCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryGroupInfo()) { + unionQuery.queryGroupInfo().reflectRelationOnUnionQuery( + baseQuery.queryGroupInfo(), unionQuery.queryGroupInfo()); + } + if (baseQuery.hasConditionQueryUserInfo()) { + unionQuery.queryUserInfo().reflectRelationOnUnionQuery( + baseQuery.queryUserInfo(), unionQuery.queryUserInfo()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public GroupInfoCQ queryGroupInfo() { + return getConditionQueryGroupInfo(); + } + + protected GroupInfoCQ _conditionQueryGroupInfo; + + public GroupInfoCQ getConditionQueryGroupInfo() { + if (_conditionQueryGroupInfo == null) { + _conditionQueryGroupInfo = createQueryGroupInfo(); + setupOuterJoin_GroupInfo(); + } + 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() { + String nrp = resolveNextRelationPath("GROUP_MAPPING", "groupInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("groupInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryGroupInfo() { + return _conditionQueryGroupInfo != null; + } + + public UserInfoCQ queryUserInfo() { + return getConditionQueryUserInfo(); + } + + protected UserInfoCQ _conditionQueryUserInfo; + + public UserInfoCQ getConditionQueryUserInfo() { + if (_conditionQueryUserInfo == null) { + _conditionQueryUserInfo = createQueryUserInfo(); + setupOuterJoin_UserInfo(); + } + 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() { + String nrp = resolveNextRelationPath("GROUP_MAPPING", "userInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("userInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryUserInfo() { + return _conditionQueryUserInfo != null; + } + + protected String getConditionQueryClassNameInternally() { + return GroupMappingCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsGroupMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,574 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.RoleInfoCIQ; + +/** + * The base condition-query of ROLE_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoleInfoCQ extends AbstractBsRoleInfoCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoleInfoCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoleInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from ROLE_INFO) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public RoleInfoCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new RoleInfoCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * ROLE_INFO on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public RoleInfoCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + RoleInfoCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _roleId; + + public ConditionValue getRoleId() { + if (_roleId == null) { + _roleId = new ConditionValue(); + } + return _roleId; + } + + protected ConditionValue getCValueRoleId() { + return getRoleId(); + } + + protected Map<String, RoleMappingCQ> _roleId_InScopeSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getRoleId_InScopeSubQuery_RoleMappingList() { + return _roleId_InScopeSubQuery_RoleMappingListMap; + } + + public String keepRoleId_InScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_roleId_InScopeSubQuery_RoleMappingListMap == null) { + _roleId_InScopeSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_InScopeSubQuery_RoleMappingListMap.size() + 1); + _roleId_InScopeSubQuery_RoleMappingListMap.put(key, subQuery); + return "roleId_InScopeSubQuery_RoleMappingList." + key; + } + + protected Map<String, UserInfoCQ> _roleId_InScopeSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getRoleId_InScopeSubQuery_UserInfoList() { + return _roleId_InScopeSubQuery_UserInfoListMap; + } + + public String keepRoleId_InScopeSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_InScopeSubQuery_UserInfoListMap == null) { + _roleId_InScopeSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_InScopeSubQuery_UserInfoListMap.size() + 1); + _roleId_InScopeSubQuery_UserInfoListMap.put(key, subQuery); + return "roleId_InScopeSubQuery_UserInfoList." + key; + } + + protected Map<String, RoleMappingCQ> _roleId_NotInScopeSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getRoleId_NotInScopeSubQuery_RoleMappingList() { + return _roleId_NotInScopeSubQuery_RoleMappingListMap; + } + + public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_roleId_NotInScopeSubQuery_RoleMappingListMap == null) { + _roleId_NotInScopeSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_NotInScopeSubQuery_RoleMappingListMap.size() + 1); + _roleId_NotInScopeSubQuery_RoleMappingListMap.put(key, subQuery); + return "roleId_NotInScopeSubQuery_RoleMappingList." + key; + } + + protected Map<String, UserInfoCQ> _roleId_NotInScopeSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getRoleId_NotInScopeSubQuery_UserInfoList() { + return _roleId_NotInScopeSubQuery_UserInfoListMap; + } + + public String keepRoleId_NotInScopeSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_NotInScopeSubQuery_UserInfoListMap == null) { + _roleId_NotInScopeSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_NotInScopeSubQuery_UserInfoListMap.size() + 1); + _roleId_NotInScopeSubQuery_UserInfoListMap.put(key, subQuery); + return "roleId_NotInScopeSubQuery_UserInfoList." + key; + } + + protected Map<String, RoleMappingCQ> _roleId_ExistsSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getRoleId_ExistsSubQuery_RoleMappingList() { + return _roleId_ExistsSubQuery_RoleMappingListMap; + } + + public String keepRoleId_ExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_roleId_ExistsSubQuery_RoleMappingListMap == null) { + _roleId_ExistsSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_ExistsSubQuery_RoleMappingListMap.size() + 1); + _roleId_ExistsSubQuery_RoleMappingListMap.put(key, subQuery); + return "roleId_ExistsSubQuery_RoleMappingList." + key; + } + + protected Map<String, UserInfoCQ> _roleId_ExistsSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getRoleId_ExistsSubQuery_UserInfoList() { + return _roleId_ExistsSubQuery_UserInfoListMap; + } + + public String keepRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_ExistsSubQuery_UserInfoListMap == null) { + _roleId_ExistsSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_ExistsSubQuery_UserInfoListMap.size() + 1); + _roleId_ExistsSubQuery_UserInfoListMap.put(key, subQuery); + return "roleId_ExistsSubQuery_UserInfoList." + key; + } + + protected Map<String, RoleMappingCQ> _roleId_NotExistsSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getRoleId_NotExistsSubQuery_RoleMappingList() { + return _roleId_NotExistsSubQuery_RoleMappingListMap; + } + + public String keepRoleId_NotExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_roleId_NotExistsSubQuery_RoleMappingListMap == null) { + _roleId_NotExistsSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_NotExistsSubQuery_RoleMappingListMap.size() + 1); + _roleId_NotExistsSubQuery_RoleMappingListMap.put(key, subQuery); + return "roleId_NotExistsSubQuery_RoleMappingList." + key; + } + + protected Map<String, UserInfoCQ> _roleId_NotExistsSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getRoleId_NotExistsSubQuery_UserInfoList() { + return _roleId_NotExistsSubQuery_UserInfoListMap; + } + + public String keepRoleId_NotExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_NotExistsSubQuery_UserInfoListMap == null) { + _roleId_NotExistsSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_NotExistsSubQuery_UserInfoListMap.size() + 1); + _roleId_NotExistsSubQuery_UserInfoListMap.put(key, subQuery); + return "roleId_NotExistsSubQuery_UserInfoList." + key; + } + + protected Map<String, RoleMappingCQ> _roleId_DeriveSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getRoleId_DeriveSubQuery_RoleMappingList() { + return _roleId_DeriveSubQuery_RoleMappingListMap; + } + + public String keepRoleId_DeriveSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_roleId_DeriveSubQuery_RoleMappingListMap == null) { + _roleId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_DeriveSubQuery_RoleMappingListMap.size() + 1); + _roleId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); + return "roleId_DeriveSubQuery_RoleMappingList." + key; + } + + protected Map<String, UserInfoCQ> _roleId_DeriveSubQuery_UserInfoListMap; + + public Map<String, UserInfoCQ> getRoleId_DeriveSubQuery_UserInfoList() { + return _roleId_DeriveSubQuery_UserInfoListMap; + } + + public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + if (_roleId_DeriveSubQuery_UserInfoListMap == null) { + _roleId_DeriveSubQuery_UserInfoListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_DeriveSubQuery_UserInfoListMap.size() + 1); + _roleId_DeriveSubQuery_UserInfoListMap.put(key, subQuery); + return "roleId_DeriveSubQuery_UserInfoList." + key; + } + + public BsRoleInfoCQ addOrderBy_RoleId_Asc() { + regOBA("ROLE_ID"); + return this; + } + + public BsRoleInfoCQ addOrderBy_RoleId_Desc() { + regOBD("ROLE_ID"); + return this; + } + + protected ConditionValue _name; + + public ConditionValue getName() { + if (_name == null) { + _name = new ConditionValue(); + } + return _name; + } + + protected ConditionValue getCValueName() { + return getName(); + } + + public BsRoleInfoCQ addOrderBy_Name_Asc() { + regOBA("NAME"); + return this; + } + + public BsRoleInfoCQ addOrderBy_Name_Desc() { + regOBD("NAME"); + return this; + } + + protected ConditionValue _description; + + public ConditionValue getDescription() { + if (_description == null) { + _description = new ConditionValue(); + } + return _description; + } + + protected ConditionValue getCValueDescription() { + return getDescription(); + } + + public BsRoleInfoCQ addOrderBy_Description_Asc() { + regOBA("DESCRIPTION"); + return this; + } + + public BsRoleInfoCQ addOrderBy_Description_Desc() { + regOBD("DESCRIPTION"); + return this; + } + + protected ConditionValue _email; + + public ConditionValue getEmail() { + if (_email == null) { + _email = new ConditionValue(); + } + return _email; + } + + protected ConditionValue getCValueEmail() { + return getEmail(); + } + + public BsRoleInfoCQ addOrderBy_Email_Asc() { + regOBA("EMAIL"); + return this; + } + + public BsRoleInfoCQ addOrderBy_Email_Desc() { + regOBD("EMAIL"); + return this; + } + + protected ConditionValue _url; + + public ConditionValue getUrl() { + if (_url == null) { + _url = new ConditionValue(); + } + return _url; + } + + protected ConditionValue getCValueUrl() { + return getUrl(); + } + + public BsRoleInfoCQ addOrderBy_Url_Asc() { + regOBA("URL"); + return this; + } + + public BsRoleInfoCQ addOrderBy_Url_Desc() { + regOBD("URL"); + return this; + } + + protected ConditionValue _telephone; + + public ConditionValue getTelephone() { + if (_telephone == null) { + _telephone = new ConditionValue(); + } + return _telephone; + } + + protected ConditionValue getCValueTelephone() { + return getTelephone(); + } + + public BsRoleInfoCQ addOrderBy_Telephone_Asc() { + regOBA("TELEPHONE"); + return this; + } + + public BsRoleInfoCQ addOrderBy_Telephone_Desc() { + regOBD("TELEPHONE"); + return this; + } + + protected ConditionValue _createdTime; + + public ConditionValue getCreatedTime() { + if (_createdTime == null) { + _createdTime = new ConditionValue(); + } + return _createdTime; + } + + protected ConditionValue getCValueCreatedTime() { + return getCreatedTime(); + } + + public BsRoleInfoCQ addOrderBy_CreatedTime_Asc() { + regOBA("CREATED_TIME"); + return this; + } + + public BsRoleInfoCQ addOrderBy_CreatedTime_Desc() { + regOBD("CREATED_TIME"); + return this; + } + + protected ConditionValue _createdBy; + + public ConditionValue getCreatedBy() { + if (_createdBy == null) { + _createdBy = new ConditionValue(); + } + return _createdBy; + } + + protected ConditionValue getCValueCreatedBy() { + return getCreatedBy(); + } + + public BsRoleInfoCQ addOrderBy_CreatedBy_Asc() { + regOBA("CREATED_BY"); + return this; + } + + public BsRoleInfoCQ addOrderBy_CreatedBy_Desc() { + regOBD("CREATED_BY"); + return this; + } + + protected ConditionValue _updatedTime; + + public ConditionValue getUpdatedTime() { + if (_updatedTime == null) { + _updatedTime = new ConditionValue(); + } + return _updatedTime; + } + + protected ConditionValue getCValueUpdatedTime() { + return getUpdatedTime(); + } + + public BsRoleInfoCQ addOrderBy_UpdatedTime_Asc() { + regOBA("UPDATED_TIME"); + return this; + } + + public BsRoleInfoCQ addOrderBy_UpdatedTime_Desc() { + regOBD("UPDATED_TIME"); + return this; + } + + protected ConditionValue _updatedBy; + + public ConditionValue getUpdatedBy() { + if (_updatedBy == null) { + _updatedBy = new ConditionValue(); + } + return _updatedBy; + } + + protected ConditionValue getCValueUpdatedBy() { + return getUpdatedBy(); + } + + public BsRoleInfoCQ addOrderBy_UpdatedBy_Asc() { + regOBA("UPDATED_BY"); + return this; + } + + public BsRoleInfoCQ addOrderBy_UpdatedBy_Desc() { + regOBD("UPDATED_BY"); + return this; + } + + protected ConditionValue _deletedTime; + + public ConditionValue getDeletedTime() { + if (_deletedTime == null) { + _deletedTime = new ConditionValue(); + } + return _deletedTime; + } + + protected ConditionValue getCValueDeletedTime() { + return getDeletedTime(); + } + + public BsRoleInfoCQ addOrderBy_DeletedTime_Asc() { + regOBA("DELETED_TIME"); + return this; + } + + public BsRoleInfoCQ addOrderBy_DeletedTime_Desc() { + regOBD("DELETED_TIME"); + return this; + } + + protected ConditionValue _deletedBy; + + public ConditionValue getDeletedBy() { + if (_deletedBy == null) { + _deletedBy = new ConditionValue(); + } + return _deletedBy; + } + + protected ConditionValue getCValueDeletedBy() { + return getDeletedBy(); + } + + public BsRoleInfoCQ addOrderBy_DeletedBy_Asc() { + regOBA("DELETED_BY"); + return this; + } + + public BsRoleInfoCQ addOrderBy_DeletedBy_Desc() { + regOBD("DELETED_BY"); + return this; + } + + protected ConditionValue _versionno; + + public ConditionValue getVersionno() { + if (_versionno == null) { + _versionno = new ConditionValue(); + } + return _versionno; + } + + protected ConditionValue getCValueVersionno() { + return getVersionno(); + } + + public BsRoleInfoCQ addOrderBy_Versionno_Asc() { + regOBA("VERSIONNO"); + return this; + } + + public BsRoleInfoCQ addOrderBy_Versionno_Desc() { + regOBD("VERSIONNO"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsRoleInfoCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsRoleInfoCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + protected String getConditionQueryClassNameInternally() { + return RoleInfoCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,291 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.RoleMappingCIQ; + +/** + * The base condition-query of ROLE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoleMappingCQ extends AbstractBsRoleMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoleMappingCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoleMappingCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from ROLE_MAPPING) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public RoleMappingCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new RoleMappingCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * ROLE_MAPPING on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public RoleMappingCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + RoleMappingCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + public BsRoleMappingCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsRoleMappingCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _userId; + + public ConditionValue getUserId() { + if (_userId == null) { + _userId = new ConditionValue(); + } + return _userId; + } + + protected ConditionValue getCValueUserId() { + return getUserId(); + } + + protected Map<String, UserInfoCQ> _userId_InScopeSubQuery_UserInfoMap; + + public Map<String, UserInfoCQ> getUserId_InScopeSubQuery_UserInfo() { + return _userId_InScopeSubQuery_UserInfoMap; + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + if (_userId_InScopeSubQuery_UserInfoMap == null) { + _userId_InScopeSubQuery_UserInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_UserInfoMap.size() + 1); + _userId_InScopeSubQuery_UserInfoMap.put(key, subQuery); + return "userId_InScopeSubQuery_UserInfo." + key; + } + + public BsRoleMappingCQ addOrderBy_UserId_Asc() { + regOBA("USER_ID"); + return this; + } + + public BsRoleMappingCQ addOrderBy_UserId_Desc() { + regOBD("USER_ID"); + return this; + } + + protected ConditionValue _roleId; + + public ConditionValue getRoleId() { + if (_roleId == null) { + _roleId = new ConditionValue(); + } + return _roleId; + } + + protected ConditionValue getCValueRoleId() { + return getRoleId(); + } + + protected Map<String, RoleInfoCQ> _roleId_InScopeSubQuery_RoleInfoMap; + + public Map<String, RoleInfoCQ> getRoleId_InScopeSubQuery_RoleInfo() { + return _roleId_InScopeSubQuery_RoleInfoMap; + } + + public String keepRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ subQuery) { + if (_roleId_InScopeSubQuery_RoleInfoMap == null) { + _roleId_InScopeSubQuery_RoleInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_InScopeSubQuery_RoleInfoMap.size() + 1); + _roleId_InScopeSubQuery_RoleInfoMap.put(key, subQuery); + return "roleId_InScopeSubQuery_RoleInfo." + key; + } + + public BsRoleMappingCQ addOrderBy_RoleId_Asc() { + regOBA("ROLE_ID"); + return this; + } + + public BsRoleMappingCQ addOrderBy_RoleId_Desc() { + regOBD("ROLE_ID"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsRoleMappingCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsRoleMappingCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + RoleMappingCQ baseQuery = (RoleMappingCQ) baseQueryAsSuper; + RoleMappingCQ unionQuery = (RoleMappingCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryRoleInfo()) { + unionQuery.queryRoleInfo().reflectRelationOnUnionQuery( + baseQuery.queryRoleInfo(), unionQuery.queryRoleInfo()); + } + if (baseQuery.hasConditionQueryUserInfo()) { + unionQuery.queryUserInfo().reflectRelationOnUnionQuery( + baseQuery.queryUserInfo(), unionQuery.queryUserInfo()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public RoleInfoCQ queryRoleInfo() { + return getConditionQueryRoleInfo(); + } + + protected RoleInfoCQ _conditionQueryRoleInfo; + + public RoleInfoCQ getConditionQueryRoleInfo() { + if (_conditionQueryRoleInfo == null) { + _conditionQueryRoleInfo = createQueryRoleInfo(); + setupOuterJoin_RoleInfo(); + } + 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() { + String nrp = resolveNextRelationPath("ROLE_MAPPING", "roleInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("roleInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryRoleInfo() { + return _conditionQueryRoleInfo != null; + } + + public UserInfoCQ queryUserInfo() { + return getConditionQueryUserInfo(); + } + + protected UserInfoCQ _conditionQueryUserInfo; + + public UserInfoCQ getConditionQueryUserInfo() { + if (_conditionQueryUserInfo == null) { + _conditionQueryUserInfo = createQueryUserInfo(); + setupOuterJoin_UserInfo(); + } + 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() { + String nrp = resolveNextRelationPath("ROLE_MAPPING", "userInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("userInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryUserInfo() { + return _conditionQueryUserInfo != null; + } + + protected String getConditionQueryClassNameInternally() { + return RoleMappingCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,655 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.RoutineScheduleCIQ; + +/** + * The base condition-query of ROUTINE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoutineScheduleCQ extends AbstractBsRoutineScheduleCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoutineScheduleCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from ROUTINE_SCHEDULE) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public RoutineScheduleCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new RoutineScheduleCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * ROUTINE_SCHEDULE on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public RoutineScheduleCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + RoutineScheduleCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + protected Map<String, RoutineScheduleContentCQ> _id_InScopeSubQuery_RoutineScheduleContentAsOneMap; + + public Map<String, RoutineScheduleContentCQ> getId_InScopeSubQuery_RoutineScheduleContentAsOne() { + return _id_InScopeSubQuery_RoutineScheduleContentAsOneMap; + } + + public String keepId_InScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + if (_id_InScopeSubQuery_RoutineScheduleContentAsOneMap == null) { + _id_InScopeSubQuery_RoutineScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_RoutineScheduleContentAsOneMap.size() + 1); + _id_InScopeSubQuery_RoutineScheduleContentAsOneMap.put(key, subQuery); + return "id_InScopeSubQuery_RoutineScheduleContentAsOne." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _id_InScopeSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getId_InScopeSubQuery_RoutineScheduleMappingList() { + return _id_InScopeSubQuery_RoutineScheduleMappingListMap; + } + + public String keepId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_id_InScopeSubQuery_RoutineScheduleMappingListMap == null) { + _id_InScopeSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_RoutineScheduleMappingListMap.size() + 1); + _id_InScopeSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "id_InScopeSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, RoutineScheduleContentCQ> _id_NotInScopeSubQuery_RoutineScheduleContentAsOneMap; + + public Map<String, RoutineScheduleContentCQ> getId_NotInScopeSubQuery_RoutineScheduleContentAsOne() { + return _id_NotInScopeSubQuery_RoutineScheduleContentAsOneMap; + } + + public String keepId_NotInScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + if (_id_NotInScopeSubQuery_RoutineScheduleContentAsOneMap == null) { + _id_NotInScopeSubQuery_RoutineScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotInScopeSubQuery_RoutineScheduleContentAsOneMap.size() + 1); + _id_NotInScopeSubQuery_RoutineScheduleContentAsOneMap + .put(key, subQuery); + return "id_NotInScopeSubQuery_RoutineScheduleContentAsOne." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _id_NotInScopeSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getId_NotInScopeSubQuery_RoutineScheduleMappingList() { + return _id_NotInScopeSubQuery_RoutineScheduleMappingListMap; + } + + public String keepId_NotInScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_id_NotInScopeSubQuery_RoutineScheduleMappingListMap == null) { + _id_NotInScopeSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotInScopeSubQuery_RoutineScheduleMappingListMap.size() + 1); + _id_NotInScopeSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "id_NotInScopeSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, RoutineScheduleContentCQ> _id_ExistsSubQuery_RoutineScheduleContentAsOneMap; + + public Map<String, RoutineScheduleContentCQ> getId_ExistsSubQuery_RoutineScheduleContentAsOne() { + return _id_ExistsSubQuery_RoutineScheduleContentAsOneMap; + } + + public String keepId_ExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + if (_id_ExistsSubQuery_RoutineScheduleContentAsOneMap == null) { + _id_ExistsSubQuery_RoutineScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_ExistsSubQuery_RoutineScheduleContentAsOneMap.size() + 1); + _id_ExistsSubQuery_RoutineScheduleContentAsOneMap.put(key, subQuery); + return "id_ExistsSubQuery_RoutineScheduleContentAsOne." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _id_ExistsSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getId_ExistsSubQuery_RoutineScheduleMappingList() { + return _id_ExistsSubQuery_RoutineScheduleMappingListMap; + } + + public String keepId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_id_ExistsSubQuery_RoutineScheduleMappingListMap == null) { + _id_ExistsSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_ExistsSubQuery_RoutineScheduleMappingListMap.size() + 1); + _id_ExistsSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "id_ExistsSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, RoutineScheduleContentCQ> _id_NotExistsSubQuery_RoutineScheduleContentAsOneMap; + + public Map<String, RoutineScheduleContentCQ> getId_NotExistsSubQuery_RoutineScheduleContentAsOne() { + return _id_NotExistsSubQuery_RoutineScheduleContentAsOneMap; + } + + public String keepId_NotExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + if (_id_NotExistsSubQuery_RoutineScheduleContentAsOneMap == null) { + _id_NotExistsSubQuery_RoutineScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotExistsSubQuery_RoutineScheduleContentAsOneMap.size() + 1); + _id_NotExistsSubQuery_RoutineScheduleContentAsOneMap.put(key, subQuery); + return "id_NotExistsSubQuery_RoutineScheduleContentAsOne." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _id_NotExistsSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getId_NotExistsSubQuery_RoutineScheduleMappingList() { + return _id_NotExistsSubQuery_RoutineScheduleMappingListMap; + } + + public String keepId_NotExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_id_NotExistsSubQuery_RoutineScheduleMappingListMap == null) { + _id_NotExistsSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotExistsSubQuery_RoutineScheduleMappingListMap.size() + 1); + _id_NotExistsSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "id_NotExistsSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _id_DeriveSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getId_DeriveSubQuery_RoutineScheduleMappingList() { + return _id_DeriveSubQuery_RoutineScheduleMappingListMap; + } + + public String keepId_DeriveSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_id_DeriveSubQuery_RoutineScheduleMappingListMap == null) { + _id_DeriveSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_DeriveSubQuery_RoutineScheduleMappingListMap.size() + 1); + _id_DeriveSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "id_DeriveSubQuery_RoutineScheduleMappingList." + key; + } + + public BsRoutineScheduleCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _title; + + public ConditionValue getTitle() { + if (_title == null) { + _title = new ConditionValue(); + } + return _title; + } + + protected ConditionValue getCValueTitle() { + return getTitle(); + } + + public BsRoutineScheduleCQ addOrderBy_Title_Asc() { + regOBA("TITLE"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_Title_Desc() { + regOBD("TITLE"); + return this; + } + + protected ConditionValue _location; + + public ConditionValue getLocation() { + if (_location == null) { + _location = new ConditionValue(); + } + return _location; + } + + protected ConditionValue getCValueLocation() { + return getLocation(); + } + + public BsRoutineScheduleCQ addOrderBy_Location_Asc() { + regOBA("LOCATION"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_Location_Desc() { + regOBD("LOCATION"); + return this; + } + + protected ConditionValue _startDate; + + public ConditionValue getStartDate() { + if (_startDate == null) { + _startDate = new ConditionValue(); + } + return _startDate; + } + + protected ConditionValue getCValueStartDate() { + return getStartDate(); + } + + public BsRoutineScheduleCQ addOrderBy_StartDate_Asc() { + regOBA("START_DATE"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_StartDate_Desc() { + regOBD("START_DATE"); + return this; + } + + protected ConditionValue _startTime; + + public ConditionValue getStartTime() { + if (_startTime == null) { + _startTime = new ConditionValue(); + } + return _startTime; + } + + protected ConditionValue getCValueStartTime() { + return getStartTime(); + } + + public BsRoutineScheduleCQ addOrderBy_StartTime_Asc() { + regOBA("START_TIME"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_StartTime_Desc() { + regOBD("START_TIME"); + return this; + } + + protected ConditionValue _endDate; + + public ConditionValue getEndDate() { + if (_endDate == null) { + _endDate = new ConditionValue(); + } + return _endDate; + } + + protected ConditionValue getCValueEndDate() { + return getEndDate(); + } + + public BsRoutineScheduleCQ addOrderBy_EndDate_Asc() { + regOBA("END_DATE"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_EndDate_Desc() { + regOBD("END_DATE"); + return this; + } + + protected ConditionValue _endTime; + + public ConditionValue getEndTime() { + if (_endTime == null) { + _endTime = new ConditionValue(); + } + return _endTime; + } + + protected ConditionValue getCValueEndTime() { + return getEndTime(); + } + + public BsRoutineScheduleCQ addOrderBy_EndTime_Asc() { + regOBA("END_TIME"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_EndTime_Desc() { + regOBD("END_TIME"); + return this; + } + + protected ConditionValue _type; + + public ConditionValue getType() { + if (_type == null) { + _type = new ConditionValue(); + } + return _type; + } + + protected ConditionValue getCValueType() { + return getType(); + } + + public BsRoutineScheduleCQ addOrderBy_Type_Asc() { + regOBA("TYPE"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_Type_Desc() { + regOBD("TYPE"); + return this; + } + + protected ConditionValue _createdTime; + + public ConditionValue getCreatedTime() { + if (_createdTime == null) { + _createdTime = new ConditionValue(); + } + return _createdTime; + } + + protected ConditionValue getCValueCreatedTime() { + return getCreatedTime(); + } + + public BsRoutineScheduleCQ addOrderBy_CreatedTime_Asc() { + regOBA("CREATED_TIME"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_CreatedTime_Desc() { + regOBD("CREATED_TIME"); + return this; + } + + protected ConditionValue _createdBy; + + public ConditionValue getCreatedBy() { + if (_createdBy == null) { + _createdBy = new ConditionValue(); + } + return _createdBy; + } + + protected ConditionValue getCValueCreatedBy() { + return getCreatedBy(); + } + + public BsRoutineScheduleCQ addOrderBy_CreatedBy_Asc() { + regOBA("CREATED_BY"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_CreatedBy_Desc() { + regOBD("CREATED_BY"); + return this; + } + + protected ConditionValue _updatedTime; + + public ConditionValue getUpdatedTime() { + if (_updatedTime == null) { + _updatedTime = new ConditionValue(); + } + return _updatedTime; + } + + protected ConditionValue getCValueUpdatedTime() { + return getUpdatedTime(); + } + + public BsRoutineScheduleCQ addOrderBy_UpdatedTime_Asc() { + regOBA("UPDATED_TIME"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_UpdatedTime_Desc() { + regOBD("UPDATED_TIME"); + return this; + } + + protected ConditionValue _updatedBy; + + public ConditionValue getUpdatedBy() { + if (_updatedBy == null) { + _updatedBy = new ConditionValue(); + } + return _updatedBy; + } + + protected ConditionValue getCValueUpdatedBy() { + return getUpdatedBy(); + } + + public BsRoutineScheduleCQ addOrderBy_UpdatedBy_Asc() { + regOBA("UPDATED_BY"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_UpdatedBy_Desc() { + regOBD("UPDATED_BY"); + return this; + } + + protected ConditionValue _deletedTime; + + public ConditionValue getDeletedTime() { + if (_deletedTime == null) { + _deletedTime = new ConditionValue(); + } + return _deletedTime; + } + + protected ConditionValue getCValueDeletedTime() { + return getDeletedTime(); + } + + public BsRoutineScheduleCQ addOrderBy_DeletedTime_Asc() { + regOBA("DELETED_TIME"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_DeletedTime_Desc() { + regOBD("DELETED_TIME"); + return this; + } + + protected ConditionValue _deletedBy; + + public ConditionValue getDeletedBy() { + if (_deletedBy == null) { + _deletedBy = new ConditionValue(); + } + return _deletedBy; + } + + protected ConditionValue getCValueDeletedBy() { + return getDeletedBy(); + } + + public BsRoutineScheduleCQ addOrderBy_DeletedBy_Asc() { + regOBA("DELETED_BY"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_DeletedBy_Desc() { + regOBD("DELETED_BY"); + return this; + } + + protected ConditionValue _versionno; + + public ConditionValue getVersionno() { + if (_versionno == null) { + _versionno = new ConditionValue(); + } + return _versionno; + } + + protected ConditionValue getCValueVersionno() { + return getVersionno(); + } + + public BsRoutineScheduleCQ addOrderBy_Versionno_Asc() { + regOBA("VERSIONNO"); + return this; + } + + public BsRoutineScheduleCQ addOrderBy_Versionno_Desc() { + regOBD("VERSIONNO"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsRoutineScheduleCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsRoutineScheduleCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + RoutineScheduleCQ baseQuery = (RoutineScheduleCQ) baseQueryAsSuper; + RoutineScheduleCQ unionQuery = (RoutineScheduleCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryRoutineScheduleContentAsOne()) { + unionQuery.queryRoutineScheduleContentAsOne() + .reflectRelationOnUnionQuery( + baseQuery.queryRoutineScheduleContentAsOne(), + unionQuery.queryRoutineScheduleContentAsOne()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public RoutineScheduleContentCQ queryRoutineScheduleContentAsOne() { + return getConditionQueryRoutineScheduleContentAsOne(); + } + + protected RoutineScheduleContentCQ _conditionQueryRoutineScheduleContentAsOne; + + public RoutineScheduleContentCQ getConditionQueryRoutineScheduleContentAsOne() { + if (_conditionQueryRoutineScheduleContentAsOne == null) { + _conditionQueryRoutineScheduleContentAsOne = createQueryRoutineScheduleContentAsOne(); + setupOuterJoin_RoutineScheduleContentAsOne(); + } + return _conditionQueryRoutineScheduleContentAsOne; + } + + protected void setupOuterJoin_RoutineScheduleContentAsOne() { + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), + getConditionQueryRoutineScheduleContentAsOne() + .getRealColumnName("ID")); + registerOuterJoin(getConditionQueryRoutineScheduleContentAsOne(), + joinOnMap); + } + + protected RoutineScheduleContentCQ createQueryRoutineScheduleContentAsOne() { + String nrp = resolveNextRelationPath("ROUTINE_SCHEDULE", + "routineScheduleContentAsOne"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + RoutineScheduleContentCQ cq = new RoutineScheduleContentCQ(this, + getSqlClause(), jan, getNextNestLevel()); + cq.xsetForeignPropertyName("routineScheduleContentAsOne"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryRoutineScheduleContentAsOne() { + return _conditionQueryRoutineScheduleContentAsOne != null; + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleContentCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleContentCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,218 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.RoutineScheduleContentCIQ; + +/** + * The base condition-query of ROUTINE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoutineScheduleContentCQ extends + AbstractBsRoutineScheduleContentCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleContentCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoutineScheduleContentCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from ROUTINE_SCHEDULE_CONTENT) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public RoutineScheduleContentCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new RoutineScheduleContentCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * ROUTINE_SCHEDULE_CONTENT on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public RoutineScheduleContentCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + RoutineScheduleContentCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + protected Map<String, RoutineScheduleCQ> _id_InScopeSubQuery_RoutineScheduleMap; + + public Map<String, RoutineScheduleCQ> getId_InScopeSubQuery_RoutineSchedule() { + return _id_InScopeSubQuery_RoutineScheduleMap; + } + + public String keepId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ subQuery) { + if (_id_InScopeSubQuery_RoutineScheduleMap == null) { + _id_InScopeSubQuery_RoutineScheduleMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_RoutineScheduleMap.size() + 1); + _id_InScopeSubQuery_RoutineScheduleMap.put(key, subQuery); + return "id_InScopeSubQuery_RoutineSchedule." + key; + } + + public BsRoutineScheduleContentCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsRoutineScheduleContentCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _content; + + public ConditionValue getContent() { + if (_content == null) { + _content = new ConditionValue(); + } + return _content; + } + + protected ConditionValue getCValueContent() { + return getContent(); + } + + public BsRoutineScheduleContentCQ addOrderBy_Content_Asc() { + regOBA("CONTENT"); + return this; + } + + public BsRoutineScheduleContentCQ addOrderBy_Content_Desc() { + regOBD("CONTENT"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsRoutineScheduleContentCQ addSpecifiedDerivedOrderBy_Asc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsRoutineScheduleContentCQ addSpecifiedDerivedOrderBy_Desc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + RoutineScheduleContentCQ baseQuery = (RoutineScheduleContentCQ) baseQueryAsSuper; + RoutineScheduleContentCQ unionQuery = (RoutineScheduleContentCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryRoutineSchedule()) { + unionQuery.queryRoutineSchedule().reflectRelationOnUnionQuery( + baseQuery.queryRoutineSchedule(), + unionQuery.queryRoutineSchedule()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public RoutineScheduleCQ queryRoutineSchedule() { + return getConditionQueryRoutineSchedule(); + } + + protected RoutineScheduleCQ _conditionQueryRoutineSchedule; + + public RoutineScheduleCQ getConditionQueryRoutineSchedule() { + if (_conditionQueryRoutineSchedule == null) { + _conditionQueryRoutineSchedule = createQueryRoutineSchedule(); + setupOuterJoin_RoutineSchedule(); + } + return _conditionQueryRoutineSchedule; + } + + protected void setupOuterJoin_RoutineSchedule() { + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), + getConditionQueryRoutineSchedule().getRealColumnName("ID")); + registerOuterJoin(getConditionQueryRoutineSchedule(), joinOnMap); + } + + protected RoutineScheduleCQ createQueryRoutineSchedule() { + String nrp = resolveNextRelationPath("ROUTINE_SCHEDULE_CONTENT", + "routineSchedule"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + RoutineScheduleCQ cq = new RoutineScheduleCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("routineSchedule"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryRoutineSchedule() { + return _conditionQueryRoutineSchedule != null; + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleContentCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleContentCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,298 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.RoutineScheduleMappingCIQ; + +/** + * The base condition-query of ROUTINE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsRoutineScheduleMappingCQ extends + AbstractBsRoutineScheduleMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected RoutineScheduleMappingCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsRoutineScheduleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from ROUTINE_SCHEDULE_MAPPING) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public RoutineScheduleMappingCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new RoutineScheduleMappingCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * ROUTINE_SCHEDULE_MAPPING on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public RoutineScheduleMappingCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + RoutineScheduleMappingCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + public BsRoutineScheduleMappingCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsRoutineScheduleMappingCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _scheduleId; + + public ConditionValue getScheduleId() { + if (_scheduleId == null) { + _scheduleId = new ConditionValue(); + } + return _scheduleId; + } + + protected ConditionValue getCValueScheduleId() { + return getScheduleId(); + } + + protected Map<String, RoutineScheduleCQ> _scheduleId_InScopeSubQuery_RoutineScheduleMap; + + public Map<String, RoutineScheduleCQ> getScheduleId_InScopeSubQuery_RoutineSchedule() { + return _scheduleId_InScopeSubQuery_RoutineScheduleMap; + } + + public String keepScheduleId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ subQuery) { + if (_scheduleId_InScopeSubQuery_RoutineScheduleMap == null) { + _scheduleId_InScopeSubQuery_RoutineScheduleMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_scheduleId_InScopeSubQuery_RoutineScheduleMap.size() + 1); + _scheduleId_InScopeSubQuery_RoutineScheduleMap.put(key, subQuery); + return "scheduleId_InScopeSubQuery_RoutineSchedule." + key; + } + + public BsRoutineScheduleMappingCQ addOrderBy_ScheduleId_Asc() { + regOBA("SCHEDULE_ID"); + return this; + } + + public BsRoutineScheduleMappingCQ addOrderBy_ScheduleId_Desc() { + regOBD("SCHEDULE_ID"); + return this; + } + + protected ConditionValue _userId; + + public ConditionValue getUserId() { + if (_userId == null) { + _userId = new ConditionValue(); + } + return _userId; + } + + protected ConditionValue getCValueUserId() { + return getUserId(); + } + + protected Map<String, UserInfoCQ> _userId_InScopeSubQuery_UserInfoMap; + + public Map<String, UserInfoCQ> getUserId_InScopeSubQuery_UserInfo() { + return _userId_InScopeSubQuery_UserInfoMap; + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + if (_userId_InScopeSubQuery_UserInfoMap == null) { + _userId_InScopeSubQuery_UserInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_UserInfoMap.size() + 1); + _userId_InScopeSubQuery_UserInfoMap.put(key, subQuery); + return "userId_InScopeSubQuery_UserInfo." + key; + } + + public BsRoutineScheduleMappingCQ addOrderBy_UserId_Asc() { + regOBA("USER_ID"); + return this; + } + + public BsRoutineScheduleMappingCQ addOrderBy_UserId_Desc() { + regOBD("USER_ID"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsRoutineScheduleMappingCQ addSpecifiedDerivedOrderBy_Asc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsRoutineScheduleMappingCQ addSpecifiedDerivedOrderBy_Desc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + RoutineScheduleMappingCQ baseQuery = (RoutineScheduleMappingCQ) baseQueryAsSuper; + RoutineScheduleMappingCQ unionQuery = (RoutineScheduleMappingCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryRoutineSchedule()) { + unionQuery.queryRoutineSchedule().reflectRelationOnUnionQuery( + baseQuery.queryRoutineSchedule(), + unionQuery.queryRoutineSchedule()); + } + if (baseQuery.hasConditionQueryUserInfo()) { + unionQuery.queryUserInfo().reflectRelationOnUnionQuery( + baseQuery.queryUserInfo(), unionQuery.queryUserInfo()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public RoutineScheduleCQ queryRoutineSchedule() { + return getConditionQueryRoutineSchedule(); + } + + protected RoutineScheduleCQ _conditionQueryRoutineSchedule; + + public RoutineScheduleCQ getConditionQueryRoutineSchedule() { + if (_conditionQueryRoutineSchedule == null) { + _conditionQueryRoutineSchedule = createQueryRoutineSchedule(); + setupOuterJoin_RoutineSchedule(); + } + return _conditionQueryRoutineSchedule; + } + + protected void setupOuterJoin_RoutineSchedule() { + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("SCHEDULE_ID"), + getConditionQueryRoutineSchedule().getRealColumnName("ID")); + registerOuterJoin(getConditionQueryRoutineSchedule(), joinOnMap); + } + + protected RoutineScheduleCQ createQueryRoutineSchedule() { + String nrp = resolveNextRelationPath("ROUTINE_SCHEDULE_MAPPING", + "routineSchedule"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + RoutineScheduleCQ cq = new RoutineScheduleCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("routineSchedule"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryRoutineSchedule() { + return _conditionQueryRoutineSchedule != null; + } + + public UserInfoCQ queryUserInfo() { + return getConditionQueryUserInfo(); + } + + protected UserInfoCQ _conditionQueryUserInfo; + + public UserInfoCQ getConditionQueryUserInfo() { + if (_conditionQueryUserInfo == null) { + _conditionQueryUserInfo = createQueryUserInfo(); + setupOuterJoin_UserInfo(); + } + 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() { + String nrp = resolveNextRelationPath("ROUTINE_SCHEDULE_MAPPING", + "userInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("userInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryUserInfo() { + return _conditionQueryUserInfo != null; + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleMappingCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsRoutineScheduleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,631 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.SingleScheduleCIQ; + +/** + * The base condition-query of SINGLE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsSingleScheduleCQ extends AbstractBsSingleScheduleCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsSingleScheduleCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from SINGLE_SCHEDULE) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public SingleScheduleCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new SingleScheduleCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * SINGLE_SCHEDULE on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public SingleScheduleCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + SingleScheduleCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + protected Map<String, SingleScheduleContentCQ> _id_InScopeSubQuery_SingleScheduleContentAsOneMap; + + public Map<String, SingleScheduleContentCQ> getId_InScopeSubQuery_SingleScheduleContentAsOne() { + return _id_InScopeSubQuery_SingleScheduleContentAsOneMap; + } + + public String keepId_InScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + if (_id_InScopeSubQuery_SingleScheduleContentAsOneMap == null) { + _id_InScopeSubQuery_SingleScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_SingleScheduleContentAsOneMap.size() + 1); + _id_InScopeSubQuery_SingleScheduleContentAsOneMap.put(key, subQuery); + return "id_InScopeSubQuery_SingleScheduleContentAsOne." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _id_InScopeSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getId_InScopeSubQuery_SingleScheduleMappingList() { + return _id_InScopeSubQuery_SingleScheduleMappingListMap; + } + + public String keepId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_id_InScopeSubQuery_SingleScheduleMappingListMap == null) { + _id_InScopeSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_SingleScheduleMappingListMap.size() + 1); + _id_InScopeSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "id_InScopeSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleContentCQ> _id_NotInScopeSubQuery_SingleScheduleContentAsOneMap; + + public Map<String, SingleScheduleContentCQ> getId_NotInScopeSubQuery_SingleScheduleContentAsOne() { + return _id_NotInScopeSubQuery_SingleScheduleContentAsOneMap; + } + + public String keepId_NotInScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + if (_id_NotInScopeSubQuery_SingleScheduleContentAsOneMap == null) { + _id_NotInScopeSubQuery_SingleScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotInScopeSubQuery_SingleScheduleContentAsOneMap.size() + 1); + _id_NotInScopeSubQuery_SingleScheduleContentAsOneMap.put(key, subQuery); + return "id_NotInScopeSubQuery_SingleScheduleContentAsOne." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _id_NotInScopeSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getId_NotInScopeSubQuery_SingleScheduleMappingList() { + return _id_NotInScopeSubQuery_SingleScheduleMappingListMap; + } + + public String keepId_NotInScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_id_NotInScopeSubQuery_SingleScheduleMappingListMap == null) { + _id_NotInScopeSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotInScopeSubQuery_SingleScheduleMappingListMap.size() + 1); + _id_NotInScopeSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "id_NotInScopeSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleContentCQ> _id_ExistsSubQuery_SingleScheduleContentAsOneMap; + + public Map<String, SingleScheduleContentCQ> getId_ExistsSubQuery_SingleScheduleContentAsOne() { + return _id_ExistsSubQuery_SingleScheduleContentAsOneMap; + } + + public String keepId_ExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + if (_id_ExistsSubQuery_SingleScheduleContentAsOneMap == null) { + _id_ExistsSubQuery_SingleScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_ExistsSubQuery_SingleScheduleContentAsOneMap.size() + 1); + _id_ExistsSubQuery_SingleScheduleContentAsOneMap.put(key, subQuery); + return "id_ExistsSubQuery_SingleScheduleContentAsOne." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _id_ExistsSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getId_ExistsSubQuery_SingleScheduleMappingList() { + return _id_ExistsSubQuery_SingleScheduleMappingListMap; + } + + public String keepId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_id_ExistsSubQuery_SingleScheduleMappingListMap == null) { + _id_ExistsSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_ExistsSubQuery_SingleScheduleMappingListMap.size() + 1); + _id_ExistsSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "id_ExistsSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleContentCQ> _id_NotExistsSubQuery_SingleScheduleContentAsOneMap; + + public Map<String, SingleScheduleContentCQ> getId_NotExistsSubQuery_SingleScheduleContentAsOne() { + return _id_NotExistsSubQuery_SingleScheduleContentAsOneMap; + } + + public String keepId_NotExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + if (_id_NotExistsSubQuery_SingleScheduleContentAsOneMap == null) { + _id_NotExistsSubQuery_SingleScheduleContentAsOneMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotExistsSubQuery_SingleScheduleContentAsOneMap.size() + 1); + _id_NotExistsSubQuery_SingleScheduleContentAsOneMap.put(key, subQuery); + return "id_NotExistsSubQuery_SingleScheduleContentAsOne." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _id_NotExistsSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getId_NotExistsSubQuery_SingleScheduleMappingList() { + return _id_NotExistsSubQuery_SingleScheduleMappingListMap; + } + + public String keepId_NotExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_id_NotExistsSubQuery_SingleScheduleMappingListMap == null) { + _id_NotExistsSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_NotExistsSubQuery_SingleScheduleMappingListMap.size() + 1); + _id_NotExistsSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "id_NotExistsSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _id_DeriveSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getId_DeriveSubQuery_SingleScheduleMappingList() { + return _id_DeriveSubQuery_SingleScheduleMappingListMap; + } + + public String keepId_DeriveSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_id_DeriveSubQuery_SingleScheduleMappingListMap == null) { + _id_DeriveSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_DeriveSubQuery_SingleScheduleMappingListMap.size() + 1); + _id_DeriveSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "id_DeriveSubQuery_SingleScheduleMappingList." + key; + } + + public BsSingleScheduleCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _title; + + public ConditionValue getTitle() { + if (_title == null) { + _title = new ConditionValue(); + } + return _title; + } + + protected ConditionValue getCValueTitle() { + return getTitle(); + } + + public BsSingleScheduleCQ addOrderBy_Title_Asc() { + regOBA("TITLE"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_Title_Desc() { + regOBD("TITLE"); + return this; + } + + protected ConditionValue _location; + + public ConditionValue getLocation() { + if (_location == null) { + _location = new ConditionValue(); + } + return _location; + } + + protected ConditionValue getCValueLocation() { + return getLocation(); + } + + public BsSingleScheduleCQ addOrderBy_Location_Asc() { + regOBA("LOCATION"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_Location_Desc() { + regOBD("LOCATION"); + return this; + } + + protected ConditionValue _startDate; + + public ConditionValue getStartDate() { + if (_startDate == null) { + _startDate = new ConditionValue(); + } + return _startDate; + } + + protected ConditionValue getCValueStartDate() { + return getStartDate(); + } + + public BsSingleScheduleCQ addOrderBy_StartDate_Asc() { + regOBA("START_DATE"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_StartDate_Desc() { + regOBD("START_DATE"); + return this; + } + + protected ConditionValue _startTime; + + public ConditionValue getStartTime() { + if (_startTime == null) { + _startTime = new ConditionValue(); + } + return _startTime; + } + + protected ConditionValue getCValueStartTime() { + return getStartTime(); + } + + public BsSingleScheduleCQ addOrderBy_StartTime_Asc() { + regOBA("START_TIME"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_StartTime_Desc() { + regOBD("START_TIME"); + return this; + } + + protected ConditionValue _endDate; + + public ConditionValue getEndDate() { + if (_endDate == null) { + _endDate = new ConditionValue(); + } + return _endDate; + } + + protected ConditionValue getCValueEndDate() { + return getEndDate(); + } + + public BsSingleScheduleCQ addOrderBy_EndDate_Asc() { + regOBA("END_DATE"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_EndDate_Desc() { + regOBD("END_DATE"); + return this; + } + + protected ConditionValue _endTime; + + public ConditionValue getEndTime() { + if (_endTime == null) { + _endTime = new ConditionValue(); + } + return _endTime; + } + + protected ConditionValue getCValueEndTime() { + return getEndTime(); + } + + public BsSingleScheduleCQ addOrderBy_EndTime_Asc() { + regOBA("END_TIME"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_EndTime_Desc() { + regOBD("END_TIME"); + return this; + } + + protected ConditionValue _createdTime; + + public ConditionValue getCreatedTime() { + if (_createdTime == null) { + _createdTime = new ConditionValue(); + } + return _createdTime; + } + + protected ConditionValue getCValueCreatedTime() { + return getCreatedTime(); + } + + public BsSingleScheduleCQ addOrderBy_CreatedTime_Asc() { + regOBA("CREATED_TIME"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_CreatedTime_Desc() { + regOBD("CREATED_TIME"); + return this; + } + + protected ConditionValue _createdBy; + + public ConditionValue getCreatedBy() { + if (_createdBy == null) { + _createdBy = new ConditionValue(); + } + return _createdBy; + } + + protected ConditionValue getCValueCreatedBy() { + return getCreatedBy(); + } + + public BsSingleScheduleCQ addOrderBy_CreatedBy_Asc() { + regOBA("CREATED_BY"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_CreatedBy_Desc() { + regOBD("CREATED_BY"); + return this; + } + + protected ConditionValue _updatedTime; + + public ConditionValue getUpdatedTime() { + if (_updatedTime == null) { + _updatedTime = new ConditionValue(); + } + return _updatedTime; + } + + protected ConditionValue getCValueUpdatedTime() { + return getUpdatedTime(); + } + + public BsSingleScheduleCQ addOrderBy_UpdatedTime_Asc() { + regOBA("UPDATED_TIME"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_UpdatedTime_Desc() { + regOBD("UPDATED_TIME"); + return this; + } + + protected ConditionValue _updatedBy; + + public ConditionValue getUpdatedBy() { + if (_updatedBy == null) { + _updatedBy = new ConditionValue(); + } + return _updatedBy; + } + + protected ConditionValue getCValueUpdatedBy() { + return getUpdatedBy(); + } + + public BsSingleScheduleCQ addOrderBy_UpdatedBy_Asc() { + regOBA("UPDATED_BY"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_UpdatedBy_Desc() { + regOBD("UPDATED_BY"); + return this; + } + + protected ConditionValue _deletedTime; + + public ConditionValue getDeletedTime() { + if (_deletedTime == null) { + _deletedTime = new ConditionValue(); + } + return _deletedTime; + } + + protected ConditionValue getCValueDeletedTime() { + return getDeletedTime(); + } + + public BsSingleScheduleCQ addOrderBy_DeletedTime_Asc() { + regOBA("DELETED_TIME"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_DeletedTime_Desc() { + regOBD("DELETED_TIME"); + return this; + } + + protected ConditionValue _deletedBy; + + public ConditionValue getDeletedBy() { + if (_deletedBy == null) { + _deletedBy = new ConditionValue(); + } + return _deletedBy; + } + + protected ConditionValue getCValueDeletedBy() { + return getDeletedBy(); + } + + public BsSingleScheduleCQ addOrderBy_DeletedBy_Asc() { + regOBA("DELETED_BY"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_DeletedBy_Desc() { + regOBD("DELETED_BY"); + return this; + } + + protected ConditionValue _versionno; + + public ConditionValue getVersionno() { + if (_versionno == null) { + _versionno = new ConditionValue(); + } + return _versionno; + } + + protected ConditionValue getCValueVersionno() { + return getVersionno(); + } + + public BsSingleScheduleCQ addOrderBy_Versionno_Asc() { + regOBA("VERSIONNO"); + return this; + } + + public BsSingleScheduleCQ addOrderBy_Versionno_Desc() { + regOBD("VERSIONNO"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsSingleScheduleCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsSingleScheduleCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + SingleScheduleCQ baseQuery = (SingleScheduleCQ) baseQueryAsSuper; + SingleScheduleCQ unionQuery = (SingleScheduleCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQuerySingleScheduleContentAsOne()) { + unionQuery.querySingleScheduleContentAsOne() + .reflectRelationOnUnionQuery( + baseQuery.querySingleScheduleContentAsOne(), + unionQuery.querySingleScheduleContentAsOne()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public SingleScheduleContentCQ querySingleScheduleContentAsOne() { + return getConditionQuerySingleScheduleContentAsOne(); + } + + protected SingleScheduleContentCQ _conditionQuerySingleScheduleContentAsOne; + + public SingleScheduleContentCQ getConditionQuerySingleScheduleContentAsOne() { + if (_conditionQuerySingleScheduleContentAsOne == null) { + _conditionQuerySingleScheduleContentAsOne = createQuerySingleScheduleContentAsOne(); + setupOuterJoin_SingleScheduleContentAsOne(); + } + return _conditionQuerySingleScheduleContentAsOne; + } + + protected void setupOuterJoin_SingleScheduleContentAsOne() { + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), + getConditionQuerySingleScheduleContentAsOne() + .getRealColumnName("ID")); + registerOuterJoin(getConditionQuerySingleScheduleContentAsOne(), + joinOnMap); + } + + protected SingleScheduleContentCQ createQuerySingleScheduleContentAsOne() { + String nrp = resolveNextRelationPath("SINGLE_SCHEDULE", + "singleScheduleContentAsOne"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + SingleScheduleContentCQ cq = new SingleScheduleContentCQ(this, + getSqlClause(), jan, getNextNestLevel()); + cq.xsetForeignPropertyName("singleScheduleContentAsOne"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQuerySingleScheduleContentAsOne() { + return _conditionQuerySingleScheduleContentAsOne != null; + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleContentCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleContentCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleContentCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,218 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.SingleScheduleContentCIQ; + +/** + * The base condition-query of SINGLE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsSingleScheduleContentCQ extends + AbstractBsSingleScheduleContentCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleContentCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsSingleScheduleContentCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from SINGLE_SCHEDULE_CONTENT) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public SingleScheduleContentCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new SingleScheduleContentCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * SINGLE_SCHEDULE_CONTENT on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public SingleScheduleContentCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + SingleScheduleContentCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + protected Map<String, SingleScheduleCQ> _id_InScopeSubQuery_SingleScheduleMap; + + public Map<String, SingleScheduleCQ> getId_InScopeSubQuery_SingleSchedule() { + return _id_InScopeSubQuery_SingleScheduleMap; + } + + public String keepId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ subQuery) { + if (_id_InScopeSubQuery_SingleScheduleMap == null) { + _id_InScopeSubQuery_SingleScheduleMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_id_InScopeSubQuery_SingleScheduleMap.size() + 1); + _id_InScopeSubQuery_SingleScheduleMap.put(key, subQuery); + return "id_InScopeSubQuery_SingleSchedule." + key; + } + + public BsSingleScheduleContentCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsSingleScheduleContentCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _content; + + public ConditionValue getContent() { + if (_content == null) { + _content = new ConditionValue(); + } + return _content; + } + + protected ConditionValue getCValueContent() { + return getContent(); + } + + public BsSingleScheduleContentCQ addOrderBy_Content_Asc() { + regOBA("CONTENT"); + return this; + } + + public BsSingleScheduleContentCQ addOrderBy_Content_Desc() { + regOBD("CONTENT"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsSingleScheduleContentCQ addSpecifiedDerivedOrderBy_Asc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsSingleScheduleContentCQ addSpecifiedDerivedOrderBy_Desc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + SingleScheduleContentCQ baseQuery = (SingleScheduleContentCQ) baseQueryAsSuper; + SingleScheduleContentCQ unionQuery = (SingleScheduleContentCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQuerySingleSchedule()) { + unionQuery.querySingleSchedule().reflectRelationOnUnionQuery( + baseQuery.querySingleSchedule(), + unionQuery.querySingleSchedule()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public SingleScheduleCQ querySingleSchedule() { + return getConditionQuerySingleSchedule(); + } + + protected SingleScheduleCQ _conditionQuerySingleSchedule; + + public SingleScheduleCQ getConditionQuerySingleSchedule() { + if (_conditionQuerySingleSchedule == null) { + _conditionQuerySingleSchedule = createQuerySingleSchedule(); + setupOuterJoin_SingleSchedule(); + } + return _conditionQuerySingleSchedule; + } + + protected void setupOuterJoin_SingleSchedule() { + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("ID"), + getConditionQuerySingleSchedule().getRealColumnName("ID")); + registerOuterJoin(getConditionQuerySingleSchedule(), joinOnMap); + } + + protected SingleScheduleCQ createQuerySingleSchedule() { + String nrp = resolveNextRelationPath("SINGLE_SCHEDULE_CONTENT", + "singleSchedule"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + SingleScheduleCQ cq = new SingleScheduleCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("singleSchedule"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQuerySingleSchedule() { + return _conditionQuerySingleSchedule != null; + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleContentCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleContentCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleMappingCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleMappingCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleMappingCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,298 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.SingleScheduleMappingCIQ; + +/** + * The base condition-query of SINGLE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsSingleScheduleMappingCQ extends + AbstractBsSingleScheduleMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected SingleScheduleMappingCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsSingleScheduleMappingCQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from SINGLE_SCHEDULE_MAPPING) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public SingleScheduleMappingCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new SingleScheduleMappingCIQ(getChildQuery(), + getSqlClause(), getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * SINGLE_SCHEDULE_MAPPING on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public SingleScheduleMappingCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + SingleScheduleMappingCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _id; + + public ConditionValue getId() { + if (_id == null) { + _id = new ConditionValue(); + } + return _id; + } + + protected ConditionValue getCValueId() { + return getId(); + } + + public BsSingleScheduleMappingCQ addOrderBy_Id_Asc() { + regOBA("ID"); + return this; + } + + public BsSingleScheduleMappingCQ addOrderBy_Id_Desc() { + regOBD("ID"); + return this; + } + + protected ConditionValue _scheduleId; + + public ConditionValue getScheduleId() { + if (_scheduleId == null) { + _scheduleId = new ConditionValue(); + } + return _scheduleId; + } + + protected ConditionValue getCValueScheduleId() { + return getScheduleId(); + } + + protected Map<String, SingleScheduleCQ> _scheduleId_InScopeSubQuery_SingleScheduleMap; + + public Map<String, SingleScheduleCQ> getScheduleId_InScopeSubQuery_SingleSchedule() { + return _scheduleId_InScopeSubQuery_SingleScheduleMap; + } + + public String keepScheduleId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ subQuery) { + if (_scheduleId_InScopeSubQuery_SingleScheduleMap == null) { + _scheduleId_InScopeSubQuery_SingleScheduleMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_scheduleId_InScopeSubQuery_SingleScheduleMap.size() + 1); + _scheduleId_InScopeSubQuery_SingleScheduleMap.put(key, subQuery); + return "scheduleId_InScopeSubQuery_SingleSchedule." + key; + } + + public BsSingleScheduleMappingCQ addOrderBy_ScheduleId_Asc() { + regOBA("SCHEDULE_ID"); + return this; + } + + public BsSingleScheduleMappingCQ addOrderBy_ScheduleId_Desc() { + regOBD("SCHEDULE_ID"); + return this; + } + + protected ConditionValue _userId; + + public ConditionValue getUserId() { + if (_userId == null) { + _userId = new ConditionValue(); + } + return _userId; + } + + protected ConditionValue getCValueUserId() { + return getUserId(); + } + + protected Map<String, UserInfoCQ> _userId_InScopeSubQuery_UserInfoMap; + + public Map<String, UserInfoCQ> getUserId_InScopeSubQuery_UserInfo() { + return _userId_InScopeSubQuery_UserInfoMap; + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + if (_userId_InScopeSubQuery_UserInfoMap == null) { + _userId_InScopeSubQuery_UserInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_UserInfoMap.size() + 1); + _userId_InScopeSubQuery_UserInfoMap.put(key, subQuery); + return "userId_InScopeSubQuery_UserInfo." + key; + } + + public BsSingleScheduleMappingCQ addOrderBy_UserId_Asc() { + regOBA("USER_ID"); + return this; + } + + public BsSingleScheduleMappingCQ addOrderBy_UserId_Desc() { + regOBD("USER_ID"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsSingleScheduleMappingCQ addSpecifiedDerivedOrderBy_Asc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsSingleScheduleMappingCQ addSpecifiedDerivedOrderBy_Desc( + String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + SingleScheduleMappingCQ baseQuery = (SingleScheduleMappingCQ) baseQueryAsSuper; + SingleScheduleMappingCQ unionQuery = (SingleScheduleMappingCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQuerySingleSchedule()) { + unionQuery.querySingleSchedule().reflectRelationOnUnionQuery( + baseQuery.querySingleSchedule(), + unionQuery.querySingleSchedule()); + } + if (baseQuery.hasConditionQueryUserInfo()) { + unionQuery.queryUserInfo().reflectRelationOnUnionQuery( + baseQuery.queryUserInfo(), unionQuery.queryUserInfo()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public SingleScheduleCQ querySingleSchedule() { + return getConditionQuerySingleSchedule(); + } + + protected SingleScheduleCQ _conditionQuerySingleSchedule; + + public SingleScheduleCQ getConditionQuerySingleSchedule() { + if (_conditionQuerySingleSchedule == null) { + _conditionQuerySingleSchedule = createQuerySingleSchedule(); + setupOuterJoin_SingleSchedule(); + } + return _conditionQuerySingleSchedule; + } + + protected void setupOuterJoin_SingleSchedule() { + Map<String, String> joinOnMap = newLinkedHashMap(); + joinOnMap.put(getRealColumnName("SCHEDULE_ID"), + getConditionQuerySingleSchedule().getRealColumnName("ID")); + registerOuterJoin(getConditionQuerySingleSchedule(), joinOnMap); + } + + protected SingleScheduleCQ createQuerySingleSchedule() { + String nrp = resolveNextRelationPath("SINGLE_SCHEDULE_MAPPING", + "singleSchedule"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + SingleScheduleCQ cq = new SingleScheduleCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("singleSchedule"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQuerySingleSchedule() { + return _conditionQuerySingleSchedule != null; + } + + public UserInfoCQ queryUserInfo() { + return getConditionQueryUserInfo(); + } + + protected UserInfoCQ _conditionQueryUserInfo; + + public UserInfoCQ getConditionQueryUserInfo() { + if (_conditionQueryUserInfo == null) { + _conditionQueryUserInfo = createQueryUserInfo(); + setupOuterJoin_UserInfo(); + } + 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() { + String nrp = resolveNextRelationPath("SINGLE_SCHEDULE_MAPPING", + "userInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + UserInfoCQ cq = new UserInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("userInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryUserInfo() { + return _conditionQueryUserInfo != null; + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleMappingCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsSingleScheduleMappingCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsUserInfoCQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsUserInfoCQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsUserInfoCQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,1058 @@ +package jp.sf.pal.scheduler.db.cbean.cq.bs; + +import java.util.Map; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.ciq.UserInfoCIQ; + +/** + * The base condition-query of USER_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class BsUserInfoCQ extends AbstractBsUserInfoCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected UserInfoCIQ _inlineQuery; + + //========================================================================== + // ========= + // Constructor + // =========== + public BsUserInfoCQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel) { + super(childQuery, sqlClause, aliasName, nestLevel); + } + + //========================================================================== + // ========= + // Inline + // ====== + /** + * Prepare inline query. <br /> {select ... from ... left outer join (select + * * from USER_INFO) where abc = [abc] ...} + * + * @return Inline query. (NotNull) + */ + public UserInfoCIQ inline() { + if (_inlineQuery == null) { + _inlineQuery = new UserInfoCIQ(getChildQuery(), getSqlClause(), + getAliasName(), getNestLevel(), this); + } + _inlineQuery.xsetOnClauseInline(false); + return _inlineQuery; + } + + /** + * Prepare on-clause query. <br /> {select ... from ... left outer join + * USER_INFO on ... and abc = [abc] ...} + * + * @return On-clause query. (NotNull) + */ + public UserInfoCIQ on() { + if (isBaseQuery(this)) { + throw new UnsupportedOperationException( + "Unsupported onClause of Base Table!"); + } + UserInfoCIQ inlineQuery = inline(); + inlineQuery.xsetOnClauseInline(true); + return inlineQuery; + } + + //========================================================================== + // ========= + // Query + // ===== + + protected ConditionValue _userId; + + public ConditionValue getUserId() { + if (_userId == null) { + _userId = new ConditionValue(); + } + return _userId; + } + + protected ConditionValue getCValueUserId() { + return getUserId(); + } + + protected Map<String, GroupMappingCQ> _userId_InScopeSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getUserId_InScopeSubQuery_GroupMappingList() { + return _userId_InScopeSubQuery_GroupMappingListMap; + } + + public String keepUserId_InScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_userId_InScopeSubQuery_GroupMappingListMap == null) { + _userId_InScopeSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_GroupMappingListMap.size() + 1); + _userId_InScopeSubQuery_GroupMappingListMap.put(key, subQuery); + return "userId_InScopeSubQuery_GroupMappingList." + key; + } + + protected Map<String, RoleMappingCQ> _userId_InScopeSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getUserId_InScopeSubQuery_RoleMappingList() { + return _userId_InScopeSubQuery_RoleMappingListMap; + } + + public String keepUserId_InScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_userId_InScopeSubQuery_RoleMappingListMap == null) { + _userId_InScopeSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_RoleMappingListMap.size() + 1); + _userId_InScopeSubQuery_RoleMappingListMap.put(key, subQuery); + return "userId_InScopeSubQuery_RoleMappingList." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _userId_InScopeSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getUserId_InScopeSubQuery_RoutineScheduleMappingList() { + return _userId_InScopeSubQuery_RoutineScheduleMappingListMap; + } + + public String keepUserId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_userId_InScopeSubQuery_RoutineScheduleMappingListMap == null) { + _userId_InScopeSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_RoutineScheduleMappingListMap.size() + 1); + _userId_InScopeSubQuery_RoutineScheduleMappingListMap + .put(key, subQuery); + return "userId_InScopeSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _userId_InScopeSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getUserId_InScopeSubQuery_SingleScheduleMappingList() { + return _userId_InScopeSubQuery_SingleScheduleMappingListMap; + } + + public String keepUserId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_userId_InScopeSubQuery_SingleScheduleMappingListMap == null) { + _userId_InScopeSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_InScopeSubQuery_SingleScheduleMappingListMap.size() + 1); + _userId_InScopeSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "userId_InScopeSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, GroupMappingCQ> _userId_NotInScopeSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getUserId_NotInScopeSubQuery_GroupMappingList() { + return _userId_NotInScopeSubQuery_GroupMappingListMap; + } + + public String keepUserId_NotInScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_userId_NotInScopeSubQuery_GroupMappingListMap == null) { + _userId_NotInScopeSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotInScopeSubQuery_GroupMappingListMap.size() + 1); + _userId_NotInScopeSubQuery_GroupMappingListMap.put(key, subQuery); + return "userId_NotInScopeSubQuery_GroupMappingList." + key; + } + + protected Map<String, RoleMappingCQ> _userId_NotInScopeSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getUserId_NotInScopeSubQuery_RoleMappingList() { + return _userId_NotInScopeSubQuery_RoleMappingListMap; + } + + public String keepUserId_NotInScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_userId_NotInScopeSubQuery_RoleMappingListMap == null) { + _userId_NotInScopeSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotInScopeSubQuery_RoleMappingListMap.size() + 1); + _userId_NotInScopeSubQuery_RoleMappingListMap.put(key, subQuery); + return "userId_NotInScopeSubQuery_RoleMappingList." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _userId_NotInScopeSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getUserId_NotInScopeSubQuery_RoutineScheduleMappingList() { + return _userId_NotInScopeSubQuery_RoutineScheduleMappingListMap; + } + + public String keepUserId_NotInScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_userId_NotInScopeSubQuery_RoutineScheduleMappingListMap == null) { + _userId_NotInScopeSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotInScopeSubQuery_RoutineScheduleMappingListMap + .size() + 1); + _userId_NotInScopeSubQuery_RoutineScheduleMappingListMap.put(key, + subQuery); + return "userId_NotInScopeSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _userId_NotInScopeSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getUserId_NotInScopeSubQuery_SingleScheduleMappingList() { + return _userId_NotInScopeSubQuery_SingleScheduleMappingListMap; + } + + public String keepUserId_NotInScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_userId_NotInScopeSubQuery_SingleScheduleMappingListMap == null) { + _userId_NotInScopeSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotInScopeSubQuery_SingleScheduleMappingListMap + .size() + 1); + _userId_NotInScopeSubQuery_SingleScheduleMappingListMap.put(key, + subQuery); + return "userId_NotInScopeSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, GroupMappingCQ> _userId_ExistsSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getUserId_ExistsSubQuery_GroupMappingList() { + return _userId_ExistsSubQuery_GroupMappingListMap; + } + + public String keepUserId_ExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_userId_ExistsSubQuery_GroupMappingListMap == null) { + _userId_ExistsSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_ExistsSubQuery_GroupMappingListMap.size() + 1); + _userId_ExistsSubQuery_GroupMappingListMap.put(key, subQuery); + return "userId_ExistsSubQuery_GroupMappingList." + key; + } + + protected Map<String, RoleMappingCQ> _userId_ExistsSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getUserId_ExistsSubQuery_RoleMappingList() { + return _userId_ExistsSubQuery_RoleMappingListMap; + } + + public String keepUserId_ExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_userId_ExistsSubQuery_RoleMappingListMap == null) { + _userId_ExistsSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_ExistsSubQuery_RoleMappingListMap.size() + 1); + _userId_ExistsSubQuery_RoleMappingListMap.put(key, subQuery); + return "userId_ExistsSubQuery_RoleMappingList." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _userId_ExistsSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getUserId_ExistsSubQuery_RoutineScheduleMappingList() { + return _userId_ExistsSubQuery_RoutineScheduleMappingListMap; + } + + public String keepUserId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_userId_ExistsSubQuery_RoutineScheduleMappingListMap == null) { + _userId_ExistsSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_ExistsSubQuery_RoutineScheduleMappingListMap.size() + 1); + _userId_ExistsSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "userId_ExistsSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _userId_ExistsSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getUserId_ExistsSubQuery_SingleScheduleMappingList() { + return _userId_ExistsSubQuery_SingleScheduleMappingListMap; + } + + public String keepUserId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_userId_ExistsSubQuery_SingleScheduleMappingListMap == null) { + _userId_ExistsSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_ExistsSubQuery_SingleScheduleMappingListMap.size() + 1); + _userId_ExistsSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "userId_ExistsSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, GroupMappingCQ> _userId_NotExistsSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getUserId_NotExistsSubQuery_GroupMappingList() { + return _userId_NotExistsSubQuery_GroupMappingListMap; + } + + public String keepUserId_NotExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_userId_NotExistsSubQuery_GroupMappingListMap == null) { + _userId_NotExistsSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotExistsSubQuery_GroupMappingListMap.size() + 1); + _userId_NotExistsSubQuery_GroupMappingListMap.put(key, subQuery); + return "userId_NotExistsSubQuery_GroupMappingList." + key; + } + + protected Map<String, RoleMappingCQ> _userId_NotExistsSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getUserId_NotExistsSubQuery_RoleMappingList() { + return _userId_NotExistsSubQuery_RoleMappingListMap; + } + + public String keepUserId_NotExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_userId_NotExistsSubQuery_RoleMappingListMap == null) { + _userId_NotExistsSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotExistsSubQuery_RoleMappingListMap.size() + 1); + _userId_NotExistsSubQuery_RoleMappingListMap.put(key, subQuery); + return "userId_NotExistsSubQuery_RoleMappingList." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _userId_NotExistsSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getUserId_NotExistsSubQuery_RoutineScheduleMappingList() { + return _userId_NotExistsSubQuery_RoutineScheduleMappingListMap; + } + + public String keepUserId_NotExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_userId_NotExistsSubQuery_RoutineScheduleMappingListMap == null) { + _userId_NotExistsSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotExistsSubQuery_RoutineScheduleMappingListMap + .size() + 1); + _userId_NotExistsSubQuery_RoutineScheduleMappingListMap.put(key, + subQuery); + return "userId_NotExistsSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _userId_NotExistsSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getUserId_NotExistsSubQuery_SingleScheduleMappingList() { + return _userId_NotExistsSubQuery_SingleScheduleMappingListMap; + } + + public String keepUserId_NotExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_userId_NotExistsSubQuery_SingleScheduleMappingListMap == null) { + _userId_NotExistsSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_NotExistsSubQuery_SingleScheduleMappingListMap + .size() + 1); + _userId_NotExistsSubQuery_SingleScheduleMappingListMap.put(key, + subQuery); + return "userId_NotExistsSubQuery_SingleScheduleMappingList." + key; + } + + protected Map<String, GroupMappingCQ> _userId_DeriveSubQuery_GroupMappingListMap; + + public Map<String, GroupMappingCQ> getUserId_DeriveSubQuery_GroupMappingList() { + return _userId_DeriveSubQuery_GroupMappingListMap; + } + + public String keepUserId_DeriveSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + if (_userId_DeriveSubQuery_GroupMappingListMap == null) { + _userId_DeriveSubQuery_GroupMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_DeriveSubQuery_GroupMappingListMap.size() + 1); + _userId_DeriveSubQuery_GroupMappingListMap.put(key, subQuery); + return "userId_DeriveSubQuery_GroupMappingList." + key; + } + + protected Map<String, RoleMappingCQ> _userId_DeriveSubQuery_RoleMappingListMap; + + public Map<String, RoleMappingCQ> getUserId_DeriveSubQuery_RoleMappingList() { + return _userId_DeriveSubQuery_RoleMappingListMap; + } + + public String keepUserId_DeriveSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + if (_userId_DeriveSubQuery_RoleMappingListMap == null) { + _userId_DeriveSubQuery_RoleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_DeriveSubQuery_RoleMappingListMap.size() + 1); + _userId_DeriveSubQuery_RoleMappingListMap.put(key, subQuery); + return "userId_DeriveSubQuery_RoleMappingList." + key; + } + + protected Map<String, RoutineScheduleMappingCQ> _userId_DeriveSubQuery_RoutineScheduleMappingListMap; + + public Map<String, RoutineScheduleMappingCQ> getUserId_DeriveSubQuery_RoutineScheduleMappingList() { + return _userId_DeriveSubQuery_RoutineScheduleMappingListMap; + } + + public String keepUserId_DeriveSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + if (_userId_DeriveSubQuery_RoutineScheduleMappingListMap == null) { + _userId_DeriveSubQuery_RoutineScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_DeriveSubQuery_RoutineScheduleMappingListMap.size() + 1); + _userId_DeriveSubQuery_RoutineScheduleMappingListMap.put(key, subQuery); + return "userId_DeriveSubQuery_RoutineScheduleMappingList." + key; + } + + protected Map<String, SingleScheduleMappingCQ> _userId_DeriveSubQuery_SingleScheduleMappingListMap; + + public Map<String, SingleScheduleMappingCQ> getUserId_DeriveSubQuery_SingleScheduleMappingList() { + return _userId_DeriveSubQuery_SingleScheduleMappingListMap; + } + + public String keepUserId_DeriveSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + if (_userId_DeriveSubQuery_SingleScheduleMappingListMap == null) { + _userId_DeriveSubQuery_SingleScheduleMappingListMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_userId_DeriveSubQuery_SingleScheduleMappingListMap.size() + 1); + _userId_DeriveSubQuery_SingleScheduleMappingListMap.put(key, subQuery); + return "userId_DeriveSubQuery_SingleScheduleMappingList." + key; + } + + public BsUserInfoCQ addOrderBy_UserId_Asc() { + regOBA("USER_ID"); + return this; + } + + public BsUserInfoCQ addOrderBy_UserId_Desc() { + regOBD("USER_ID"); + return this; + } + + protected ConditionValue _givenName; + + public ConditionValue getGivenName() { + if (_givenName == null) { + _givenName = new ConditionValue(); + } + return _givenName; + } + + protected ConditionValue getCValueGivenName() { + return getGivenName(); + } + + public BsUserInfoCQ addOrderBy_GivenName_Asc() { + regOBA("GIVEN_NAME"); + return this; + } + + public BsUserInfoCQ addOrderBy_GivenName_Desc() { + regOBD("GIVEN_NAME"); + return this; + } + + protected ConditionValue _familyName; + + public ConditionValue getFamilyName() { + if (_familyName == null) { + _familyName = new ConditionValue(); + } + return _familyName; + } + + protected ConditionValue getCValueFamilyName() { + return getFamilyName(); + } + + public BsUserInfoCQ addOrderBy_FamilyName_Asc() { + regOBA("FAMILY_NAME"); + return this; + } + + public BsUserInfoCQ addOrderBy_FamilyName_Desc() { + regOBD("FAMILY_NAME"); + return this; + } + + protected ConditionValue _middleName; + + public ConditionValue getMiddleName() { + if (_middleName == null) { + _middleName = new ConditionValue(); + } + return _middleName; + } + + protected ConditionValue getCValueMiddleName() { + return getMiddleName(); + } + + public BsUserInfoCQ addOrderBy_MiddleName_Asc() { + regOBA("MIDDLE_NAME"); + return this; + } + + public BsUserInfoCQ addOrderBy_MiddleName_Desc() { + regOBD("MIDDLE_NAME"); + return this; + } + + protected ConditionValue _givenNameDesc; + + public ConditionValue getGivenNameDesc() { + if (_givenNameDesc == null) { + _givenNameDesc = new ConditionValue(); + } + return _givenNameDesc; + } + + protected ConditionValue getCValueGivenNameDesc() { + return getGivenNameDesc(); + } + + public BsUserInfoCQ addOrderBy_GivenNameDesc_Asc() { + regOBA("GIVEN_NAME_DESC"); + return this; + } + + public BsUserInfoCQ addOrderBy_GivenNameDesc_Desc() { + regOBD("GIVEN_NAME_DESC"); + return this; + } + + protected ConditionValue _familyNameDesc; + + public ConditionValue getFamilyNameDesc() { + if (_familyNameDesc == null) { + _familyNameDesc = new ConditionValue(); + } + return _familyNameDesc; + } + + protected ConditionValue getCValueFamilyNameDesc() { + return getFamilyNameDesc(); + } + + public BsUserInfoCQ addOrderBy_FamilyNameDesc_Asc() { + regOBA("FAMILY_NAME_DESC"); + return this; + } + + public BsUserInfoCQ addOrderBy_FamilyNameDesc_Desc() { + regOBD("FAMILY_NAME_DESC"); + return this; + } + + protected ConditionValue _nickname; + + public ConditionValue getNickname() { + if (_nickname == null) { + _nickname = new ConditionValue(); + } + return _nickname; + } + + protected ConditionValue getCValueNickname() { + return getNickname(); + } + + public BsUserInfoCQ addOrderBy_Nickname_Asc() { + regOBA("NICKNAME"); + return this; + } + + public BsUserInfoCQ addOrderBy_Nickname_Desc() { + regOBD("NICKNAME"); + return this; + } + + protected ConditionValue _gender; + + public ConditionValue getGender() { + if (_gender == null) { + _gender = new ConditionValue(); + } + return _gender; + } + + protected ConditionValue getCValueGender() { + return getGender(); + } + + public BsUserInfoCQ addOrderBy_Gender_Asc() { + regOBA("GENDER"); + return this; + } + + public BsUserInfoCQ addOrderBy_Gender_Desc() { + regOBD("GENDER"); + return this; + } + + protected ConditionValue _birthDate; + + public ConditionValue getBirthDate() { + if (_birthDate == null) { + _birthDate = new ConditionValue(); + } + return _birthDate; + } + + protected ConditionValue getCValueBirthDate() { + return getBirthDate(); + } + + public BsUserInfoCQ addOrderBy_BirthDate_Asc() { + regOBA("BIRTH_DATE"); + return this; + } + + public BsUserInfoCQ addOrderBy_BirthDate_Desc() { + regOBD("BIRTH_DATE"); + return this; + } + + protected ConditionValue _email; + + public ConditionValue getEmail() { + if (_email == null) { + _email = new ConditionValue(); + } + return _email; + } + + protected ConditionValue getCValueEmail() { + return getEmail(); + } + + public BsUserInfoCQ addOrderBy_Email_Asc() { + regOBA("EMAIL"); + return this; + } + + public BsUserInfoCQ addOrderBy_Email_Desc() { + regOBD("EMAIL"); + return this; + } + + protected ConditionValue _url; + + public ConditionValue getUrl() { + if (_url == null) { + _url = new ConditionValue(); + } + return _url; + } + + protected ConditionValue getCValueUrl() { + return getUrl(); + } + + public BsUserInfoCQ addOrderBy_Url_Asc() { + regOBA("URL"); + return this; + } + + public BsUserInfoCQ addOrderBy_Url_Desc() { + regOBD("URL"); + return this; + } + + protected ConditionValue _telephone; + + public ConditionValue getTelephone() { + if (_telephone == null) { + _telephone = new ConditionValue(); + } + return _telephone; + } + + protected ConditionValue getCValueTelephone() { + return getTelephone(); + } + + public BsUserInfoCQ addOrderBy_Telephone_Asc() { + regOBA("TELEPHONE"); + return this; + } + + public BsUserInfoCQ addOrderBy_Telephone_Desc() { + regOBD("TELEPHONE"); + return this; + } + + protected ConditionValue _roleId; + + public ConditionValue getRoleId() { + if (_roleId == null) { + _roleId = new ConditionValue(); + } + return _roleId; + } + + protected ConditionValue getCValueRoleId() { + return getRoleId(); + } + + protected Map<String, RoleInfoCQ> _roleId_InScopeSubQuery_RoleInfoMap; + + public Map<String, RoleInfoCQ> getRoleId_InScopeSubQuery_RoleInfo() { + return _roleId_InScopeSubQuery_RoleInfoMap; + } + + public String keepRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ subQuery) { + if (_roleId_InScopeSubQuery_RoleInfoMap == null) { + _roleId_InScopeSubQuery_RoleInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_roleId_InScopeSubQuery_RoleInfoMap.size() + 1); + _roleId_InScopeSubQuery_RoleInfoMap.put(key, subQuery); + return "roleId_InScopeSubQuery_RoleInfo." + key; + } + + public BsUserInfoCQ addOrderBy_RoleId_Asc() { + regOBA("ROLE_ID"); + return this; + } + + public BsUserInfoCQ addOrderBy_RoleId_Desc() { + regOBD("ROLE_ID"); + return this; + } + + protected ConditionValue _groupId; + + public ConditionValue getGroupId() { + if (_groupId == null) { + _groupId = new ConditionValue(); + } + return _groupId; + } + + protected ConditionValue getCValueGroupId() { + return getGroupId(); + } + + protected Map<String, GroupInfoCQ> _groupId_InScopeSubQuery_GroupInfoMap; + + public Map<String, GroupInfoCQ> getGroupId_InScopeSubQuery_GroupInfo() { + return _groupId_InScopeSubQuery_GroupInfoMap; + } + + public String keepGroupId_InScopeSubQuery_GroupInfo(GroupInfoCQ subQuery) { + if (_groupId_InScopeSubQuery_GroupInfoMap == null) { + _groupId_InScopeSubQuery_GroupInfoMap = newLinkedHashMap(); + } + String key = "subQueryMapKey" + + (_groupId_InScopeSubQuery_GroupInfoMap.size() + 1); + _groupId_InScopeSubQuery_GroupInfoMap.put(key, subQuery); + return "groupId_InScopeSubQuery_GroupInfo." + key; + } + + public BsUserInfoCQ addOrderBy_GroupId_Asc() { + regOBA("GROUP_ID"); + return this; + } + + public BsUserInfoCQ addOrderBy_GroupId_Desc() { + regOBD("GROUP_ID"); + return this; + } + + protected ConditionValue _createdTime; + + public ConditionValue getCreatedTime() { + if (_createdTime == null) { + _createdTime = new ConditionValue(); + } + return _createdTime; + } + + protected ConditionValue getCValueCreatedTime() { + return getCreatedTime(); + } + + public BsUserInfoCQ addOrderBy_CreatedTime_Asc() { + regOBA("CREATED_TIME"); + return this; + } + + public BsUserInfoCQ addOrderBy_CreatedTime_Desc() { + regOBD("CREATED_TIME"); + return this; + } + + protected ConditionValue _createdBy; + + public ConditionValue getCreatedBy() { + if (_createdBy == null) { + _createdBy = new ConditionValue(); + } + return _createdBy; + } + + protected ConditionValue getCValueCreatedBy() { + return getCreatedBy(); + } + + public BsUserInfoCQ addOrderBy_CreatedBy_Asc() { + regOBA("CREATED_BY"); + return this; + } + + public BsUserInfoCQ addOrderBy_CreatedBy_Desc() { + regOBD("CREATED_BY"); + return this; + } + + protected ConditionValue _updatedTime; + + public ConditionValue getUpdatedTime() { + if (_updatedTime == null) { + _updatedTime = new ConditionValue(); + } + return _updatedTime; + } + + protected ConditionValue getCValueUpdatedTime() { + return getUpdatedTime(); + } + + public BsUserInfoCQ addOrderBy_UpdatedTime_Asc() { + regOBA("UPDATED_TIME"); + return this; + } + + public BsUserInfoCQ addOrderBy_UpdatedTime_Desc() { + regOBD("UPDATED_TIME"); + return this; + } + + protected ConditionValue _updatedBy; + + public ConditionValue getUpdatedBy() { + if (_updatedBy == null) { + _updatedBy = new ConditionValue(); + } + return _updatedBy; + } + + protected ConditionValue getCValueUpdatedBy() { + return getUpdatedBy(); + } + + public BsUserInfoCQ addOrderBy_UpdatedBy_Asc() { + regOBA("UPDATED_BY"); + return this; + } + + public BsUserInfoCQ addOrderBy_UpdatedBy_Desc() { + regOBD("UPDATED_BY"); + return this; + } + + protected ConditionValue _deletedTime; + + public ConditionValue getDeletedTime() { + if (_deletedTime == null) { + _deletedTime = new ConditionValue(); + } + return _deletedTime; + } + + protected ConditionValue getCValueDeletedTime() { + return getDeletedTime(); + } + + public BsUserInfoCQ addOrderBy_DeletedTime_Asc() { + regOBA("DELETED_TIME"); + return this; + } + + public BsUserInfoCQ addOrderBy_DeletedTime_Desc() { + regOBD("DELETED_TIME"); + return this; + } + + protected ConditionValue _deletedBy; + + public ConditionValue getDeletedBy() { + if (_deletedBy == null) { + _deletedBy = new ConditionValue(); + } + return _deletedBy; + } + + protected ConditionValue getCValueDeletedBy() { + return getDeletedBy(); + } + + public BsUserInfoCQ addOrderBy_DeletedBy_Asc() { + regOBA("DELETED_BY"); + return this; + } + + public BsUserInfoCQ addOrderBy_DeletedBy_Desc() { + regOBD("DELETED_BY"); + return this; + } + + protected ConditionValue _versionno; + + public ConditionValue getVersionno() { + if (_versionno == null) { + _versionno = new ConditionValue(); + } + return _versionno; + } + + protected ConditionValue getCValueVersionno() { + return getVersionno(); + } + + public BsUserInfoCQ addOrderBy_Versionno_Asc() { + regOBA("VERSIONNO"); + return this; + } + + public BsUserInfoCQ addOrderBy_Versionno_Desc() { + regOBD("VERSIONNO"); + return this; + } + + //========================================================================== + // ========= + // Specified Derived OrderBy + // ========================= + public BsUserInfoCQ addSpecifiedDerivedOrderBy_Asc(String aliasName) { + registerSpecifiedDerivedOrderBy_Asc(aliasName); + return this; + } + + public BsUserInfoCQ addSpecifiedDerivedOrderBy_Desc(String aliasName) { + registerSpecifiedDerivedOrderBy_Desc(aliasName); + return this; + } + + //========================================================================== + // ========= + // Union Query + // =========== + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + UserInfoCQ baseQuery = (UserInfoCQ) baseQueryAsSuper; + UserInfoCQ unionQuery = (UserInfoCQ) unionQueryAsSuper; + if (baseQuery.hasConditionQueryGroupInfo()) { + unionQuery.queryGroupInfo().reflectRelationOnUnionQuery( + baseQuery.queryGroupInfo(), unionQuery.queryGroupInfo()); + } + if (baseQuery.hasConditionQueryRoleInfo()) { + unionQuery.queryRoleInfo().reflectRelationOnUnionQuery( + baseQuery.queryRoleInfo(), unionQuery.queryRoleInfo()); + } + } + + //========================================================================== + // ========= + // Foreign Query + // ============= + + public GroupInfoCQ queryGroupInfo() { + return getConditionQueryGroupInfo(); + } + + protected GroupInfoCQ _conditionQueryGroupInfo; + + public GroupInfoCQ getConditionQueryGroupInfo() { + if (_conditionQueryGroupInfo == null) { + _conditionQueryGroupInfo = createQueryGroupInfo(); + setupOuterJoin_GroupInfo(); + } + 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() { + String nrp = resolveNextRelationPath("USER_INFO", "groupInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + GroupInfoCQ cq = new GroupInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("groupInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryGroupInfo() { + return _conditionQueryGroupInfo != null; + } + + public RoleInfoCQ queryRoleInfo() { + return getConditionQueryRoleInfo(); + } + + protected RoleInfoCQ _conditionQueryRoleInfo; + + public RoleInfoCQ getConditionQueryRoleInfo() { + if (_conditionQueryRoleInfo == null) { + _conditionQueryRoleInfo = createQueryRoleInfo(); + setupOuterJoin_RoleInfo(); + } + 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() { + String nrp = resolveNextRelationPath("USER_INFO", "roleInfo"); + String jan = resolveJoinAliasName(nrp, getNextNestLevel()); + RoleInfoCQ cq = new RoleInfoCQ(this, getSqlClause(), jan, + getNextNestLevel()); + cq.xsetForeignPropertyName("roleInfo"); + cq.xsetRelationPath(nrp); + return cq; + } + + public boolean hasConditionQueryRoleInfo() { + return _conditionQueryRoleInfo != null; + } + + protected String getConditionQueryClassNameInternally() { + return UserInfoCQ.class.getName(); + } + + protected String getMapClassNameInternally() { + return Map.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/bs/BsUserInfoCQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupInfoCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupInfoCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupInfoCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,202 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsGroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsGroupInfoCQ; + +/** + * The condition-inline-query of GROUP_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfoCIQ extends AbstractBsGroupInfoCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsGroupInfoCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public GroupInfoCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsGroupInfoCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueGroupId() { + return _myCQ.getGroupId(); + } + + public String keepGroupId_InScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + return _myCQ.keepGroupId_InScopeSubQuery_GroupMappingList(subQuery); + } + + public String keepGroupId_InScopeSubQuery_UserInfoList(UserInfoCQ subQuery) { + return _myCQ.keepGroupId_InScopeSubQuery_UserInfoList(subQuery); + } + + public String keepGroupId_NotInScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + return _myCQ.keepGroupId_NotInScopeSubQuery_GroupMappingList(subQuery); + } + + public String keepGroupId_NotInScopeSubQuery_UserInfoList( + UserInfoCQ subQuery) { + return _myCQ.keepGroupId_NotInScopeSubQuery_UserInfoList(subQuery); + } + + public String keepGroupId_ExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepGroupId_ExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepGroupId_NotExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepGroupId_NotExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepGroupId_DeriveSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepGroupId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueName() { + return _myCQ.getName(); + } + + protected ConditionValue getCValueDescription() { + return _myCQ.getDescription(); + } + + protected ConditionValue getCValueEmail() { + return _myCQ.getEmail(); + } + + protected ConditionValue getCValueUrl() { + return _myCQ.getUrl(); + } + + protected ConditionValue getCValueTelephone() { + return _myCQ.getTelephone(); + } + + protected ConditionValue getCValueCreatedTime() { + return _myCQ.getCreatedTime(); + } + + protected ConditionValue getCValueCreatedBy() { + return _myCQ.getCreatedBy(); + } + + protected ConditionValue getCValueUpdatedTime() { + return _myCQ.getUpdatedTime(); + } + + protected ConditionValue getCValueUpdatedBy() { + return _myCQ.getUpdatedBy(); + } + + protected ConditionValue getCValueDeletedTime() { + return _myCQ.getDeletedTime(); + } + + protected ConditionValue getCValueDeletedBy() { + return _myCQ.getDeletedBy(); + } + + protected ConditionValue getCValueVersionno() { + return _myCQ.getVersionno(); + } + + protected String getConditionQueryClassNameInternally() { + return GroupInfoCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupInfoCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupMappingCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupMappingCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupMappingCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,118 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsGroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsGroupMappingCQ; + +/** + * The condition-inline-query of GROUP_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMappingCIQ extends AbstractBsGroupMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsGroupMappingCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public GroupMappingCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsGroupMappingCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + protected ConditionValue getCValueUserId() { + return _myCQ.getUserId(); + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + return _myCQ.keepUserId_InScopeSubQuery_UserInfo(subQuery); + } + + protected ConditionValue getCValueGroupId() { + return _myCQ.getGroupId(); + } + + public String keepGroupId_InScopeSubQuery_GroupInfo(GroupInfoCQ subQuery) { + return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); + } + + protected String getConditionQueryClassNameInternally() { + return GroupMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/GroupMappingCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleInfoCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleInfoCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleInfoCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,201 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsRoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoleInfoCQ; + +/** + * The condition-inline-query of ROLE_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfoCIQ extends AbstractBsRoleInfoCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsRoleInfoCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public RoleInfoCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsRoleInfoCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueRoleId() { + return _myCQ.getRoleId(); + } + + public String keepRoleId_InScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + return _myCQ.keepRoleId_InScopeSubQuery_RoleMappingList(subQuery); + } + + public String keepRoleId_InScopeSubQuery_UserInfoList(UserInfoCQ subQuery) { + return _myCQ.keepRoleId_InScopeSubQuery_UserInfoList(subQuery); + } + + public String keepRoleId_NotInScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + return _myCQ.keepRoleId_NotInScopeSubQuery_RoleMappingList(subQuery); + } + + public String keepRoleId_NotInScopeSubQuery_UserInfoList(UserInfoCQ subQuery) { + return _myCQ.keepRoleId_NotInScopeSubQuery_UserInfoList(subQuery); + } + + public String keepRoleId_ExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepRoleId_ExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepRoleId_NotExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepRoleId_NotExistsSubQuery_UserInfoList(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepRoleId_DeriveSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepRoleId_DeriveSubQuery_UserInfoList(UserInfoCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueName() { + return _myCQ.getName(); + } + + protected ConditionValue getCValueDescription() { + return _myCQ.getDescription(); + } + + protected ConditionValue getCValueEmail() { + return _myCQ.getEmail(); + } + + protected ConditionValue getCValueUrl() { + return _myCQ.getUrl(); + } + + protected ConditionValue getCValueTelephone() { + return _myCQ.getTelephone(); + } + + protected ConditionValue getCValueCreatedTime() { + return _myCQ.getCreatedTime(); + } + + protected ConditionValue getCValueCreatedBy() { + return _myCQ.getCreatedBy(); + } + + protected ConditionValue getCValueUpdatedTime() { + return _myCQ.getUpdatedTime(); + } + + protected ConditionValue getCValueUpdatedBy() { + return _myCQ.getUpdatedBy(); + } + + protected ConditionValue getCValueDeletedTime() { + return _myCQ.getDeletedTime(); + } + + protected ConditionValue getCValueDeletedBy() { + return _myCQ.getDeletedBy(); + } + + protected ConditionValue getCValueVersionno() { + return _myCQ.getVersionno(); + } + + protected String getConditionQueryClassNameInternally() { + return RoleInfoCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleInfoCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleMappingCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleMappingCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleMappingCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,118 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsRoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoleMappingCQ; + +/** + * The condition-inline-query of ROLE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMappingCIQ extends AbstractBsRoleMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsRoleMappingCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public RoleMappingCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsRoleMappingCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + protected ConditionValue getCValueUserId() { + return _myCQ.getUserId(); + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + return _myCQ.keepUserId_InScopeSubQuery_UserInfo(subQuery); + } + + protected ConditionValue getCValueRoleId() { + return _myCQ.getRoleId(); + } + + public String keepRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ subQuery) { + return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); + } + + protected String getConditionQueryClassNameInternally() { + return RoleMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoleMappingCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,212 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsRoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoutineScheduleCQ; + +/** + * The condition-inline-query of ROUTINE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleCIQ extends AbstractBsRoutineScheduleCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsRoutineScheduleCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public RoutineScheduleCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsRoutineScheduleCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + public String keepId_InScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + return _myCQ + .keepId_InScopeSubQuery_RoutineScheduleContentAsOne(subQuery); + } + + public String keepId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + return _myCQ + .keepId_InScopeSubQuery_RoutineScheduleMappingList(subQuery); + } + + public String keepId_NotInScopeSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + return _myCQ + .keepId_NotInScopeSubQuery_RoutineScheduleContentAsOne(subQuery); + } + + public String keepId_NotInScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + return _myCQ + .keepId_NotInScopeSubQuery_RoutineScheduleMappingList(subQuery); + } + + public String keepId_ExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_NotExistsSubQuery_RoutineScheduleContentAsOne( + RoutineScheduleContentCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_NotExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_DeriveSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueTitle() { + return _myCQ.getTitle(); + } + + protected ConditionValue getCValueLocation() { + return _myCQ.getLocation(); + } + + protected ConditionValue getCValueStartDate() { + return _myCQ.getStartDate(); + } + + protected ConditionValue getCValueStartTime() { + return _myCQ.getStartTime(); + } + + protected ConditionValue getCValueEndDate() { + return _myCQ.getEndDate(); + } + + protected ConditionValue getCValueEndTime() { + return _myCQ.getEndTime(); + } + + protected ConditionValue getCValueType() { + return _myCQ.getType(); + } + + protected ConditionValue getCValueCreatedTime() { + return _myCQ.getCreatedTime(); + } + + protected ConditionValue getCValueCreatedBy() { + return _myCQ.getCreatedBy(); + } + + protected ConditionValue getCValueUpdatedTime() { + return _myCQ.getUpdatedTime(); + } + + protected ConditionValue getCValueUpdatedBy() { + return _myCQ.getUpdatedBy(); + } + + protected ConditionValue getCValueDeletedTime() { + return _myCQ.getDeletedTime(); + } + + protected ConditionValue getCValueDeletedBy() { + return _myCQ.getDeletedBy(); + } + + protected ConditionValue getCValueVersionno() { + return _myCQ.getVersionno(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleContentCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleContentCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleContentCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,112 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsRoutineScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoutineScheduleContentCQ; + +/** + * The condition-inline-query of ROUTINE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContentCIQ extends + AbstractBsRoutineScheduleContentCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsRoutineScheduleContentCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public RoutineScheduleContentCIQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel, + BsRoutineScheduleContentCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + public String keepId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_RoutineSchedule(subQuery); + } + + protected ConditionValue getCValueContent() { + return _myCQ.getContent(); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleContentCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleContentCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleMappingCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleMappingCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleMappingCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,121 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsRoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsRoutineScheduleMappingCQ; + +/** + * The condition-inline-query of ROUTINE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMappingCIQ extends + AbstractBsRoutineScheduleMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsRoutineScheduleMappingCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public RoutineScheduleMappingCIQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel, + BsRoutineScheduleMappingCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + protected ConditionValue getCValueScheduleId() { + return _myCQ.getScheduleId(); + } + + public String keepScheduleId_InScopeSubQuery_RoutineSchedule( + RoutineScheduleCQ subQuery) { + return _myCQ.keepScheduleId_InScopeSubQuery_RoutineSchedule(subQuery); + } + + protected ConditionValue getCValueUserId() { + return _myCQ.getUserId(); + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + return _myCQ.keepUserId_InScopeSubQuery_UserInfo(subQuery); + } + + protected String getConditionQueryClassNameInternally() { + return RoutineScheduleMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/RoutineScheduleMappingCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,207 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsSingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsSingleScheduleCQ; + +/** + * The condition-inline-query of SINGLE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleCIQ extends AbstractBsSingleScheduleCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsSingleScheduleCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public SingleScheduleCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsSingleScheduleCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + public String keepId_InScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + return _myCQ + .keepId_InScopeSubQuery_SingleScheduleContentAsOne(subQuery); + } + + public String keepId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_SingleScheduleMappingList(subQuery); + } + + public String keepId_NotInScopeSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + return _myCQ + .keepId_NotInScopeSubQuery_SingleScheduleContentAsOne(subQuery); + } + + public String keepId_NotInScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + return _myCQ + .keepId_NotInScopeSubQuery_SingleScheduleMappingList(subQuery); + } + + public String keepId_ExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_NotExistsSubQuery_SingleScheduleContentAsOne( + SingleScheduleContentCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_NotExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepId_DeriveSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueTitle() { + return _myCQ.getTitle(); + } + + protected ConditionValue getCValueLocation() { + return _myCQ.getLocation(); + } + + protected ConditionValue getCValueStartDate() { + return _myCQ.getStartDate(); + } + + protected ConditionValue getCValueStartTime() { + return _myCQ.getStartTime(); + } + + protected ConditionValue getCValueEndDate() { + return _myCQ.getEndDate(); + } + + protected ConditionValue getCValueEndTime() { + return _myCQ.getEndTime(); + } + + protected ConditionValue getCValueCreatedTime() { + return _myCQ.getCreatedTime(); + } + + protected ConditionValue getCValueCreatedBy() { + return _myCQ.getCreatedBy(); + } + + protected ConditionValue getCValueUpdatedTime() { + return _myCQ.getUpdatedTime(); + } + + protected ConditionValue getCValueUpdatedBy() { + return _myCQ.getUpdatedBy(); + } + + protected ConditionValue getCValueDeletedTime() { + return _myCQ.getDeletedTime(); + } + + protected ConditionValue getCValueDeletedBy() { + return _myCQ.getDeletedBy(); + } + + protected ConditionValue getCValueVersionno() { + return _myCQ.getVersionno(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleContentCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleContentCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleContentCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,111 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsSingleScheduleContentCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsSingleScheduleContentCQ; + +/** + * The condition-inline-query of SINGLE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContentCIQ extends AbstractBsSingleScheduleContentCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsSingleScheduleContentCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public SingleScheduleContentCIQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel, + BsSingleScheduleContentCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + public String keepId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ subQuery) { + return _myCQ.keepId_InScopeSubQuery_SingleSchedule(subQuery); + } + + protected ConditionValue getCValueContent() { + return _myCQ.getContent(); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleContentCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleContentCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleMappingCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleMappingCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleMappingCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,120 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsSingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsSingleScheduleMappingCQ; + +/** + * The condition-inline-query of SINGLE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMappingCIQ extends AbstractBsSingleScheduleMappingCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsSingleScheduleMappingCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public SingleScheduleMappingCIQ(ConditionQuery childQuery, + SqlClause sqlClause, String aliasName, int nestLevel, + BsSingleScheduleMappingCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueId() { + return _myCQ.getId(); + } + + protected ConditionValue getCValueScheduleId() { + return _myCQ.getScheduleId(); + } + + public String keepScheduleId_InScopeSubQuery_SingleSchedule( + SingleScheduleCQ subQuery) { + return _myCQ.keepScheduleId_InScopeSubQuery_SingleSchedule(subQuery); + } + + protected ConditionValue getCValueUserId() { + return _myCQ.getUserId(); + } + + public String keepUserId_InScopeSubQuery_UserInfo(UserInfoCQ subQuery) { + return _myCQ.keepUserId_InScopeSubQuery_UserInfo(subQuery); + } + + protected String getConditionQueryClassNameInternally() { + return SingleScheduleMappingCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/SingleScheduleMappingCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/UserInfoCIQ.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/UserInfoCIQ.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/UserInfoCIQ.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,310 @@ +package jp.sf.pal.scheduler.db.cbean.cq.ciq; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.allcommon.cbean.ckey.ConditionKey; +import jp.sf.pal.scheduler.db.allcommon.cbean.coption.ConditionOption; +import jp.sf.pal.scheduler.db.allcommon.cbean.cvalue.ConditionValue; +import jp.sf.pal.scheduler.db.allcommon.cbean.sqlclause.SqlClause; +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.AbstractBsUserInfoCQ; +import jp.sf.pal.scheduler.db.cbean.cq.bs.BsUserInfoCQ; + +/** + * The condition-inline-query of USER_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfoCIQ extends AbstractBsUserInfoCQ { + + //========================================================================== + // ========= + // Attribute + // ========= + protected BsUserInfoCQ _myCQ; + + //========================================================================== + // ========= + // Constructor + // =========== + public UserInfoCIQ(ConditionQuery childQuery, SqlClause sqlClause, + String aliasName, int nestLevel, BsUserInfoCQ myCQ) { + super(childQuery, sqlClause, aliasName, nestLevel); + _myCQ = myCQ; + _foreignPropertyName = _myCQ.getForeignPropertyName();// Accept foreign + // property name. + _relationPath = _myCQ.getRelationPath();// Accept relation path. + } + + //========================================================================== + // ========= + // Override about Register + // ======================= + @Override + protected void reflectRelationOnUnionQuery(ConditionQuery baseQueryAsSuper, + ConditionQuery unionQueryAsSuper) { + throw new UnsupportedOperationException( + "InlineQuery must not need UNION method: " + baseQueryAsSuper + + " : " + unionQueryAsSuper); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName); + } + + @Override + protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, + Object value, ConditionValue cvalue, String colName, + String capPropName, String uncapPropName, ConditionOption option) { + registerInlineQuery(key, value, cvalue, colName, capPropName, + uncapPropName, option); + } + + @Override + protected void registerWhereClause(String whereClause) { + registerInlineWhereClause(whereClause); + } + + @Override + protected String getInScopeSubQueryRealColumnName(String columnName) { + if (_onClauseInline) { + throw new UnsupportedOperationException( + "InScopeSubQuery of on-clause is unsupported"); + } + return _onClauseInline ? getRealAliasName() + "." + columnName + : columnName; + } + + @Override + protected void registerExistsSubQuery(ConditionQuery subQuery, + String columnName, String relatedColumnName, String propertyName) { + throw new UnsupportedOperationException( + "Sorry! ExistsSubQuery at inline view is unsupported. So please use InScopeSubQyery."); + } + + //========================================================================== + // ========= + // Override about Query + // ==================== + protected ConditionValue getCValueUserId() { + return _myCQ.getUserId(); + } + + public String keepUserId_InScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + return _myCQ.keepUserId_InScopeSubQuery_GroupMappingList(subQuery); + } + + public String keepUserId_InScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + return _myCQ.keepUserId_InScopeSubQuery_RoleMappingList(subQuery); + } + + public String keepUserId_InScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + return _myCQ + .keepUserId_InScopeSubQuery_RoutineScheduleMappingList(subQuery); + } + + public String keepUserId_InScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + return _myCQ + .keepUserId_InScopeSubQuery_SingleScheduleMappingList(subQuery); + } + + public String keepUserId_NotInScopeSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + return _myCQ.keepUserId_NotInScopeSubQuery_GroupMappingList(subQuery); + } + + public String keepUserId_NotInScopeSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + return _myCQ.keepUserId_NotInScopeSubQuery_RoleMappingList(subQuery); + } + + public String keepUserId_NotInScopeSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + return _myCQ + .keepUserId_NotInScopeSubQuery_RoutineScheduleMappingList(subQuery); + } + + public String keepUserId_NotInScopeSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + return _myCQ + .keepUserId_NotInScopeSubQuery_SingleScheduleMappingList(subQuery); + } + + public String keepUserId_ExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_ExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_ExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_ExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "ExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_NotExistsSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_NotExistsSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_NotExistsSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_NotExistsSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "NotExistsSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_DeriveSubQuery_GroupMappingList( + GroupMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_DeriveSubQuery_RoleMappingList( + RoleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_DeriveSubQuery_RoutineScheduleMappingList( + RoutineScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + public String keepUserId_DeriveSubQuery_SingleScheduleMappingList( + SingleScheduleMappingCQ subQuery) { + throw new UnsupportedOperationException( + "DeriveSubQuery at inline() is unsupported! Sorry!"); + } + + protected ConditionValue getCValueGivenName() { + return _myCQ.getGivenName(); + } + + protected ConditionValue getCValueFamilyName() { + return _myCQ.getFamilyName(); + } + + protected ConditionValue getCValueMiddleName() { + return _myCQ.getMiddleName(); + } + + protected ConditionValue getCValueGivenNameDesc() { + return _myCQ.getGivenNameDesc(); + } + + protected ConditionValue getCValueFamilyNameDesc() { + return _myCQ.getFamilyNameDesc(); + } + + protected ConditionValue getCValueNickname() { + return _myCQ.getNickname(); + } + + protected ConditionValue getCValueGender() { + return _myCQ.getGender(); + } + + protected ConditionValue getCValueBirthDate() { + return _myCQ.getBirthDate(); + } + + protected ConditionValue getCValueEmail() { + return _myCQ.getEmail(); + } + + protected ConditionValue getCValueUrl() { + return _myCQ.getUrl(); + } + + protected ConditionValue getCValueTelephone() { + return _myCQ.getTelephone(); + } + + protected ConditionValue getCValueRoleId() { + return _myCQ.getRoleId(); + } + + public String keepRoleId_InScopeSubQuery_RoleInfo(RoleInfoCQ subQuery) { + return _myCQ.keepRoleId_InScopeSubQuery_RoleInfo(subQuery); + } + + protected ConditionValue getCValueGroupId() { + return _myCQ.getGroupId(); + } + + public String keepGroupId_InScopeSubQuery_GroupInfo(GroupInfoCQ subQuery) { + return _myCQ.keepGroupId_InScopeSubQuery_GroupInfo(subQuery); + } + + protected ConditionValue getCValueCreatedTime() { + return _myCQ.getCreatedTime(); + } + + protected ConditionValue getCValueCreatedBy() { + return _myCQ.getCreatedBy(); + } + + protected ConditionValue getCValueUpdatedTime() { + return _myCQ.getUpdatedTime(); + } + + protected ConditionValue getCValueUpdatedBy() { + return _myCQ.getUpdatedBy(); + } + + protected ConditionValue getCValueDeletedTime() { + return _myCQ.getDeletedTime(); + } + + protected ConditionValue getCValueDeletedBy() { + return _myCQ.getDeletedBy(); + } + + protected ConditionValue getCValueVersionno() { + return _myCQ.getVersionno(); + } + + protected String getConditionQueryClassNameInternally() { + return UserInfoCQ.class.getName(); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/cq/ciq/UserInfoCIQ.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupInfoNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupInfoNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupInfoNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,32 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.cbean.cq.GroupInfoCQ; + +/** + * The nest-select-setupper of GROUP_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfoNss { + + protected GroupInfoCQ _query; + + public GroupInfoNss(GroupInfoCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupInfoNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupMappingNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupMappingNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupMappingNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.GroupMappingCQ; + +/** + * The nest-select-setupper of GROUP_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMappingNss { + + protected GroupMappingCQ _query; + + public GroupMappingNss(GroupMappingCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public GroupInfoNss withGroupInfo() { + _query.doNss(new GroupMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryGroupInfo(); + } + }); + return new GroupInfoNss(_query.queryGroupInfo()); + } + + public UserInfoNss withUserInfo() { + _query.doNss(new GroupMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryUserInfo(); + } + }); + return new UserInfoNss(_query.queryUserInfo()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/GroupMappingNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleInfoNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleInfoNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleInfoNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,32 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.cbean.cq.RoleInfoCQ; + +/** + * The nest-select-setupper of ROLE_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfoNss { + + protected RoleInfoCQ _query; + + public RoleInfoNss(RoleInfoCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleInfoNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleMappingNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleMappingNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleMappingNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.RoleMappingCQ; + +/** + * The nest-select-setupper of ROLE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMappingNss { + + protected RoleMappingCQ _query; + + public RoleMappingNss(RoleMappingCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public RoleInfoNss withRoleInfo() { + _query.doNss(new RoleMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryRoleInfo(); + } + }); + return new RoleInfoNss(_query.queryRoleInfo()); + } + + public UserInfoNss withUserInfo() { + _query.doNss(new RoleMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryUserInfo(); + } + }); + return new UserInfoNss(_query.queryUserInfo()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoleMappingNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleContentNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleContentNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleContentNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,41 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleContentCQ; + +/** + * The nest-select-setupper of ROUTINE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContentNss { + + protected RoutineScheduleContentCQ _query; + + public RoutineScheduleContentNss(RoutineScheduleContentCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public RoutineScheduleNss withRoutineSchedule() { + _query.doNss(new RoutineScheduleContentCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryRoutineSchedule(); + } + }); + return new RoutineScheduleNss(_query.queryRoutineSchedule()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleContentNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleMappingNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleMappingNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleMappingNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleMappingCQ; + +/** + * The nest-select-setupper of ROUTINE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMappingNss { + + protected RoutineScheduleMappingCQ _query; + + public RoutineScheduleMappingNss(RoutineScheduleMappingCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public RoutineScheduleNss withRoutineSchedule() { + _query.doNss(new RoutineScheduleMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryRoutineSchedule(); + } + }); + return new RoutineScheduleNss(_query.queryRoutineSchedule()); + } + + public UserInfoNss withUserInfo() { + _query.doNss(new RoutineScheduleMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryUserInfo(); + } + }); + return new UserInfoNss(_query.queryUserInfo()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleMappingNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,42 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.RoutineScheduleCQ; + +/** + * The nest-select-setupper of ROUTINE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleNss { + + protected RoutineScheduleCQ _query; + + public RoutineScheduleNss(RoutineScheduleCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== + public RoutineScheduleContentNss withRoutineScheduleContentAsOne() { + _query.doNss(new RoutineScheduleCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryRoutineScheduleContentAsOne(); + } + }); + return new RoutineScheduleContentNss(_query + .queryRoutineScheduleContentAsOne()); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/RoutineScheduleNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleContentNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleContentNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleContentNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,41 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleContentCQ; + +/** + * The nest-select-setupper of SINGLE_SCHEDULE_CONTENT. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContentNss { + + protected SingleScheduleContentCQ _query; + + public SingleScheduleContentNss(SingleScheduleContentCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public SingleScheduleNss withSingleSchedule() { + _query.doNss(new SingleScheduleContentCQ.NssCall() { + public ConditionQuery qf() { + return _query.querySingleSchedule(); + } + }); + return new SingleScheduleNss(_query.querySingleSchedule()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleContentNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleMappingNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleMappingNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleMappingNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleMappingCQ; + +/** + * The nest-select-setupper of SINGLE_SCHEDULE_MAPPING. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMappingNss { + + protected SingleScheduleMappingCQ _query; + + public SingleScheduleMappingNss(SingleScheduleMappingCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public SingleScheduleNss withSingleSchedule() { + _query.doNss(new SingleScheduleMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.querySingleSchedule(); + } + }); + return new SingleScheduleNss(_query.querySingleSchedule()); + } + + public UserInfoNss withUserInfo() { + _query.doNss(new SingleScheduleMappingCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryUserInfo(); + } + }); + return new UserInfoNss(_query.queryUserInfo()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleMappingNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,42 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.SingleScheduleCQ; + +/** + * The nest-select-setupper of SINGLE_SCHEDULE. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleNss { + + protected SingleScheduleCQ _query; + + public SingleScheduleNss(SingleScheduleCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== + public SingleScheduleContentNss withSingleScheduleContentAsOne() { + _query.doNss(new SingleScheduleCQ.NssCall() { + public ConditionQuery qf() { + return _query.querySingleScheduleContentAsOne(); + } + }); + return new SingleScheduleContentNss(_query + .querySingleScheduleContentAsOne()); + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/SingleScheduleNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/UserInfoNss.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/UserInfoNss.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/UserInfoNss.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,50 @@ +package jp.sf.pal.scheduler.db.cbean.nss; + +import jp.sf.pal.scheduler.db.allcommon.cbean.ConditionQuery; +import jp.sf.pal.scheduler.db.cbean.cq.UserInfoCQ; + +/** + * The nest-select-setupper of USER_INFO. + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfoNss { + + protected UserInfoCQ _query; + + public UserInfoNss(UserInfoCQ query) { + _query = query; + } + + public boolean hasConditionQuery() { + return _query != null; + } + + //========================================================================== + // ========= + // With Nested Foreign Table + // ========================= + public GroupInfoNss withGroupInfo() { + _query.doNss(new UserInfoCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryGroupInfo(); + } + }); + return new GroupInfoNss(_query.queryGroupInfo()); + } + + public RoleInfoNss withRoleInfo() { + _query.doNss(new UserInfoCQ.NssCall() { + public ConditionQuery qf() { + return _query.queryRoleInfo(); + } + }); + return new RoleInfoNss(_query.queryRoleInfo()); + } + + //========================================================================== + // ========= + // With Nested Referrer Table + // ========================== +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/cbean/nss/UserInfoNss.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupInfoBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupInfoBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupInfoBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of GROUP_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfoBhv extends jp.sf.pal.scheduler.db.bsbhv.BsGroupInfoBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupInfoBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of GROUP_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMappingBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsGroupMappingBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/GroupMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleInfoBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleInfoBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleInfoBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of ROLE_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfoBhv extends jp.sf.pal.scheduler.db.bsbhv.BsRoleInfoBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleInfoBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of ROLE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMappingBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsRoleMappingBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoleMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of ROUTINE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsRoutineScheduleBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleContentBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleContentBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleContentBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of ROUTINE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContentBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsRoutineScheduleContentBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleContentBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of ROUTINE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMappingBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsRoutineScheduleMappingBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/RoutineScheduleMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of SINGLE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsSingleScheduleBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleContentBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleContentBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleContentBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of SINGLE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContentBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsSingleScheduleContentBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleContentBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleMappingBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleMappingBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleMappingBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of SINGLE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMappingBhv extends + jp.sf.pal.scheduler.db.bsbhv.BsSingleScheduleMappingBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/SingleScheduleMappingBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/UserInfoBhv.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/UserInfoBhv.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/UserInfoBhv.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.exbhv; + +/** + * The behavior of USER_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfoBhv extends jp.sf.pal.scheduler.db.bsbhv.BsUserInfoBhv { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exbhv/UserInfoBhv.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupInfoDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupInfoDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupInfoDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of GROUP_INFO. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface GroupInfoDao extends + jp.sf.pal.scheduler.db.bsdao.BsGroupInfoDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupInfoDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of GROUP_MAPPING. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface GroupMappingDao extends + jp.sf.pal.scheduler.db.bsdao.BsGroupMappingDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/GroupMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleInfoDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleInfoDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleInfoDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of ROLE_INFO. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RoleInfoDao extends jp.sf.pal.scheduler.db.bsdao.BsRoleInfoDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleInfoDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of ROLE_MAPPING. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RoleMappingDao extends + jp.sf.pal.scheduler.db.bsdao.BsRoleMappingDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoleMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleContentDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleContentDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleContentDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of ROUTINE_SCHEDULE_CONTENT. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RoutineScheduleContentDao extends + jp.sf.pal.scheduler.db.bsdao.BsRoutineScheduleContentDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleContentDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of ROUTINE_SCHEDULE. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RoutineScheduleDao extends + jp.sf.pal.scheduler.db.bsdao.BsRoutineScheduleDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of ROUTINE_SCHEDULE_MAPPING. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface RoutineScheduleMappingDao extends + jp.sf.pal.scheduler.db.bsdao.BsRoutineScheduleMappingDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/RoutineScheduleMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleContentDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleContentDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleContentDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of SINGLE_SCHEDULE_CONTENT. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface SingleScheduleContentDao extends + jp.sf.pal.scheduler.db.bsdao.BsSingleScheduleContentDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleContentDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of SINGLE_SCHEDULE. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface SingleScheduleDao extends + jp.sf.pal.scheduler.db.bsdao.BsSingleScheduleDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleMappingDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleMappingDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleMappingDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of SINGLE_SCHEDULE_MAPPING. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface SingleScheduleMappingDao extends + jp.sf.pal.scheduler.db.bsdao.BsSingleScheduleMappingDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/SingleScheduleMappingDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/UserInfoDao.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/UserInfoDao.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/UserInfoDao.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,14 @@ +package jp.sf.pal.scheduler.db.exdao; + +/** + * The dao interface of USER_INFO. <br /> + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public interface UserInfoDao extends jp.sf.pal.scheduler.db.bsdao.BsUserInfoDao { +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exdao/UserInfoDao.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of GROUP_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupInfo extends jp.sf.pal.scheduler.db.bsentity.BsGroupInfo { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of GROUP_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class GroupMapping extends + jp.sf.pal.scheduler.db.bsentity.BsGroupMapping { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/GroupMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of ROLE_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleInfo extends jp.sf.pal.scheduler.db.bsentity.BsRoleInfo { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of ROLE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoleMapping extends jp.sf.pal.scheduler.db.bsentity.BsRoleMapping { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoleMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineSchedule.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineSchedule.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineSchedule.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,75 @@ +package jp.sf.pal.scheduler.db.exentity; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * The entity of ROUTINE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineSchedule extends + jp.sf.pal.scheduler.db.bsentity.BsRoutineSchedule { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + public String getContent() { + if (getRoutineScheduleContentAsOne() != null) { + return getRoutineScheduleContentAsOne().getContent(); + } + return null; + } + + public void setContent(String content) { + if (getRoutineScheduleContentAsOne() == null) { + setRoutineScheduleContentAsOne(new RoutineScheduleContent()); + } + getRoutineScheduleContentAsOne().setContent(content); + } + + public String[] getSelectedUsers() { + if (getRoutineScheduleMappingList() != null + && !getRoutineScheduleMappingList().isEmpty()) { + List<String> list = new ArrayList<String>(); + for (RoutineScheduleMapping ssm : getRoutineScheduleMappingList()) { + list.add(ssm.getUserId()); + } + return list.toArray(new String[0]); + } + return null; + } + + public void setSelectedUsers(String[] users) { + if (users != null && getRoutineScheduleMappingList() != null) { + List<String> userList = new LinkedList<String>(); + for (String userId : users) { + userList.add(userId); + } + for (RoutineScheduleMapping ssm : getRoutineScheduleMappingList()) { + boolean delete = true; + for (String userId : userList) { + if (ssm.getUserId().equals(userId)) { + delete = false; + userList.remove(userId); + break; + } + } + if (delete) { + ssm.setDelete(true); + } + } + for (String userId : userList) { + RoutineScheduleMapping ssm = new RoutineScheduleMapping(); + ssm.setUserId(userId); + getRoutineScheduleMappingList().add(ssm); + } + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineSchedule.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleContent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleContent.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleContent.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of ROUTINE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleContent extends + jp.sf.pal.scheduler.db.bsentity.BsRoutineScheduleContent { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleContent.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,28 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of ROUTINE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class RoutineScheduleMapping extends + jp.sf.pal.scheduler.db.bsentity.BsRoutineScheduleMapping { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + private boolean delete = false; + + public boolean isDelete() { + return delete; + } + + public void setDelete(boolean delete) { + this.delete = delete; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/RoutineScheduleMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleSchedule.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleSchedule.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleSchedule.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,75 @@ +package jp.sf.pal.scheduler.db.exentity; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +/** + * The entity of SINGLE_SCHEDULE. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleSchedule extends + jp.sf.pal.scheduler.db.bsentity.BsSingleSchedule { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + public String getContent() { + if (getSingleScheduleContentAsOne() != null) { + return getSingleScheduleContentAsOne().getContent(); + } + return null; + } + + public void setContent(String content) { + if (getSingleScheduleContentAsOne() == null) { + setSingleScheduleContentAsOne(new SingleScheduleContent()); + } + getSingleScheduleContentAsOne().setContent(content); + } + + public String[] getSelectedUsers() { + if (getSingleScheduleMappingList() != null + && !getSingleScheduleMappingList().isEmpty()) { + List<String> list = new ArrayList<String>(); + for (SingleScheduleMapping ssm : getSingleScheduleMappingList()) { + list.add(ssm.getUserId()); + } + return list.toArray(new String[0]); + } + return null; + } + + public void setSelectedUsers(String[] users) { + if (users != null && getSingleScheduleMappingList() != null) { + List<String> userList = new LinkedList<String>(); + for (String userId : users) { + userList.add(userId); + } + for (SingleScheduleMapping ssm : getSingleScheduleMappingList()) { + boolean delete = true; + for (String userId : userList) { + if (ssm.getUserId().equals(userId)) { + delete = false; + userList.remove(userId); + break; + } + } + if (delete) { + ssm.setDelete(true); + } + } + for (String userId : userList) { + SingleScheduleMapping ssm = new SingleScheduleMapping(); + ssm.setUserId(userId); + getSingleScheduleMappingList().add(ssm); + } + } + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleSchedule.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleContent.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleContent.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleContent.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,18 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of SINGLE_SCHEDULE_CONTENT. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleContent extends + jp.sf.pal.scheduler.db.bsentity.BsSingleScheduleContent { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleContent.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleMapping.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleMapping.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleMapping.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,28 @@ +package jp.sf.pal.scheduler.db.exentity; + +/** + * The entity of SINGLE_SCHEDULE_MAPPING. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class SingleScheduleMapping extends + jp.sf.pal.scheduler.db.bsentity.BsSingleScheduleMapping { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + private boolean delete = false; + + public boolean isDelete() { + return delete; + } + + public void setDelete(boolean delete) { + this.delete = delete; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/SingleScheduleMapping.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/UserInfo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/UserInfo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/UserInfo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,38 @@ +package jp.sf.pal.scheduler.db.exentity; + +import org.apache.commons.lang.StringUtils; + +/** + * The entity of USER_INFO. + * <p> + * You can implement your original methods here. This class is NOT overrided + * when re-generating. + * </p> + * + * @author DBFlute(AutoGenerator) + */ + @ SuppressWarnings("unchecked") +public class UserInfo extends jp.sf.pal.scheduler.db.bsentity.BsUserInfo { + + /** Serial version UID. (Default) */ + private static final long serialVersionUID = 1L; + + public String getDisplayName() { + // TODO i18n + StringBuilder buf = new StringBuilder(); + if (getFamilyName() != null) { + buf.append(getFamilyName()); + } + if (getFamilyName() != null && getGivenName() != null) { + buf.append(" "); + } + if (getGivenName() != null) { + buf.append(getGivenName()); + } + String displayName = buf.toString(); + if (StringUtils.isEmpty(displayName)) { + return getUserId(); + } + return displayName; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/db/exentity/UserInfo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/RoutineScheduleDxo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/RoutineScheduleDxo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/RoutineScheduleDxo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,61 @@ +package jp.sf.pal.scheduler.dxo; + +import java.io.Serializable; + +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.form.admin.RoutineScheduleForm; + +import org.seasar.extension.dxo.annotation.ConversionRule; +import org.seasar.extension.dxo.annotation.DatePattern; +import org.seasar.extension.dxo.annotation.ExcludeNull; +import org.seasar.extension.dxo.annotation.TimePattern; + +public interface RoutineScheduleDxo extends Serializable { + + @ExcludeNull + @DatePattern("yyyy/MM/dd") + @TimePattern("HH:mm") + @ConversionRule("id : id" // + + ", title : title" // + + ", location : location" // + + ", startDate : startDate" // + + ", startTime : startTime" // + + ", endDate : endDate" // + + ", endTime : endTime" // + + ", createdTime : createdTime" // + + ", createdBy : createdBy" // + + ", updatedTime : updatedTime" // + + ", updatedBy : updatedBy" // + + ", deletedTime : deletedTime" // + + ", deletedBy : deletedBy" // + // + ", versionno : versionno" // + + ", content : content" // + + ", selectedUsers : selectedUsers" // + ) + public void convertFromRoutineScheduleToForm( + RoutineSchedule routineSchedule, RoutineScheduleForm form); + + @ExcludeNull + @DatePattern("yyyy/MM/dd") + @TimePattern("HH:mm") + @ConversionRule(// + "title : title" // + + ", location : location" // + + ", startDate : startDate" // + + ", startTime : startTime" // + + ", endDate : endDate" // + + ", endTime : endTime" // + // + ", createdTime : createdTime" // + // + ", createdBy : createdBy" // + // + ", updatedTime : updatedTime" // + // + ", updatedBy : updatedBy" // + // + ", deletedTime : deletedTime" // + // + ", deletedBy : deletedBy" // + // + ", versionno : versionno" // + + ", content : content" // + + ", selectedUsers : selectedUsers" // + ) + public void convertFromFormToRoutineSchedule(RoutineScheduleForm form, + RoutineSchedule routineSchedule); + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/RoutineScheduleDxo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/SingleScheduleDxo.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/SingleScheduleDxo.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/SingleScheduleDxo.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,61 @@ +package jp.sf.pal.scheduler.dxo; + +import java.io.Serializable; + +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.form.admin.SingleScheduleForm; + +import org.seasar.extension.dxo.annotation.ConversionRule; +import org.seasar.extension.dxo.annotation.DatePattern; +import org.seasar.extension.dxo.annotation.ExcludeNull; +import org.seasar.extension.dxo.annotation.TimePattern; + +public interface SingleScheduleDxo extends Serializable { + + @ExcludeNull + @DatePattern("yyyy/MM/dd") + @TimePattern("HH:mm") + @ConversionRule("id : id" // + + ", title : title" // + + ", location : location" // + + ", startDate : startDate" // + + ", startTime : startTime" // + + ", endDate : endDate" // + + ", endTime : endTime" // + + ", createdTime : createdTime" // + + ", createdBy : createdBy" // + + ", updatedTime : updatedTime" // + + ", updatedBy : updatedBy" // + + ", deletedTime : deletedTime" // + + ", deletedBy : deletedBy" // + // + ", versionno : versionno" // + + ", content : content" // + + ", selectedUsers : selectedUsers" // + ) + public void convertFromSingleScheduleToForm(SingleSchedule singleSchedule, + SingleScheduleForm form); + + @ExcludeNull + @DatePattern("yyyy/MM/dd") + @TimePattern("HH:mm") + @ConversionRule(// + "title : title" // + + ", location : location" // + + ", startDate : startDate" // + + ", startTime : startTime" // + + ", endDate : endDate" // + + ", endTime : endTime" // + // + ", createdTime : createdTime" // + // + ", createdBy : createdBy" // + // + ", updatedTime : updatedTime" // + // + ", updatedBy : updatedBy" // + // + ", deletedTime : deletedTime" // + // + ", deletedBy : deletedBy" // + // + ", versionno : versionno" // + + ", content : content" // + + ", selectedUsers : selectedUsers" // + ) + public void convertFromFormToSingleSchedule(SingleScheduleForm form, + SingleSchedule singleSchedule); + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/dxo/SingleScheduleDxo.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/ConfigForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/ConfigForm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/ConfigForm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,17 @@ +package jp.sf.pal.scheduler.form; + +import java.io.Serializable; + +import org.seasar.struts.annotation.Required; + +public class ConfigForm implements Serializable { + + private static final long serialVersionUID = 2108115319030589706L; + + @Required(target = "update") + public String roleAvailable; + + @Required(target = "update") + public String groupAvailable; + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/ConfigForm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/RoutineScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/RoutineScheduleForm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/RoutineScheduleForm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,96 @@ +package jp.sf.pal.scheduler.form.admin; + +import java.io.Serializable; + +import jp.sf.pal.scheduler.common.form.PagingResultForm; + +import org.seasar.struts.annotation.DateType; +import org.seasar.struts.annotation.IntegerType; +import org.seasar.struts.annotation.LongType; +import org.seasar.struts.annotation.Maxbytelength; +import org.seasar.struts.annotation.Required; + +public class RoutineScheduleForm implements Serializable, PagingResultForm { + + private static final long serialVersionUID = 6969085674310253357L; + + @IntegerType + public int mode; + + @Required(target = "update,delete") + @LongType + public String id; + + @Required(target = "confirm,create,update,delete") + @Maxbytelength(maxbytelength = 100) + public String title; + + @Maxbytelength(maxbytelength = 100) + public String location; + + @Required(target = "confirm,create,update,delete") + @DateType + public String startDate; + + public String startTime; + + @DateType + public String endDate; + + public String endTime; + + @Required(target = "confirm,create,update,delete") + @Maxbytelength(maxbytelength = 10) + public String type; + + @DateType + public String createdTime; + + @Maxbytelength(maxbytelength = 255) + public String createdBy; + + @DateType + public String updatedTime; + + @Maxbytelength(maxbytelength = 255) + public String updatedBy; + + @DateType + public String deletedTime; + + @Maxbytelength(maxbytelength = 255) + public String deletedBy; + + @Maxbytelength(maxbytelength = 1000) + public String content; + + public String[] addedUsers; + + public String[] removedUsers; + + public String[] selectedUsers; + + @IntegerType + public String pageNumber; + + public void initialize() { + id = null; + title = null; + location = null; + startDate = null; + startTime = null; + endDate = null; + endTime = null; + type = null; + createdTime = null; + createdBy = null; + updatedTime = null; + updatedBy = null; + deletedTime = null; + deletedBy = null; + content = null; + addedUsers = null; + removedUsers = null; + selectedUsers = null; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/RoutineScheduleForm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/SingleScheduleForm.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/SingleScheduleForm.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/SingleScheduleForm.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,92 @@ +package jp.sf.pal.scheduler.form.admin; + +import java.io.Serializable; + +import jp.sf.pal.scheduler.common.form.PagingResultForm; + +import org.seasar.struts.annotation.DateType; +import org.seasar.struts.annotation.IntegerType; +import org.seasar.struts.annotation.LongType; +import org.seasar.struts.annotation.Maxbytelength; +import org.seasar.struts.annotation.Required; + +public class SingleScheduleForm implements Serializable, PagingResultForm { + + private static final long serialVersionUID = 6969085674310253357L; + + @IntegerType + public int mode; + + @Required(target = "update,delete") + @LongType + public String id; + + @Required(target = "confirm,create,update,delete") + @Maxbytelength(maxbytelength = 100) + public String title; + + @Maxbytelength(maxbytelength = 100) + public String location; + + @Required(target = "confirm,create,update,delete") + @DateType + public String startDate; + + public String startTime; + + @Required(target = "confirm,create,update,delete") + @DateType + public String endDate; + + public String endTime; + + @DateType + public String createdTime; + + @Maxbytelength(maxbytelength = 255) + public String createdBy; + + @DateType + public String updatedTime; + + @Maxbytelength(maxbytelength = 255) + public String updatedBy; + + @DateType + public String deletedTime; + + @Maxbytelength(maxbytelength = 255) + public String deletedBy; + + @Maxbytelength(maxbytelength = 1000) + public String content; + + public String[] addedUsers; + + public String[] removedUsers; + + public String[] selectedUsers; + + @IntegerType + public String pageNumber; + + public void initialize() { + id = null; + title = null; + location = null; + startDate = null; + startTime = null; + endDate = null; + endTime = null; + createdTime = null; + createdBy = null; + updatedTime = null; + updatedBy = null; + deletedTime = null; + deletedBy = null; + content = null; + addedUsers = null; + removedUsers = null; + selectedUsers = null; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/form/admin/SingleScheduleForm.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/RoutineSchedulePager.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/RoutineSchedulePager.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/RoutineSchedulePager.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.pager; + +import jp.sf.pal.scheduler.common.pager.DefaultPager; + +public class RoutineSchedulePager extends DefaultPager { + + private static final long serialVersionUID = 208357552837282806L; + + public RoutineSchedulePager() { + + } + + public void clear() { + super.clear(); + } + + protected int getDefaultPageSize() { + return 50; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/RoutineSchedulePager.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/SingleSchedulePager.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/SingleSchedulePager.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/SingleSchedulePager.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +package jp.sf.pal.scheduler.pager; + +import jp.sf.pal.scheduler.common.pager.DefaultPager; + +public class SingleSchedulePager extends DefaultPager { + + private static final long serialVersionUID = 208357552837282806L; + + public SingleSchedulePager() { + + } + + public void clear() { + super.clear(); + } + + protected int getDefaultPageSize() { + return 50; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/pager/SingleSchedulePager.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/RoutineScheduleService.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/RoutineScheduleService.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/RoutineScheduleService.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,177 @@ +package jp.sf.pal.scheduler.service; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; + +import jp.sf.pal.scheduler.common.dxo.PagerDxo; +import jp.sf.pal.scheduler.common.util.PagingResultBeanWrapper; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleCB; +import jp.sf.pal.scheduler.db.cbean.RoutineScheduleMappingCB; +import jp.sf.pal.scheduler.db.exbhv.RoutineScheduleBhv; +import jp.sf.pal.scheduler.db.exbhv.RoutineScheduleContentBhv; +import jp.sf.pal.scheduler.db.exbhv.RoutineScheduleMappingBhv; +import jp.sf.pal.scheduler.db.exentity.RoutineSchedule; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleContent; +import jp.sf.pal.scheduler.db.exentity.RoutineScheduleMapping; +import jp.sf.pal.scheduler.pager.RoutineSchedulePager; + +import org.seasar.framework.container.hotdeploy.HotdeployUtil; + +public class RoutineScheduleService implements Serializable { + + private static final long serialVersionUID = 1L; + + private transient RoutineScheduleBhv routineScheduleBhv; + + private transient RoutineScheduleContentBhv routineScheduleContentBhv; + + private transient RoutineScheduleMappingBhv routineScheduleMappingBhv; + + private PagerDxo pagerDxo; + + public List<RoutineSchedule> getRoutineScheduleList( + RoutineSchedulePager routineSchedulePager, String userId) { + + HotdeployUtil.rebuildValue(routineSchedulePager); + + RoutineScheduleCB cb = new RoutineScheduleCB(); + + cb.fetchFirst(routineSchedulePager.getPageSize()); + cb.fetchPage(routineSchedulePager.getCurrentPageNumber()); + + // setup + + cb.query().setDeletedBy_IsNull(); + + cb.query().addOrderBy_StartDate_Desc(); + + PagingResultBean<RoutineSchedule> groupInfoList = routineScheduleBhv + .selectPage(cb); + + // update pager + pagerDxo.convert(new PagingResultBeanWrapper(groupInfoList), + routineSchedulePager); + groupInfoList.setPageRangeSize(5); + routineSchedulePager.setPageNumberList(groupInfoList.pageRange() + .createPageNumberList()); + + return groupInfoList; + } + + public RoutineSchedule getRoutineSchedule(Long id, String userid) { + RoutineScheduleCB cb = new RoutineScheduleCB(); + + // setup + cb.setupSelect_RoutineScheduleContentAsOne(); + + cb.query().setDeletedBy_IsNull(); + cb.query().setId_Equal(id); + RoutineSchedule routineSchedule = routineScheduleBhv.selectEntity(cb); + if (routineSchedule == null) { + return null; + } + + RoutineScheduleMappingCB cb2 = new RoutineScheduleMappingCB(); + cb2.query().setScheduleId_Equal(id); + routineSchedule.setRoutineScheduleMappingList(routineScheduleMappingBhv + .selectList(cb2)); + return routineSchedule; + } + + public void store(RoutineSchedule routineSchedule) { + Timestamp now = new Timestamp(System.currentTimeMillis()); + routineSchedule.setUpdatedTime(now); + + RoutineScheduleContent ssc = routineSchedule + .getRoutineScheduleContentAsOne(); + + if (routineSchedule.getCreatedTime() == null) { + // create + routineSchedule.setCreatedTime(now); + routineScheduleBhv.insert(routineSchedule); + + if (ssc != null) { + ssc.setId(routineSchedule.getId()); + routineScheduleContentBhv.insert(ssc); + } + } else { + // update + routineScheduleBhv.update(routineSchedule); + + if (ssc != null) { + if (ssc.getId() == null) { + ssc.setId(routineSchedule.getId()); + } + routineScheduleContentBhv.insertOrUpdate(ssc); + } + } + + // mapping + List<RoutineScheduleMapping> ssmList = routineSchedule + .getRoutineScheduleMappingList(); + if (ssmList != null) { + for (RoutineScheduleMapping ssm : ssmList) { + if (ssm.isDelete()) { + // delete + routineScheduleMappingBhv.delete(ssm); + } else if (ssm.getId() == null) { + // create + ssm.setScheduleId(routineSchedule.getId()); + routineScheduleMappingBhv.insert(ssm); + } + } + } + } + + public void disable(Long id, String name) { + // not delete + RoutineScheduleCB cb = new RoutineScheduleCB(); + + cb.query().setId_Equal(id); + RoutineSchedule groupInfo = routineScheduleBhv.selectEntity(cb); + + // TODO throw an exception + + groupInfo.setDeletedBy(name); + groupInfo.setDeletedTime(new Timestamp(new Date().getTime())); + routineScheduleBhv.update(groupInfo); + } + + public RoutineScheduleBhv getRoutineScheduleBhv() { + return routineScheduleBhv; + } + + public void setRoutineScheduleBhv(RoutineScheduleBhv messageBhv) { + this.routineScheduleBhv = messageBhv; + } + + public PagerDxo getPagerDxo() { + return pagerDxo; + } + + public void setPagerDxo(PagerDxo pagerDxo) { + this.pagerDxo = pagerDxo; + } + + public RoutineScheduleMappingBhv getRoutineScheduleMappingBhv() { + return routineScheduleMappingBhv; + } + + public void setRoutineScheduleMappingBhv( + RoutineScheduleMappingBhv routineScheduleMappingBhv) { + this.routineScheduleMappingBhv = routineScheduleMappingBhv; + } + + public RoutineScheduleContentBhv getRoutineScheduleContentBhv() { + return routineScheduleContentBhv; + } + + public void setRoutineScheduleContentBhv( + RoutineScheduleContentBhv routineScheduleContentBhv) { + this.routineScheduleContentBhv = routineScheduleContentBhv; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/RoutineScheduleService.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/SingleScheduleService.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/SingleScheduleService.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/SingleScheduleService.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,177 @@ +package jp.sf.pal.scheduler.service; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; + +import jp.sf.pal.scheduler.common.dxo.PagerDxo; +import jp.sf.pal.scheduler.common.util.PagingResultBeanWrapper; +import jp.sf.pal.scheduler.db.allcommon.cbean.PagingResultBean; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleCB; +import jp.sf.pal.scheduler.db.cbean.SingleScheduleMappingCB; +import jp.sf.pal.scheduler.db.exbhv.SingleScheduleBhv; +import jp.sf.pal.scheduler.db.exbhv.SingleScheduleContentBhv; +import jp.sf.pal.scheduler.db.exbhv.SingleScheduleMappingBhv; +import jp.sf.pal.scheduler.db.exentity.SingleSchedule; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleContent; +import jp.sf.pal.scheduler.db.exentity.SingleScheduleMapping; +import jp.sf.pal.scheduler.pager.SingleSchedulePager; + +import org.seasar.framework.container.hotdeploy.HotdeployUtil; + +public class SingleScheduleService implements Serializable { + + private static final long serialVersionUID = 1L; + + private transient SingleScheduleBhv singleScheduleBhv; + + private transient SingleScheduleContentBhv singleScheduleContentBhv; + + private transient SingleScheduleMappingBhv singleScheduleMappingBhv; + + private PagerDxo pagerDxo; + + public List<SingleSchedule> getSingleScheduleList( + SingleSchedulePager singleSchedulePager, String userId) { + + HotdeployUtil.rebuildValue(singleSchedulePager); + + SingleScheduleCB cb = new SingleScheduleCB(); + + cb.fetchFirst(singleSchedulePager.getPageSize()); + cb.fetchPage(singleSchedulePager.getCurrentPageNumber()); + + // setup + + cb.query().setDeletedBy_IsNull(); + + cb.query().addOrderBy_StartDate_Desc(); + + PagingResultBean<SingleSchedule> groupInfoList = singleScheduleBhv + .selectPage(cb); + + // update pager + pagerDxo.convert(new PagingResultBeanWrapper(groupInfoList), + singleSchedulePager); + groupInfoList.setPageRangeSize(5); + singleSchedulePager.setPageNumberList(groupInfoList.pageRange() + .createPageNumberList()); + + return groupInfoList; + } + + public SingleSchedule getSingleSchedule(Long id, String userid) { + SingleScheduleCB cb = new SingleScheduleCB(); + + // setup + cb.setupSelect_SingleScheduleContentAsOne(); + + cb.query().setDeletedBy_IsNull(); + cb.query().setId_Equal(id); + SingleSchedule singleSchedule = singleScheduleBhv.selectEntity(cb); + if (singleSchedule == null) { + return null; + } + + SingleScheduleMappingCB cb2 = new SingleScheduleMappingCB(); + cb2.query().setScheduleId_Equal(id); + singleSchedule.setSingleScheduleMappingList(singleScheduleMappingBhv + .selectList(cb2)); + return singleSchedule; + } + + public void store(SingleSchedule singleSchedule) { + Timestamp now = new Timestamp(System.currentTimeMillis()); + singleSchedule.setUpdatedTime(now); + + SingleScheduleContent ssc = singleSchedule + .getSingleScheduleContentAsOne(); + + if (singleSchedule.getCreatedTime() == null) { + // create + singleSchedule.setCreatedTime(now); + singleScheduleBhv.insert(singleSchedule); + + if (ssc != null) { + ssc.setId(singleSchedule.getId()); + singleScheduleContentBhv.insert(ssc); + } + } else { + // update + singleScheduleBhv.update(singleSchedule); + + if (ssc != null) { + if (ssc.getId() == null) { + ssc.setId(singleSchedule.getId()); + } + singleScheduleContentBhv.insertOrUpdate(ssc); + } + } + + // mapping + List<SingleScheduleMapping> ssmList = singleSchedule + .getSingleScheduleMappingList(); + if (ssmList != null) { + for (SingleScheduleMapping ssm : ssmList) { + if (ssm.isDelete()) { + // delete + singleScheduleMappingBhv.delete(ssm); + } else if (ssm.getId() == null) { + // create + ssm.setScheduleId(singleSchedule.getId()); + singleScheduleMappingBhv.insert(ssm); + } + } + } + } + + public void disable(Long id, String name) { + // not delete + SingleScheduleCB cb = new SingleScheduleCB(); + + cb.query().setId_Equal(id); + SingleSchedule groupInfo = singleScheduleBhv.selectEntity(cb); + + // TODO throw an exception + + groupInfo.setDeletedBy(name); + groupInfo.setDeletedTime(new Timestamp(new Date().getTime())); + singleScheduleBhv.update(groupInfo); + } + + public SingleScheduleBhv getSingleScheduleBhv() { + return singleScheduleBhv; + } + + public void setSingleScheduleBhv(SingleScheduleBhv messageBhv) { + this.singleScheduleBhv = messageBhv; + } + + public PagerDxo getPagerDxo() { + return pagerDxo; + } + + public void setPagerDxo(PagerDxo pagerDxo) { + this.pagerDxo = pagerDxo; + } + + public SingleScheduleMappingBhv getSingleScheduleMappingBhv() { + return singleScheduleMappingBhv; + } + + public void setSingleScheduleMappingBhv( + SingleScheduleMappingBhv singleScheduleMappingBhv) { + this.singleScheduleMappingBhv = singleScheduleMappingBhv; + } + + public SingleScheduleContentBhv getSingleScheduleContentBhv() { + return singleScheduleContentBhv; + } + + public void setSingleScheduleContentBhv( + SingleScheduleContentBhv singleScheduleContentBhv) { + this.singleScheduleContentBhv = singleScheduleContentBhv; + } + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/SingleScheduleService.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/UserInfoService.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/UserInfoService.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/UserInfoService.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,58 @@ +package jp.sf.pal.scheduler.service; + +import java.util.ArrayList; +import java.util.List; + +import jp.sf.pal.scheduler.db.cbean.UserInfoCB; +import jp.sf.pal.scheduler.db.exbhv.UserInfoBhv; +import jp.sf.pal.scheduler.db.exentity.UserInfo; + +public class UserInfoService { + private transient UserInfoBhv userInfoBhv; + + public List<UserInfo> getAvailableUserList(String[] selectedUsers, + String userId) { + UserInfoCB cb = new UserInfoCB(); + + // setup + + if (userId != null) { + cb.query().setUserId_Equal(userId); + } + if (selectedUsers != null) { + List<String> excludedUserIdList = new ArrayList<String>(); + for (String uid : selectedUsers) { + excludedUserIdList.add(uid); + } + cb.query().setUserId_NotInScope(excludedUserIdList); + } + return userInfoBhv.selectList(cb); + } + + public List<UserInfo> getSelectedUserList(String[] selectedUsers) { + UserInfoCB cb = new UserInfoCB(); + + // setup + + if (selectedUsers != null) { + List<String> userIdList = new ArrayList<String>( + selectedUsers.length); + for (String userId : selectedUsers) { + userIdList.add(userId); + } + cb.query().setUserId_InScope(userIdList); + } + + cb.query().addOrderBy_FamilyName_Asc(); + + return userInfoBhv.selectList(cb); + } + + public UserInfoBhv getUserInfoBhv() { + return userInfoBhv; + } + + public void setUserInfoBhv(UserInfoBhv userInfoBhv) { + this.userInfoBhv = userInfoBhv; + } +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/service/UserInfoService.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/util/SchedulerUtil.java =================================================================== --- scheduler/trunk/src/main/java/jp/sf/pal/scheduler/util/SchedulerUtil.java (rev 0) +++ scheduler/trunk/src/main/java/jp/sf/pal/scheduler/util/SchedulerUtil.java 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,5 @@ +package jp.sf.pal.scheduler.util; + +public class SchedulerUtil { + +} Property changes on: scheduler/trunk/src/main/java/jp/sf/pal/scheduler/util/SchedulerUtil.java ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/app.dicon =================================================================== --- scheduler/trunk/src/main/resources/app.dicon (rev 0) +++ scheduler/trunk/src/main/resources/app.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" + "http://www.seasar.org/dtd/components24.dtd"> +<components> + <include path="convention.dicon"/> + <include path="aop.dicon"/> + <include path="dxo.dicon"/> + <include path="dbflute.dicon"/> + + <component name="actionMessagesThrowsInterceptor" class="org.seasar.struts.interceptor.ActionMessagesThrowsInterceptor"/> +</components> Added: scheduler/trunk/src/main/resources/application.properties =================================================================== --- scheduler/trunk/src/main/resources/application.properties (rev 0) +++ scheduler/trunk/src/main/resources/application.properties 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,63 @@ +errors.header=<ul> +errors.footer=</ul> +errors.prefix=<li style="portlet-msg-error"> +errors.suffix=</li> +msg.header=<ul> +msg.footer=</ul> + +errors.invalid={0} is invalid. +errors.maxlength={0} can not be greater than {1} characters. +errors.minlength={0} can not be less than {1} characters. +errors.maxbytelength={0} can not be greater than {1} bytes. +errors.minbytelength={0} can not be less than {1} bytes. +errors.range={0} is not in the range {1} through {2}. +errors.required={0} is required. +errors.required.other={0} is required ({1}). +errors.byte={0} must be an byte. +errors.date={0} is not a date. +errors.double={0} must be an double. +errors.float={0} must be an float. +errors.integer={0} must be an integer. +errors.long={0} must be an long. +errors.short={0} must be an short. +errors.creditcard={0} is not a valid credit card number. +errors.email={0} is an invalid e-mail address. +errors.url={0} is an invalid url (web address). + +success.update_config=Updated configuration. +success.create_singleSchedule=Created your event. +success.update_singleSchedule=Updated your event. +success.delete_singleSchedule=Deleted your event. +success.create_routineSchedule=Created your event. +success.update_routineSchedule=Updated your event. +success.delete_routineSchedule=Deleted your event. + +errors.failed_to_update_config=Failed to update the configuration. +errors.invalid.mode=Invalid mode(expected value is {0}, but it's {1}). +errors.failed_to_create_singleSchedule=Failed to create a new event. +errors.failed_to_update_singleSchedule=Failed to update the event. +errors.failed_to_delete_singleSchedule=Failed to delete the event. +errors.could_not_find_singleSchedule=Could not find the event({0}). +errors.failed_to_create_routineSchedule=Failed to create a new event. +errors.failed_to_update_routineSchedule=Failed to update the event. +errors.failed_to_delete_routineSchedule=Failed to delete the event. +errors.could_not_find_routineSchedule=Could not find the event({0}). + +labels.detail=Detail +labels.create=Create +labels.update=Update +labels.delete=Delete +labels.back=Back +labels.edit=Edit +labels.confirm=Confirm + +labels.config=Configuration + +labels.event_detail=Event Details +labels.confirmation_of_event=Confirmation of Event + +labels.create_new_event=Create New Event +labels.to_next=Next +labels.to_back=Back + + Property changes on: scheduler/trunk/src/main/resources/application.properties ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/application_ja.properties =================================================================== --- scheduler/trunk/src/main/resources/application_ja.properties (rev 0) +++ scheduler/trunk/src/main/resources/application_ja.properties 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,48 @@ +errors.invalid={0} \u306b\u306f\u6b63\u3057\u3044\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +errors.maxlength={0} \u306f {1} \u6587\u5b57\u4ee5\u4e0b\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.minlength={0} \u306f {1} \u6587\u5b57\u4ee5\u4e0a\u5165\u529b\u3057\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.maxbytelength={0} \u306e\u30b5\u30a4\u30ba\u306f {1} \u30d0\u30a4\u30c8\u4ee5\u4e0b\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.minbytelength={0} \u306e\u30b5\u30a4\u30ba\u306f {1} \u30d0\u30a4\u30c8\u4ee5\u4e0b\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.range={0} \u306f {1} \u304b\u3089 {2} \u306e\u9593\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.required={0} \u306f\u5fc5\u305a\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +errors.required.other={0} \u306f\u5fc5\u305a\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002({1}) +errors.byte={0} \u306f\u30d0\u30a4\u30c8\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.date={0} \u306f\u65e5\u4ed8\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.double={0} \u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b (double \u578b) \u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.float={0} \u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b (float \u578b) \u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.integer={0} \u306f\u6574\u6570\u578b (2147483647 \u4ee5\u4e0b\u306e\u6574\u6570) \u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.long={0} \u306f\u6574\u6570\u578b (9223372036854775807 \u4ee5\u4e0b\u306e\u6574\u6570) \u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.short={0} \u306f\u6574\u6570\u578b (32767 \u4ee5\u4e0b\u306e\u6574\u6570) \u3067\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 +errors.creditcard={0} \u306f\u6b63\u3057\u3044\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u756a\u53f7\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 +errors.email={0} \u306f\u6b63\u3057\u3044\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 +errors.url={0} \u306f\u6b63\u3057\u3044 URL (\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306e\u30a2\u30c9\u30ec\u30b9) \u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 + +success.update_config=\u8a2d\u5b9a\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002 +success.create_singleSchedule=Created your event. +success.update_singleSchedule=Updated your event. +success.delete_singleSchedule=Deleted your event. +success.create_routineSchedule=Created your event. +success.update_routineSchedule=Updated your event. +success.delete_routineSchedule=Deleted your event. + +errors.failed_to_update_config=\u8a2d\u5b9a\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 +errors.invalid.mode=\u30e2\u30fc\u30c9\u304c\u9055\u3044\u307e\u3059\u3002(\u6b63\u3057\u3044\u5024\u306f {0} \u3067\u3059\u304c\u3001\u5165\u529b\u3055\u308c\u305f\u5024\u306f {1} \u306b\u306a\u3063\u3066\u3044\u307e\u3059) +errors.failed_to_create_singleSchedule=Failed to create a new event. +errors.failed_to_update_singleSchedule=Failed to update the event. +errors.failed_to_delete_singleSchedule=Failed to delete the event. +errors.could_not_find_singleSchedule=Could not find the event({0}). +errors.failed_to_create_routineSchedule=Failed to create a new event. +errors.failed_to_update_routineSchedule=Failed to update the event. +errors.failed_to_delete_routineSchedule=Failed to delete the event. +errors.could_not_find_routineSchedule=Could not find the event({0}). + +labels.detail=\u8a73\u7d30 +labels.create=\u4f5c\u6210 +labels.update=\u66f4\u65b0 +labels.delete=\u524a\u9664 +labels.back=\u623b\u308b +labels.edit=\u7de8\u96c6 +labels.confirm=\u78ba\u8a8d + +labels.config=\u8a2d\u5b9a + Property changes on: scheduler/trunk/src/main/resources/application_ja.properties ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/convention.dicon =================================================================== --- scheduler/trunk/src/main/resources/convention.dicon (rev 0) +++ scheduler/trunk/src/main/resources/convention.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" + "http://www.seasar.org/dtd/components24.dtd"> +<components> + <component class="org.seasar.framework.convention.impl.NamingConventionImpl"> + <initMethod name="addRootPackageName"> + <arg>"jp.sf.pal.scheduler"</arg> + </initMethod> + <initMethod name="addRootPackageName"> + <arg>"jp.sf.pal.scheduler.common"</arg> + </initMethod> + <initMethod name="addIgnorePackageName"> + <arg>"jp.sf.pal.scheduler.common.util"</arg> + </initMethod> +<!-- + <initMethod name="addIgnorePackageName"> + <arg>"jp.sf.pal.scheduler.db"</arg> + </initMethod> +--> + </component> +</components> Added: scheduler/trunk/src/main/resources/creator.dicon =================================================================== --- scheduler/trunk/src/main/resources/creator.dicon (rev 0) +++ scheduler/trunk/src/main/resources/creator.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" + "http://www.seasar.org/dtd/components24.dtd"> +<components> + <include path="convention.dicon"/> + <include path="customizer.dicon"/> + + <component class="org.seasar.framework.container.creator.ActionCreator"/> + <component class="org.seasar.struts.creator.FormCreator"/> + <component class="org.seasar.framework.container.creator.ServiceCreator"/> + <component class="org.seasar.framework.container.creator.DxoCreator"/> + <!--component class="org.seasar.framework.container.creator.DtoCreator"/--> + <component class="org.seasar.framework.container.creator.InterceptorCreator"/> + <component class="jp.sf.pal.scheduler.common.creator.PagerCreator"/> +</components> Added: scheduler/trunk/src/main/resources/customizer.dicon =================================================================== --- scheduler/trunk/src/main/resources/customizer.dicon (rev 0) +++ scheduler/trunk/src/main/resources/customizer.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" + "http://www.seasar.org/dtd/components24.dtd"> +<components> + <include path="default-customizer.dicon"/> + + <component name="actionCustomizer" + class="org.seasar.framework.container.customizer.CustomizerChain"> + <initMethod name="addAspectCustomizer"> + <arg>"aop.traceInterceptor"</arg> + </initMethod> + <initMethod name="addAspectCustomizer"> + <arg>"actionMessagesThrowsInterceptor"</arg> + </initMethod> + <initMethod name="addCustomizer"> + <arg> + <component + class="org.seasar.framework.container.customizer.TxAttributeCustomizer"/> + </arg> + </initMethod> + <initMethod name="addCustomizer"> + <arg> + <component + class="org.seasar.struts.customizer.ActionCustomizer"/> + </arg> + </initMethod> + </component> + + <component name="formCustomizer" + class="org.seasar.framework.container.customizer.CustomizerChain"> + </component> + + <component name="serviceCustomizer" + class="org.seasar.framework.container.customizer.CustomizerChain"> + <initMethod name="addAspectCustomizer"> + <arg>"aop.traceInterceptor"</arg> + </initMethod> + <initMethod name="addCustomizer"> + <arg> + <component + class="org.seasar.framework.container.customizer.TxAttributeCustomizer"/> + </arg> + </initMethod> + </component> + + <component name="dxoCustomizer" class="org.seasar.framework.container.customizer.CustomizerChain"> + <initMethod name="addCustomizer"> + <arg>traceCustomizer</arg> + </initMethod> + <initMethod name="addCustomizer"> + <arg>s2DxoCustomizer</arg> + </initMethod> + </component> + + <component name="pagerCustomizer" class="org.seasar.framework.container.customizer.CustomizerChain"> + </component> + +</components> Added: scheduler/trunk/src/main/resources/dbflute.dicon =================================================================== --- scheduler/trunk/src/main/resources/dbflute.dicon (rev 0) +++ scheduler/trunk/src/main/resources/dbflute.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN" + "http://www.seasar.org/dtd/components21.dtd"> + +<components namespace="dbflute"> + <include path="j2ee.dicon"/> + + <!-- S2Dao component. --> + <component class="jp.sf.pal.scheduler.db.allcommon.s2dao.S2DaoMetaDataFactoryImpl"> + <property name="sqlFileEncoding">"UTF-8"</property> + </component> + <component name="interceptor" class="jp.sf.pal.scheduler.db.allcommon.s2dao.S2DaoInterceptor"/> + <component class="org.seasar.dao.impl.AnnotationReaderFactoryImpl"/> + <component class="org.seasar.dao.impl.ValueTypeFactoryImpl"/> + <component class="jp.sf.pal.scheduler.db.allcommon.s2dao.S2BeanMetaDataFactoryImpl"/> + <component class="org.seasar.dao.impl.DaoNamingConventionImpl"/> + <component class="org.seasar.dao.impl.NullBeanEnhancer"/> + <component class="jp.sf.pal.scheduler.db.allcommon.s2dao.S2DaoMetaDataExtension$ResultSetHandlerFactoryExtension"/> + <component class="org.seasar.dao.impl.DtoMetaDataFactoryImpl"/> + <component class="jp.sf.pal.scheduler.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.scheduler.db.allcommon.s2dao.S2DaoLatestSqlProvider"/> + <component name="dbfluteStringClobType" class="org.seasar.extension.jdbc.types.StringClobType" /> + <component name="dbfluteBytesOidType" class="jp.sf.pal.scheduler.db.allcommon.s2dao.internal.valuetype.InternalBytesOidType" /> + + <!-- The selector of behavior. --> + <component name="behaviorSelector" class="jp.sf.pal.scheduler.db.allcommon.CacheBehaviorSelector"> + <destroyMethod name="destroy"/> + </component> + + <!-- The selector of DAO. --> + <component name="daoSelector" class="jp.sf.pal.scheduler.db.allcommon.CacheDaoSelector"> + <destroyMethod name="destroy"/> + </component> + + <!-- The dao of outsideSql. --> + <component class="jp.sf.pal.scheduler.db.allcommon.cbean.outsidesql.OutsideSqlDao"> + <aspect>dbflute.interceptor</aspect> + </component> + + + <!-- GROUP_INFO --> + <component name="groupInfoDao" class="jp.sf.pal.scheduler.db.exdao.GroupInfoDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="groupInfoBhv" class="jp.sf.pal.scheduler.db.exbhv.GroupInfoBhv"/> + + <!-- GROUP_MAPPING --> + <component name="groupMappingDao" class="jp.sf.pal.scheduler.db.exdao.GroupMappingDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="groupMappingBhv" class="jp.sf.pal.scheduler.db.exbhv.GroupMappingBhv"/> + + <!-- ROLE_INFO --> + <component name="roleInfoDao" class="jp.sf.pal.scheduler.db.exdao.RoleInfoDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="roleInfoBhv" class="jp.sf.pal.scheduler.db.exbhv.RoleInfoBhv"/> + + <!-- ROLE_MAPPING --> + <component name="roleMappingDao" class="jp.sf.pal.scheduler.db.exdao.RoleMappingDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="roleMappingBhv" class="jp.sf.pal.scheduler.db.exbhv.RoleMappingBhv"/> + + <!-- ROUTINE_SCHEDULE --> + <component name="routineScheduleDao" class="jp.sf.pal.scheduler.db.exdao.RoutineScheduleDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="routineScheduleBhv" class="jp.sf.pal.scheduler.db.exbhv.RoutineScheduleBhv"/> + + <!-- ROUTINE_SCHEDULE_CONTENT --> + <component name="routineScheduleContentDao" class="jp.sf.pal.scheduler.db.exdao.RoutineScheduleContentDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="routineScheduleContentBhv" class="jp.sf.pal.scheduler.db.exbhv.RoutineScheduleContentBhv"/> + + <!-- ROUTINE_SCHEDULE_MAPPING --> + <component name="routineScheduleMappingDao" class="jp.sf.pal.scheduler.db.exdao.RoutineScheduleMappingDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="routineScheduleMappingBhv" class="jp.sf.pal.scheduler.db.exbhv.RoutineScheduleMappingBhv"/> + + <!-- SINGLE_SCHEDULE --> + <component name="singleScheduleDao" class="jp.sf.pal.scheduler.db.exdao.SingleScheduleDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="singleScheduleBhv" class="jp.sf.pal.scheduler.db.exbhv.SingleScheduleBhv"/> + + <!-- SINGLE_SCHEDULE_CONTENT --> + <component name="singleScheduleContentDao" class="jp.sf.pal.scheduler.db.exdao.SingleScheduleContentDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="singleScheduleContentBhv" class="jp.sf.pal.scheduler.db.exbhv.SingleScheduleContentBhv"/> + + <!-- SINGLE_SCHEDULE_MAPPING --> + <component name="singleScheduleMappingDao" class="jp.sf.pal.scheduler.db.exdao.SingleScheduleMappingDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="singleScheduleMappingBhv" class="jp.sf.pal.scheduler.db.exbhv.SingleScheduleMappingBhv"/> + + <!-- USER_INFO --> + <component name="userInfoDao" class="jp.sf.pal.scheduler.db.exdao.UserInfoDao"> + <aspect>dbflute.interceptor</aspect> + </component> + <component name="userInfoBhv" class="jp.sf.pal.scheduler.db.exbhv.UserInfoBhv"/> + +</components> Added: scheduler/trunk/src/main/resources/env.txt =================================================================== --- scheduler/trunk/src/main/resources/env.txt (rev 0) +++ scheduler/trunk/src/main/resources/env.txt 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1 @@ +product Property changes on: scheduler/trunk/src/main/resources/env.txt ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/env_ut.txt =================================================================== --- scheduler/trunk/src/main/resources/env_ut.txt (rev 0) +++ scheduler/trunk/src/main/resources/env_ut.txt 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1 @@ +ut \ No newline at end of file Property changes on: scheduler/trunk/src/main/resources/env_ut.txt ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/resources/jdbc.dicon =================================================================== --- scheduler/trunk/src/main/resources/jdbc.dicon (rev 0) +++ scheduler/trunk/src/main/resources/jdbc.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" + "http://www.seasar.org/dtd/components24.dtd"> +<components namespace="jdbc"> + <include path="jta.dicon"/> + <include path="jdbc-extension.dicon"/> + + <component class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/> + <component class="org.seasar.extension.jdbc.impl.ConfigurableStatementFactory"> + <arg> + <component class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/> + </arg> + <property name="fetchSize">100</property> + <!-- + <property name="maxRows">100</property> + --> + </component> + <!-- + <component class="org.seasar.extension.jdbc.impl.OracleResultSetFactory"/> + <component class="org.seasar.extension.jdbc.impl.BooleanToIntStatementFactory"/> + --> + <!-- for Derby Embedded + <component name="xaDataSource" + class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> + <property name="driverClassName"> + "org.apache.derby.jdbc.EmbeddedDriver" + </property> + <property name="URL"> + "jdbc:derby:directory:" + container.getComponent(@java.lang.Class @ forName("javax.servlet.ServletContext")).getRealPath("/WEB-INF/db/pompei") + </property> + <property name="user">""</property> + <property name="password">""</property> + </component> + --> + + <!-- for H2 --> + <component name="xaDataSource" + class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> + <property name="driverClassName"> + "org.h2.Driver" + </property> + <property name="URL"> + "jdbc:h2:file:" + container.getComponent(@java.lang.Class @ forName("javax.servlet.ServletContext")).getRealPath("/WEB-INF/db/scheduler") + </property> + <!-- "jdbc:h2:tcp://localhost:9092/scheduler" --> + <property name="user">"sa"</property> + <property name="password">""</property> + </component> + + <!-- for Oracle --> + <!-- + <component name="xaDataSource" + class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> + <property name="driverClassName"> + "oracle.jdbc.driver.OracleDriver" + </property> + <property name="URL"> + "jdbc:oracle:thin:@xxx:1521:xxx" + </property> + <property name="user">"xxx"</property> + <property name="password">"xxx"</property> + </component> + --> + + <!-- for PostgreSQL --> + <!-- + <component name="xaDataSource" + class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> + <property name="driverClassName"> + "org.postgresql.Driver" + </property> + <property name="URL"> + "jdbc:postgresql://localhost/TEST" + </property> + <property name="user">"xxxx"</property> + <property name="password">"xxxx"</property> + </component> + --> + + <!-- MySQL + - MySQL4.0以下でマルチバイト文字を扱う場合には,URL指定の後に, + 以下の接続パラメータを追加で指定してください. + useUnicode=true + characterEncoding=[MySQLのエンコーディングに対応した + Javaのエンコーディング名] + 例:"jdbc:mysql://localhost:3306/test?useUnicode=true" + + "&characterEncoding=Windows-31J" + + - MySQL5.0以降で,エンコーディングがeucjpmsの列を扱う場合には, + URL指定の後に,以下の接続パラメータを追加で指定してください. + characterEncoding=UTF-8またはWindows-31J + characterSetResults=UTF-8またはWindows-31J + 例:"jdbc:mysql://localhost:3306/test?characterEncoding=UTF-8" + + "&characterSetResults=UTF-8" + この指定をしない場合,Java側でUCS-2⇔EUC_JP_Solarisの変換が + 行なわれるため,ユーザー定義外字などの一部の文字が化けます. + この指定をすることで,MySQL側でeucjpms⇔ucs2⇔utf8(cp932)の + 変換が行なわれ,Java側でUCS-2⇔UTF-8(Windows-31J)の変換が + 行なわれるようになります.この結果,文字化けを防げます. + なおJIS X 0212(補助漢字)を使用する場合は,Windows-31Jではなく + UTF-8を指定する必要があります. + + - 上記以外の場合は,my.cnfでdefault-character-setの設定を適切に + (cp932やutf8など.デフォルトのlatin1は不可)行なっていれば, + 文字化けは防げます. + --> + <!-- + <component name="xaDataSource" + class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> + <property name="driverClassName"> + "com.mysql.jdbc.Driver" + </property> + <property name="URL"> + "jdbc:mysql://localhost:3306/scheduler?noDatetimeStringSync=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true" + </property> + <property name="user">"scheduler"</property> + <property name="password">"scheduler123"</property> + </component> + --> + + <!-- for SQLServer --> + <!-- + <component name="xaDataSource" + class="org.seasar.extension.dbcp.impl.XADataSourceImpl"> + <property name="driverClassName"> + "net.sourceforge.jtds.jdbc.Driver" + </property> + <property name="URL"> + "jdbc:jtds:sqlserver://localhost/TEST;instance=SQLEXPRESS" + </property> + <property name="user">"xxxx"</property> + <property name="password">"xxxx"</property> + </component> + --> + + <component name="connectionPool" + class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl"> + <property name="timeout">600</property> + <property name="maxPoolSize">10</property> + <property name="allowLocalTx">true</property> + <destroyMethod name="close"/> + </component> + + <component name="dataSource" + class="org.seasar.extension.dbcp.impl.DataSourceImpl" + /> + + <!-- from JNDI --> + <!-- + <component name="dataSource" + class="javax.sql.DataSource"> + @org.seasar.extension.j2ee.JndiResourceLocator @ lookup("java:comp/env/jdbc/DataSource") + </component> + --> + + <!-- + <component name="dataSource" + class="org.seasar.extension.datasource.impl.SelectableDataSourceProxy"/> + --> +</components> Added: scheduler/trunk/src/main/resources/s2container.dicon =================================================================== --- scheduler/trunk/src/main/resources/s2container.dicon (rev 0) +++ scheduler/trunk/src/main/resources/s2container.dicon 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN" + "http://www.seasar.org/dtd/components24.dtd"> +<components> + <include condition="#ENV == 'ut'" path="warmdeploy.dicon"/> + <include condition="#ENV == 'ct'" path="hotdeploy.dicon"/> + <include condition="#ENV != 'ut' and #ENV != 'ct'" path="cooldeploy.dicon"/> +</components> \ No newline at end of file Added: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.1.log.db =================================================================== (Binary files differ) Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.1.log.db ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.data.db =================================================================== (Binary files differ) Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.data.db ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.index.db =================================================================== (Binary files differ) Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/db/scheduler.index.db ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: scheduler/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> +<portlet-app xmlns="http://portals.apache.org/jetspeed" xmlns:js="http://portals.apache.org/jetspeed" xmlns:dc="http://www.purl.org/dc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="scheduler" version="1.0" xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd"> + <dc:title>Scheduler</dc:title> + <dc:creator>PAL Project</dc:creator> + <portlet> + <portlet-name>SchedulerConfig</portlet-name> + <js:security-constraint-ref>admin</js:security-constraint-ref> + </portlet> + <portlet> + <portlet-name>SchedulerManager</portlet-name> + <js:security-constraint-ref>admin</js:security-constraint-ref> + </portlet> +<!-- + <js:services> + <js:service name="SecurityProvider"/> + <js:service name="UserManager"/> + <js:service name="PageManager"/> + <js:service name="PortalAdministration"/> + <js:service name="GroupManager"/> + <js:service name="RoleManager"/> + <js:service name="ApplicationServerManager"/> + <js:service name="DeploymentManager"/> + <js:service name="EntityAccessor"/> + <js:service name="WindowAccessor"/> + <js:service name="PermissionManager"/> + <js:service name="PortalAdministration"/> + <js:service name="PortletFactory"/> + <js:service name="PortletRegistryComponent"/> + <js:service name="PortalStatistics"/> + <js:service name="Profiler"/> + <js:service name="SearchComponent"/> + <js:service name="SSO"/> + <js:service name="DecorationFactory"/> + <js:service name="SecurityAccessController"/> + <js:service name="PortletTrackingManager"/> + <js:service name="AuditActivity"/> + </js:services> +--> +</portlet-app> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/jetspeed-portlet.xml ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/portlet.xml =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/portlet.xml (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/portlet.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<portlet-app version="1.0"> + <portlet> + <portlet-name>SchedulerConfig</portlet-name> + <display-name>Scheduler: Scheduler Configuration</display-name> + <description>Edit configurations.</description> + <portlet-class>org.seasar.struts.portlet.SAStrutsPortlet</portlet-class> + <init-param> + <name>viewPage</name> + <value>/config/</value> + </init-param> + <expiration-cache>0</expiration-cache> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <supported-locale>ja</supported-locale> + <portlet-info> + <title>Scheduler Configuration</title> + <short-title>Config</short-title> + <keywords>Scheduler,URL</keywords> + </portlet-info> + </portlet> + <portlet> + <portlet-name>SchedulerManager</portlet-name> + <display-name>Scheduler: Scheduler Manager</display-name> + <description>Edit user information.</description> + <portlet-class>org.seasar.struts.portlet.SAStrutsPortlet</portlet-class> + <init-param> + <name>viewPage</name> + <value>/admin/singleSchedule/</value> + </init-param> + <expiration-cache>0</expiration-cache> + <supports> + <mime-type>text/html</mime-type> + <portlet-mode>VIEW</portlet-mode> + </supports> + <supported-locale>en</supported-locale> + <supported-locale>ja</supported-locale> + <portlet-info> + <title>Scheduler Manager</title> + <short-title>Schedulers</short-title> + <keywords>Scheduler,URL</keywords> + </portlet-info> + </portlet> +</portlet-app> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/portlet.xml ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/scheduler.xml =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/scheduler.xml (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/scheduler.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<configuration> +</configuration> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/scheduler.xml ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/struts-config.xml =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/struts-config.xml (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/struts-config.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,56 @@ +<?xml version="1.0"?> + +<!DOCTYPE struts-config PUBLIC + "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" + "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> + +<struts-config> + +<!-- ======================================== Form Bean Definitions --> + + <form-beans> + </form-beans> + +<!-- ================================= Global Exception Definitions --> + + <global-exceptions> + <exception path="/WEB-INF/view/error/norole.jsp" key="errors.norole" type="org.seasar.struts.exception.NoRoleRuntimeException"/> + </global-exceptions> + +<!-- =================================== Global Forward Definitions --> + + <global-forwards> + </global-forwards> + +<!-- =================================== Action Mapping Definitions --> + + <action-mappings> + </action-mappings> + + +<!-- ===================================== Controller Configuration --> + + <controller + maxFileSize="1024K" + bufferSize="1024" + processorClass="org.seasar.struts.portlet.action.S2RequestProcessor" + multipartClass="org.seasar.struts.upload.S2MultipartRequestHandler"/> +<!-- REPLACED: + processorClass="org.seasar.struts.action.S2RequestProcessor" +--> + + +<!-- ================================ Message Resources Definitions --> + + <message-resources parameter="application" + factory="org.seasar.struts.util.S2PropertyMessageResourcesFactory"/> + +<!-- ======================================= Plug Ins Configuration --> + + <plug-in className="org.seasar.struts.validator.S2ValidatorPlugIn"> + <set-property + property="pathnames" + value="/WEB-INF/validator-rules.xml"/> + </plug-in> +</struts-config> + Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/struts-config.xml ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/validator-rules.xml =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/validator-rules.xml (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/validator-rules.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,352 @@ +<!DOCTYPE form-validation PUBLIC + "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN" + "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd"> +<!-- + + This file contains the default Struts Validator pluggable validator + definitions. It should be placed somewhere under /WEB-INF and + referenced in the struts-config.xml under the plug-in element + for the ValidatorPlugIn. + + <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> + <set-property property="pathnames" value="/WEB-INF/validator-rules.xml, + /WEB-INF/validation.xml"/> + </plug-in> + + These are the default error messages associated with + each validator defined in this file. They should be + added to your projects ApplicationResources.properties + file or you can associate new ones by modifying the + pluggable validators msg attributes in this file. + + # Struts Validator Error Messages + errors.required={0} is required. + errors.minlength={0} can not be less than {1} characters. + errors.maxlength={0} can not be greater than {1} characters. + errors.invalid={0} is invalid. + + errors.byte={0} must be a byte. + errors.short={0} must be a short. + errors.integer={0} must be an integer. + errors.long={0} must be a long. + errors.float={0} must be a float. + errors.double={0} must be a double. + + errors.date={0} is not a date. + errors.range={0} is not in the range {1} through {2}. + errors.creditcard={0} is an invalid credit card number. + errors.email={0} is an invalid e-mail address. + errors.url={0} is an invalid url (web address). + + errors.minbytelength={0} can not be less than {1} bytes. + errors.maxbytelength={0} can not be greater than {1} bytes. + + Note: Starting in Struts 1.2.0 the default javascript definitions have + been consolidated to commons-validator. The default can be overridden + by supplying a <javascript> element with a CDATA section, just as + in struts 1.1. + +--> + +<form-validation> + + <global> + + <validator name="required" + classname="org.apache.struts.validator.FieldChecks" + method="validateRequired" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + msg="errors.required"/> + + <validator name="requiredif" + classname="org.apache.struts.validator.FieldChecks" + method="validateRequiredIf" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + msg="errors.required"/> + + <validator name="validwhen" + msg="errors.required" + classname="org.apache.struts.validator.validwhen.ValidWhen" + method="validateValidWhen" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest"/> + + + <validator name="minlength" + classname="org.apache.struts.validator.FieldChecks" + method="validateMinLength" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.minlength" + jsFunction="org.apache.commons.validator.javascript.validateMinLength"/> + + + <validator name="maxlength" + classname="org.apache.struts.validator.FieldChecks" + method="validateMaxLength" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.maxlength" + jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/> + + + + <validator name="mask" + classname="org.apache.struts.validator.FieldChecks" + method="validateMask" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.invalid"/> + + + <validator name="byte" + classname="org.apache.struts.validator.FieldChecks" + method="validateByte" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.byte" + jsFunctionName="ByteValidations"/> + + + <validator name="short" + classname="org.apache.struts.validator.FieldChecks" + method="validateShort" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.short" + jsFunctionName="ShortValidations"/> + + + <validator name="integer" + classname="org.apache.struts.validator.FieldChecks" + method="validateInteger" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.integer" + jsFunctionName="IntegerValidations"/> + + + + <validator name="long" + classname="org.apache.struts.validator.FieldChecks" + method="validateLong" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.long"/> + + + <validator name="float" + classname="org.apache.struts.validator.FieldChecks" + method="validateFloat" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.float" + jsFunctionName="FloatValidations"/> + + <validator name="double" + classname="org.apache.struts.validator.FieldChecks" + method="validateDouble" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.double"/> + + + <validator name="date" + classname="org.apache.struts.validator.FieldChecks" + method="validateDate" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.date" + jsFunctionName="DateValidations"/> + + + <validator name="intRange" + classname="org.apache.struts.validator.FieldChecks" + method="validateIntRange" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="integer" + msg="errors.range"/> + + + <validator name="floatRange" + classname="org.apache.struts.validator.FieldChecks" + method="validateFloatRange" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="float" + msg="errors.range"/> + + <validator name="doubleRange" + classname="org.apache.struts.validator.FieldChecks" + method="validateDoubleRange" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="double" + msg="errors.range"/> + + <validator name="creditCard" + classname="org.apache.struts.validator.FieldChecks" + method="validateCreditCard" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.creditcard"/> + + + <validator name="email" + classname="org.apache.struts.validator.FieldChecks" + method="validateEmail" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.email"/> + + <validator name="url" + classname="org.apache.struts.validator.FieldChecks" + method="validateUrl" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.url"/> + + <validator name="minbytelength" + classname="org.seasar.struts.validator.S2FieldChecks" + method="validateMinByteLength" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.minbytelength"/> + + + <validator name="maxbytelength" + classname="org.seasar.struts.validator.S2FieldChecks" + method="validateMaxByteLength" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="" + msg="errors.maxbytelength"/> + + <validator name="longRange" + classname="org.seasar.struts.validator.S2FieldChecks" + method="validateLongRange" + methodParams="java.lang.Object, + org.apache.commons.validator.ValidatorAction, + org.apache.commons.validator.Field, + org.apache.struts.action.ActionMessages, + org.apache.commons.validator.Validator, + javax.servlet.http.HttpServletRequest" + depends="long" + msg="errors.range"/> + + <!-- + This simply allows struts to include the validateUtilities into a page, it should + not be used as a validation rule. + --> + <validator name="includeJavaScriptUtilities" + classname="" + method="" + methodParams="" + depends="" + msg="" + jsFunction="org.apache.commons.validator.javascript.validateUtilities"/> + + </global> + +</form-validation> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/validator-rules.xml ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/confirm.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/confirm.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/confirm.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,122 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selectable"><s:link href="/admin/singleSchedule/" style="text-decoration: none;">One Time</s:link></li> + <li class="spacer"></li> + <li class="selected"><span>Repeats</span></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + + <s:form> + <html:hidden property="id"/> + <html:hidden property="mode"/> + <div class="form-table" style="margin-top:3px;"> + <table style="width: 400px;"> + <caption><bean:message key="labels.confirmation_of_event"/></caption> + <tbody> + <tr> + <th style="width: 120px;">What</th> + <td>${f:h(title)}<html:hidden property="title"/></td> + </tr> + <tr> + <th>Where</th> + <td>${f:h(location)}<html:hidden property="location"/></td> + </tr> + <tr> + <th>Repeats</th> + <td> +<c:if test="${type=='MTWTFSS'}">Daily</c:if> +<c:if test="${type=='MTWTF'}">Every weekday (Mon-Fri)</c:if> +<c:if test="${type=='MWF'}">Every Mon., Wed., and Fri.</c:if> +<c:if test="${type=='TT'}">Every Tues., and Thurs.</c:if> +<c:if test="${type=='WEEKLY'}">Weekly</c:if> +<c:if test="${type=='MONTHLY'}">Monthly</c:if> +<c:if test="${type=='YEARLY'}">Yearly</c:if> +<html:hidden property="type"/> + </td> + </tr> + <tr> + <th rowspan="2">When</th> + <td> +From: + ${f:h(startDate)}<html:hidden property="startDate"/> + ${f:h(startTime)}<html:hidden property="startTime"/> + </td> + </tr> + <tr> + <td> +To: + ${f:h(endDate)}<html:hidden property="endDate"/> + ${f:h(endTime)}<html:hidden property="endTime"/> + </td> + </tr> + <tr> + <th>Description</th> + <td>${f:br(f:h(content))}<html:hidden property="content"/></td> + </tr> + <tr> + <th>Assigned</th> + <td> +<table> + <tbody> + <tr> + <th style="width:200px;">Name</th> + </tr> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <tr> + <td>${f:h(u.displayName)}</td> + </tr> + </c:forEach> + </tbody> +</table> +<html:select property="selectedUsers" multiple="true" style="display:none;"> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:u(u.userId)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <c:if test="${mode == 1}"> + <input type="submit" name="create" value="<bean:message key="labels.create"/>"/> + <input type="submit" name="editagain" value="<bean:message key="labels.back"/>"/> + </c:if> + <c:if test="${mode == 2}"> + <input type="submit" name="update" value="<bean:message key="labels.update"/>"/> + <input type="submit" name="editagain" value="<bean:message key="labels.back"/>"/> + </c:if> + <c:if test="${mode == 3}"> + <input type="submit" name="delete" value="<bean:message key="labels.delete"/>"/> + <input type="submit" name="back" value="<bean:message key="labels.back"/>"/> + </c:if> + <c:if test="${mode == 4}"> + <input type="submit" name="back" value="<bean:message key="labels.back"/>"/> + <input type="submit" name="editpagefromconfirm" value="<bean:message key="labels.edit"/>"/> + <input type="submit" name="deletepagefromconfirm" value="<bean:message key="labels.delete"/>"/> + </c:if> + </td> + </tr> + </tfoot> + </table> + </div> + </s:form> +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/confirm.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/edit.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/edit.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,115 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selectable"><s:link href="/admin/singleSchedule/" style="text-decoration: none;">One Time</s:link></li> + <li class="spacer"></li> + <li class="selected"><span>Repeats</span></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + + <s:form> + <html:hidden property="id"/> + <html:hidden property="mode"/> + <div class="form-table" style="margin-top:3px;"> + <table style="width: 400px;"> + <caption><bean:message key="labels.event_detail"/></caption> + <tbody> + <tr> + <th style="width: 120px;">What</th> + <td><html:text property="title" size="20"/></td> + </tr> + <tr> + <th>Where</th> + <td><html:text property="location" size="20"/></td> + </tr> + <tr> + <th>Repeats</th> + <td> +<html:select property="type"> + <html:option value="MTWTFSS">Daily</html:option> + <html:option value="MTWTF">Every weekday (Mon-Fri)</html:option> + <html:option value="MWF">Every Mon., Wed., and Fri.</html:option> + <html:option value="TT">Every Tues., and Thurs.</html:option> + <html:option value="WEEKLY">Weekly</html:option> + <html:option value="MONTHLY">Monthly</html:option> + <html:option value="YEARLY">Yearly</html:option> +</html:select> + </td> + </tr> + <tr> + <th rowspan="2">When</th> + <td> +From: + <html:text property="startDate" size="10"/> + <html:text property="startTime" size="5"/> + </td> + </tr> + <tr> + <td> +To: + <html:text property="endDate" size="10"/> + <html:text property="endTime" size="5"/> + </td> + </tr> + <tr> + <th>Description</th> + <td><html:textarea property="content" cols="20" rows="5"/></td> + </tr> + <tr> + <th>Assigned</th> + <td> +<table> + <tbody> + <tr> + <th style="width:200px;">Name</th> + </tr> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <tr> + <td>${f:h(u.displayName)}</td> + </tr> + </c:forEach> + </tbody> + <tfoot> + <tr> + <td> +<input type="submit" name="selectusers" value="Select Users"/> + </td> + </tr> + </tfoot> +</table> +<html:select property="selectedUsers" multiple="true" style="display:none;"> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:u(u.userId)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <input type="submit" name="confirm" value="<bean:message key="labels.confirm"/>"/> + <input type="submit" name="back" value="<bean:message key="labels.back"/>"/> + </td> + </tr> + </tfoot> + </table> + </div> + </s:form> +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/edit.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/error.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/error.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/error.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,25 @@ +<%@page pageEncoding="UTF-8" %> +<html> +<head> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selectable"><s:link href="/admin/singleSchedule/" style="text-decoration: none;">One Time</s:link></li> + <li class="spacer"></li> + <li class="selected"><span>Repeats</span></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<html:errors/> +<br> +<s:link href="index"><bean:message key="labels.back"/></s:link> +</div> +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/error.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/index.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/index.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/index.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,82 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selectable"><s:link href="/admin/singleSchedule/" style="text-decoration: none;">One Time</s:link></li> + <li class="spacer"></li> + <li class="selected"><span>Repeats</span></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + +<div class="list-table" style="margin-top:3px;"> +<div> +<s:link href="createpage"><bean:message key="labels.create_new_event"/></s:link> +</div> +<table border="1"> + <thead> + <tr> + <th style="width:50px;text-align: center;">ID</th> + <th style="width:200px;text-align: center;">Title</th> + <th style="width:100px;text-align: center;"> </th> + </tr> + </thead> + <tbody> + <c:forEach var="ss" varStatus="s" items="${routineScheduleItems}"> + <tr class="${s.index %2 == 0 ? 'row1' : 'row2'}"> + <td><s:link href="confirmpage/4/${f:u(ss.id)}">${f:h(ss.id)}</s:link></td> + <td>${f:h(ss.title)}</td> + <td align="center"> + <s:link href="editpage/2/${f:u(ss.id)}"><bean:message key="labels.edit"/></s:link> + <s:link href="deletepage/3/${f:u(ss.id)}"><bean:message key="labels.delete"/></s:link> + </td> + </tr> + </c:forEach> + </tbody> +</table> +<!-- page navi --> +<div style="width: 450px;text-align: center;"> + <span> + <c:if test="${routineSchedulePager.existPrePage}"> + <s:link href="list/${routineSchedulePager.currentPageNumber - 1}"><bean:message key="labels.to_back"/></s:link> + </c:if> + </span> + <span> + <c:forEach var="p" varStatus="s" items="${routineSchedulePager.pageNumberList}"> + <span> + <c:if test="${p == routineSchedulePager.currentPageNumber}"> + ${p} + </c:if> + <c:if test="${p != routineSchedulePager.currentPageNumber}"> + <s:link href="list/${p}">${p}</s:link> + </c:if> + </span> + </c:forEach> + </span> + <span> + <c:if test="${routineSchedulePager.existNextPage}"> + <s:link href="list/${routineSchedulePager.currentPageNumber + 1}"><bean:message key="labels.to_next"/></s:link> + </c:if> + </span> +</div> +<div style="width: 450px;text-align: center;"> + <span> + ${routineSchedulePager.currentPageNumber}/${routineSchedulePager.allPageCount} (${routineSchedulePager.allRecordCount}) + </span> +</div> +</div> +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/index.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/userlist.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/userlist.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,99 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selectable"><s:link href="/admin/singleSchedule/" style="text-decoration: none;">One Time</s:link></li> + <li class="spacer"></li> + <li class="selected"><span>Repeats</span></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + +<s:form> +<div style="margin-top:3px;"> +<html:hidden property="id"/> +<html:hidden property="mode"/> +<html:hidden property="title"/> +<html:hidden property="location"/> +<html:hidden property="startDate"/> +<html:hidden property="startTime"/> +<html:hidden property="endDate"/> +<html:hidden property="endTime"/> +<html:hidden property="content"/> +<html:hidden property="type"/> +<div class="form-table" style="float:left;width: 200px;"> +<table> + <thead> + <tr> + <th>User List</th> + </tr> + </thead> + <tbody> + <tr> + <td> +<html:select property="addedUsers" multiple="true" size="10" style="width:180px;"> +<!-- TODO i18n --> + <c:forEach var="u" varStatus="s" items="${availableUserItems}"> + <html:option value="${f:u(u.userId)}">${f:h(u.displayName)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> +</table> +</div> +<div style="float:left;width: 100px;height: 200px;text-align: center;padding-top:60px;"> +<input type="submit" name="addusers" value="Add >>"/> +<input type="submit" name="removeusers" value="<< Remove"/> +</div> +<div class="form-table" style="float:left;width: 200px;"> +<table> + <thead> + <tr> + <th>Selected User List</th> + </tr> + </thead> + <tbody> + <tr> + <td> +<html:select property="removedUsers" multiple="true" size="10" style="width:180px;"> +<!-- TODO i18n --> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:h(u.displayName)}</html:option> + </c:forEach> +</html:select> +<html:select property="selectedUsers" multiple="true" style="display:none;"> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:u(u.userId)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td> +<input type="submit" name="setusers" value="OK"/> + </td> + </tr> + </tfoot> +</table> +</div> +</div> +</s:form> + +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/routineSchedule/userlist.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/confirm.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/confirm.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/confirm.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,109 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selected"><span>One time</span></li> + <li class="spacer"></li> + <li class="selectable"><s:link href="/admin/routineSchedule/" style="text-decoration: none;">Repeats</s:link></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + + <s:form> + <html:hidden property="id"/> + <html:hidden property="mode"/> + <div class="form-table" style="margin-top:3px;"> + <table style="width: 400px;"> + <caption><bean:message key="labels.confirmation_of_event"/></caption> + <tbody> + <tr> + <th style="width: 120px;">What</th> + <td>${f:h(title)}<html:hidden property="title"/></td> + </tr> + <tr> + <th>Where</th> + <td>${f:h(location)}<html:hidden property="location"/></td> + </tr> + <tr> + <th rowspan="2">When</th> + <td> +From: + ${f:h(startDate)}<html:hidden property="startDate"/> + ${f:h(startTime)}<html:hidden property="startTime"/> + </td> + </tr> + <tr> + <td> +To: + ${f:h(endDate)}<html:hidden property="endDate"/> + ${f:h(endTime)}<html:hidden property="endTime"/> + </td> + </tr> + <tr> + <th>Description</th> + <td>${f:br(f:h(content))}<html:hidden property="content"/></td> + </tr> + <tr> + <th>Assigned</th> + <td> +<table> + <tbody> + <tr> + <th style="width:200px;">Name</th> + </tr> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <tr> + <td>${f:h(u.displayName)}</td> + </tr> + </c:forEach> + </tbody> +</table> +<html:select property="selectedUsers" multiple="true" style="display:none;"> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:u(u.userId)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <c:if test="${mode == 1}"> + <input type="submit" name="create" value="<bean:message key="labels.create"/>"/> + <input type="submit" name="editagain" value="<bean:message key="labels.back"/>"/> + </c:if> + <c:if test="${mode == 2}"> + <input type="submit" name="update" value="<bean:message key="labels.update"/>"/> + <input type="submit" name="editagain" value="<bean:message key="labels.back"/>"/> + </c:if> + <c:if test="${mode == 3}"> + <input type="submit" name="delete" value="<bean:message key="labels.delete"/>"/> + <input type="submit" name="back" value="<bean:message key="labels.back"/>"/> + </c:if> + <c:if test="${mode == 4}"> + <input type="submit" name="back" value="<bean:message key="labels.back"/>"/> + <input type="submit" name="editpagefromconfirm" value="<bean:message key="labels.edit"/>"/> + <input type="submit" name="deletepagefromconfirm" value="<bean:message key="labels.delete"/>"/> + </c:if> + </td> + </tr> + </tfoot> + </table> + </div> + </s:form> +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/confirm.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/edit.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/edit.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/edit.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,101 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selected"><span>One time</span></li> + <li class="spacer"></li> + <li class="selectable"><s:link href="/admin/routineSchedule/" style="text-decoration: none;">Repeats</s:link></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + + <s:form> + <html:hidden property="id"/> + <html:hidden property="mode"/> + <div class="form-table" style="margin-top:3px;"> + <table style="width: 400px;"> + <caption><bean:message key="labels.event_detail"/></caption> + <tbody> + <tr> + <th style="width: 120px;">What</th> + <td><html:text property="title" size="20"/></td> + </tr> + <tr> + <th>Where</th> + <td><html:text property="location" size="20"/></td> + </tr> + <tr> + <th rowspan="2">When</th> + <td> +From: + <html:text property="startDate" size="10"/> + <html:text property="startTime" size="5"/> + </td> + </tr> + <tr> + <td> +To: + <html:text property="endDate" size="10"/> + <html:text property="endTime" size="5"/> + </td> + </tr> + <tr> + <th>Description</th> + <td><html:textarea property="content" cols="20" rows="5"/></td> + </tr> + <tr> + <th>Assigned</th> + <td> +<table> + <tbody> + <tr> + <th style="width:200px;">Name</th> + </tr> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <tr> + <td>${f:h(u.displayName)}</td> + </tr> + </c:forEach> + </tbody> + <tfoot> + <tr> + <td> +<input type="submit" name="selectusers" value="Select Users"/> + </td> + </tr> + </tfoot> +</table> +<html:select property="selectedUsers" multiple="true" style="display:none;"> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:u(u.userId)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> + <input type="submit" name="confirm" value="<bean:message key="labels.confirm"/>"/> + <input type="submit" name="back" value="<bean:message key="labels.back"/>"/> + </td> + </tr> + </tfoot> + </table> + </div> + </s:form> +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/edit.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/error.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/error.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/error.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,25 @@ +<%@page pageEncoding="UTF-8" %> +<html> +<head> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selected"><span>One time</span></li> + <li class="spacer"></li> + <li class="selectable"><s:link href="/admin/routineSchedule/" style="text-decoration: none;">Repeats</s:link></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<html:errors/> +<br> +<s:link href="index"><bean:message key="labels.back"/></s:link> +</div> +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/error.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/index.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/index.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/index.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,82 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selected"><span>One time</span></li> + <li class="spacer"></li> + <li class="selectable"><s:link href="/admin/routineSchedule/" style="text-decoration: none;">Repeats</s:link></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + +<div class="list-table" style="margin-top:3px;"> +<div> +<s:link href="createpage"><bean:message key="labels.create_new_event"/></s:link> +</div> +<table border="1"> + <thead> + <tr> + <th style="width:50px;text-align: center;">ID</th> + <th style="width:200px;text-align: center;">Title</th> + <th style="width:100px;text-align: center;"> </th> + </tr> + </thead> + <tbody> + <c:forEach var="ss" varStatus="s" items="${singleScheduleItems}"> + <tr class="${s.index %2 == 0 ? 'row1' : 'row2'}"> + <td><s:link href="confirmpage/4/${f:u(ss.id)}">${f:h(ss.id)}</s:link></td> + <td>${f:h(ss.title)}</td> + <td align="center"> + <s:link href="editpage/2/${f:u(ss.id)}"><bean:message key="labels.edit"/></s:link> + <s:link href="deletepage/3/${f:u(ss.id)}"><bean:message key="labels.delete"/></s:link> + </td> + </tr> + </c:forEach> + </tbody> +</table> +<!-- page navi --> +<div style="width: 450px;text-align: center;"> + <span> + <c:if test="${singleSchedulePager.existPrePage}"> + <s:link href="list/${singleSchedulePager.currentPageNumber - 1}"><bean:message key="labels.to_back"/></s:link> + </c:if> + </span> + <span> + <c:forEach var="p" varStatus="s" items="${singleSchedulePager.pageNumberList}"> + <span> + <c:if test="${p == singleSchedulePager.currentPageNumber}"> + ${p} + </c:if> + <c:if test="${p != singleSchedulePager.currentPageNumber}"> + <s:link href="list/${p}">${p}</s:link> + </c:if> + </span> + </c:forEach> + </span> + <span> + <c:if test="${singleSchedulePager.existNextPage}"> + <s:link href="list/${singleSchedulePager.currentPageNumber + 1}"><bean:message key="labels.to_next"/></s:link> + </c:if> + </span> +</div> +<div style="width: 450px;text-align: center;"> + <span> + ${singleSchedulePager.currentPageNumber}/${singleSchedulePager.allPageCount} (${singleSchedulePager.allRecordCount}) + </span> +</div> +</div> +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/index.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/userlist.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/userlist.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/userlist.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,98 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<!-- tab: BEGIN --> +<div class="tab-nav"> + <ul> + <li class="first"></li> + <li class="selected"><span>One time</span></li> + <li class="spacer"></li> + <li class="selectable"><s:link href="/admin/routineSchedule/" style="text-decoration: none;">Repeats</s:link></li> + <li class="last"></li> + </ul> +</div> +<!-- tab: END --> + +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> + +<s:form> +<div style="margin-top:3px;"> +<html:hidden property="id"/> +<html:hidden property="mode"/> +<html:hidden property="title"/> +<html:hidden property="location"/> +<html:hidden property="startDate"/> +<html:hidden property="startTime"/> +<html:hidden property="endDate"/> +<html:hidden property="endTime"/> +<html:hidden property="content"/> +<div class="form-table" style="float:left;width: 200px;"> +<table> + <thead> + <tr> + <th>User List</th> + </tr> + </thead> + <tbody> + <tr> + <td> +<html:select property="addedUsers" multiple="true" size="10" style="width:180px;"> +<!-- TODO i18n --> + <c:forEach var="u" varStatus="s" items="${availableUserItems}"> + <html:option value="${f:u(u.userId)}">${f:h(u.displayName)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> +</table> +</div> +<div style="float:left;width: 100px;height: 200px;text-align: center;padding-top:60px;"> +<input type="submit" name="addusers" value="Add >>"/> +<input type="submit" name="removeusers" value="<< Remove"/> +</div> +<div class="form-table" style="float:left;width: 200px;"> +<table> + <thead> + <tr> + <th>Selected User List</th> + </tr> + </thead> + <tbody> + <tr> + <td> +<html:select property="removedUsers" multiple="true" size="10" style="width:180px;"> +<!-- TODO i18n --> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:h(u.displayName)}</html:option> + </c:forEach> +</html:select> +<html:select property="selectedUsers" multiple="true" style="display:none;"> + <c:forEach var="u" varStatus="s" items="${selectedUserItems}"> + <html:option value="${f:u(u.userId)}">${f:u(u.userId)}</html:option> + </c:forEach> +</html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td> +<input type="submit" name="setusers" value="OK"/> + </td> + </tr> + </tfoot> +</table> +</div> +</div> +</s:form> + +</div> + +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/admin/singleSchedule/userlist.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/common/common.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/common/common.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/common/common.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,9 @@ +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%> +<%@taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%> +<%@taglib prefix="tiles" uri="http://jakarta.apache.org/struts/tags-tiles"%> +<!-- %@taglib prefix="s" uri="http://sastruts.seasar.org"% --> +<%@taglib prefix="f" uri="http://sastruts.seasar.org/functions"%> +<%@taglib prefix="s" uri="http://sastruts.seasar.org/portlet"%> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/common/common.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/view/config/index.jsp =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/view/config/index.jsp (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/view/config/index.jsp 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,46 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +<title></title> +</head> +<body> +<div style="padding:3px;"> +<div><html:messages id="msg" message="true"><bean:write name="msg" ignore="true"/></html:messages><html:errors/></div> +<div class="form-table"> +<s:form> +<table> + <caption><bean:message key="labels.config"/></caption> + <tbody> + <tr> + <th><bean:message key="labels.role"/></th> + <td> + <html:select property="roleAvailable"> + <html:option value="true"><bean:message key="labels.enabled"/></html:option> + <html:option value="false"><bean:message key="labels.disabled"/></html:option> + </html:select> + </td> + </tr> + <tr> + <th><bean:message key="labels.group"/></th> + <td> + <html:select property="groupAvailable"> + <html:option value="true"><bean:message key="labels.enabled"/></html:option> + <html:option value="false"><bean:message key="labels.disabled"/></html:option> + </html:select> + </td> + </tr> + </tbody> + <tfoot> + <tr> + <td colspan="2"> +<input type="submit" name="update" value="<bean:message key="labels.update"/>"/> + </td> + </tr> + </tfoot> +</table> +</s:form> +</div> +</div> +</body> +</html> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/view/config/index.jsp ___________________________________________________________________ Name: svn:eol-style + native Added: scheduler/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- scheduler/trunk/src/main/webapp/WEB-INF/web.xml (rev 0) +++ scheduler/trunk/src/main/webapp/WEB-INF/web.xml 2008-11-14 09:14:02 UTC (rev 1350) @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright 2004-2008 PAL Project and the Others. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language + * governing permissions and limitations under the License. +--> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> + <display-name>Scheduler</display-name> + <context-param> + <param-name>sastruts.VIEW_PREFIX</param-name> + <param-value>/WEB-INF/view</param-value> + </context-param> + <filter> + <filter-name>encodingfilter</filter-name> + <filter-class>org.seasar.extension.filter.EncodingFilter</filter-class> + <init-param> + <param-name>encoding</param-name> + <param-value>UTF-8</param-value> + </init-param> + </filter> + <filter> + <filter-name>portletRequestFilter</filter-name> + <filter-class>org.seasar.struts.portlet.filter.PortletRequestFilter</filter-class> + </filter> + <filter> + <filter-name>requestDumpFilter</filter-name> + <filter-class>org.seasar.extension.filter.RequestDumpFilter</filter-class> + </filter> + <filter> + <filter-name>s2filter</filter-name> + <filter-class>org.seasar.struts.portlet.filter.S2ContainerFilter</filter-class> + </filter> + <filter> + <filter-name>hotdeployfilter</filter-name> + <filter-class>org.seasar.struts.portlet.filter.HotdeployFilter</filter-class> + </filter> + <filter> + <filter-name>routingfilter</filter-name> + <filter-class>org.seasar.struts.filter.RoutingFilter</filter-class> + <init-param> + <param-name>jspDirectAccess</param-name> + <param-value>false</param-value> + </init-param> + </filter> + <filter> + <filter-name>portletRoutingfilter</filter-name> + <filter-class>org.seasar.struts.portlet.filter.PortletRoutingFilter</filter-class> + <init-param> + <param-name>jspDirectAccess</param-name> + <param-value>false</param-value> + </init-param> + </filter> + <filter-mapping> + <filter-name>encodingfilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>portletRequestFilter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>INCLUDE</dispatcher> + </filter-mapping> + <filter-mapping> + <filter-name>s2filter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + <dispatcher>INCLUDE</dispatcher> + </filter-mapping> + <filter-mapping> + <filter-name>hotdeployfilter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + <dispatcher>INCLUDE</dispatcher> + </filter-mapping> + <filter-mapping> + <filter-name>routingfilter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + </filter-mapping> + <filter-mapping> + <filter-name>portletRoutingfilter</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>INCLUDE</dispatcher> + </filter-mapping> + <filter-mapping> + <filter-name>requestDumpFilter</filter-name> + <url-pattern>*.do</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + <dispatcher>INCLUDE</dispatcher> + </filter-mapping> + <servlet> + <servlet-name>action</servlet-name> + <servlet-class>org.seasar.struts.portlet.servlet.ActionServlet</servlet-class> + <init-param> + <param-name>config</param-name> + <param-value>/WEB-INF/struts-config.xml</param-value> + </init-param> + <init-param> + <param-name>configFactory</param-name> + <param-value>org.seasar.struts.config.S2ModuleConfigFactory</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet> + <servlet-name>s2container</servlet-name> + <servlet-class>org.seasar.framework.container.servlet.S2ContainerServlet</servlet-class> + <load-on-startup>2</load-on-startup> + </servlet> +<!-- BEGIN: J2 + <servlet> + <description>MVC Servlet for Jetspeed Portlet Applications</description> + <display-name>Jetspeed Container</display-name> + <servlet-name>JetspeedContainer</servlet-name> + <servlet-class>org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class> + <init-param> + <param-name>contextName</param-name> + <param-value>scheduler</param-value> + </init-param> + <load-on-startup>0</load-on-startup> + </servlet> + END: J2 --> + <servlet-mapping> + <servlet-name>action</servlet-name> + <url-pattern>*.do</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>s2container</servlet-name> + <url-pattern>/s2container</url-pattern> + </servlet-mapping> +<!-- BEGIN: J2 + <servlet-mapping> + <servlet-name>JetspeedContainer</servlet-name> + <url-pattern>/container/*</url-pattern> + </servlet-mapping> + END: J2 --> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + <welcome-file>index.htm</welcome-file> + <welcome-file>index.jsp</welcome-file> + </welcome-file-list> + <jsp-config> +<!-- BEGIN: J2 + <taglib> + <taglib-uri>http://java.sun.com/portlet</taglib-uri> + <taglib-location>/WEB-INF/tld/portlet.tld</taglib-location> + </taglib> + END: J2 --> + <jsp-property-group> + <url-pattern>*.jsp</url-pattern> + <el-ignored>false</el-ignored> + <page-encoding>UTF-8</page-encoding> + <scripting-invalid>false</scripting-invalid> + <include-prelude>/WEB-INF/view/common/common.jsp</include-prelude> + </jsp-property-group> + </jsp-config> +</web-app> Property changes on: scheduler/trunk/src/main/webapp/WEB-INF/web.xml ___________________________________________________________________ Name: svn:eol-style + native